In my Win app, I have an event that calls method myMethod.Process() which
returns a struct. This method Process() is composed of several other
methods: openDB(), checkDB, expireDB(), etc... and all these methods return
0 (Success) or 1 (Fail). If any of these methods return a 0, the process is
cancelled. How can I return the 1 value (failure) if the method itself
returns a struct?
Here's some of the code:
private void btn_getZip_Click_1(object sender, System.EventArgs e)
{
myMethod m1 = new myMethod();
myStruct Struct1 = new myStruct();
zipStruct = myMethod.Process();
}
--------------------------------
class myMethod:
public myStruct Process()
{
myStruct Struct1 = new myStruct();
if ((OpenDB() == 0) && (ExpDB == 0))
{
int iRes = goProc(Struct1): // initialization was successful
}
else
{
// How do I tell event btn_getZip_Click_1 that OpenDB() or ExpDB()
failed? I'd like to be able to send the value "1" and the method that
returned it.
}
Thanks again.