예제 #1
0
 public UseData()
 {
     Context = new WMAERPEntities();
     if (Context.Database.Connection.State != ConnectionState.Open)
     {
         Context.Database.Connection.Open();
     }
     Db = Context;
     LastKeysErrorMsg = new ResourceKeys();
 }
예제 #2
0
 public UseData(tbl_Users user, string formName, string masterKey = "", T currentObj = null, ResourceKeys lastKeysErrorMsg = null, string formType = null)
     : this()
 {
     _formType        = formType;
     _formName        = formName;
     _user            = user;
     LastKeysErrorMsg = lastKeysErrorMsg ?? new ResourceKeys();
     if (masterKey != "")
     {
         MasterKey = masterKey;
     }
     else if (GetKeys.Length > 0)
     {
         MasterKey = GetKeys[0];
     }
     Current = currentObj ?? new T();
 }