Example #1
0
 private bool DoLogin()
 {
     try
     {
         using (Accessor access = new Accessor(Global.DataFileName))
         {
             access.Connect(Global.Password);
         }
         return true;
     }
     catch (Exception ex)
     {
         return false;
     }
 }
Example #2
0
 public void Save()
 {
     switch (this.Status)
     {
         case DataStatus.NoChanged:
             break;
         case DataStatus.New:
             {
                 var cmd = this.GenInsertString();
                 using (Accessor access = new Accessor(Global.DataFileName))
                 {
                     access.Connect(Global.Password);
                     access.ExecuteUID(cmd);
                 }
             }
             break;
         case DataStatus.Changed:
             {
                 var cmd = this.GenUpdateString();
                 using (Accessor access = new Accessor(Global.DataFileName))
                 {
                     access.Connect(Global.Password);
                     access.ExecuteUID(cmd);
                 }
             }
             break;
         case DataStatus.Deleted:
             {
                 var cmd = this.GenDeleteString();
                 using (Accessor access = new Accessor(Global.DataFileName))
                 {
                     access.Connect(Global.Password);
                     access.ExecuteUID(cmd);
                 }
             }
             break;
     }
 }