示例#1
0
 public void AddClassification(DFClass rec)
 {
     if (rec.Id == Guid.Empty)
     {
         WriteLog(VMGlobal.LOG_ACTION.SAVE, string.Format("Classification: {0}", rec.Name), AccountId);
         context.DFClasses.Add(rec);
         return;
     }
     WriteLog(VMGlobal.LOG_ACTION.UPDATE, string.Format("{0}", rec.Name), this.AccountId);
     context.Entry(rec).State = EntityState.Modified;
 }
示例#2
0
 public void InsertUpdate(Department rec)
 {
     if (rec.Id == Guid.Empty)
     {
         context.Departments.Add(rec);
     }
     else
     {
         context.Entry(rec).State = EntityState.Modified;
     }
 }
示例#3
0
 public void InsertUpdate(AlertEmail rec)
 {
     if (rec.Id == Guid.Empty)
     {
         context.AlertEmails.Add(rec);
     }
     else
     {
         context.Entry(rec).State = EntityState.Modified;
     }
 }
示例#4
0
 public void InsertUpdate(DomainConfig rec)
 {
     if (rec.Id == Guid.Empty)
     {
         context.DomainCfg.Add(rec);
     }
     else
     {
         context.Entry(rec).State = EntityState.Modified;
     }
 }
示例#5
0
 public void InsertUpdate(AccountGroup rec)
 {
     if (rec.Id == Guid.Empty)
     {
         context.AccountGroups.Add(rec);
     }
     else
     {
         context.Entry(rec).State = EntityState.Modified;
     }
 }
示例#6
0
 public void SaveUpdate(CameraFolder rec)
 {
     if (rec.Id == Guid.Empty)
     {
         context.CameraFolders.Add(rec);
     }
     else
     {
         context.Entry(rec).State = EntityState.Modified;
     }
 }
示例#7
0
 public void SaveUpdate(License rec)
 {
     if (rec.Id == Guid.Empty)
     {
         context.Licenses.Add(rec);
     }
     else
     {
         context.Entry(rec).State = EntityState.Modified;
     }
 }
示例#8
0
 public void InsertUpdate(Manufacturer rec)
 {
     if (rec.Id == Guid.Empty)
     {
         context.Manufacturers.Add(rec);
     }
     else
     {
         context.Entry(rec).State = EntityState.Modified;
     }
 }
示例#9
0
 public void InsertUpdate(FileType rec)
 {
     if (rec.Id == Guid.Empty)
     {
         context.FileTypes.Add(rec);
     }
     else
     {
         context.Entry(rec).State = EntityState.Modified;
     }
 }
示例#10
0
 public void InsertUpdateClassification(Classification rec)
 {
     if (rec.Id == Guid.Empty)
     {
         context.Classifications.Add(rec);
     }
     else
     {
         context.Entry(rec).State = EntityState.Modified;
     }
 }
示例#11
0
 public void InsertUpdate(RightsProfile rec)
 {
     if (rec.Id == Guid.Empty)
     {
         context.RightsProfiles.Add(rec);
     }
     else
     {
         context.Entry(rec).State = EntityState.Modified;
     }
 }
示例#12
0
 public void SaveUpdate(Snapshot rec)
 {
     if (rec.Id == Guid.Empty)
     {
         context.Snapshots.Add(rec);
     }
     else
     {
         context.Entry(rec).State = EntityState.Modified;
     }
 }
示例#13
0
 public void InsertUpdate(UserRank rec)
 {
     if (rec.Id == Guid.Empty)
     {
         context.UserRanks.Add(rec);
     }
     else
     {
         context.Entry(rec).State = EntityState.Modified;
     }
 }
示例#14
0
 public void InsertUpdate(Account rec)
 {
     try
     {
         if (rec.Id == Guid.Empty)
         {
             WriteLog(VMGlobal.LOG_ACTION.SAVE, string.Format("Add New Account: {0} {1}", rec.BadgeNumber, rec.ToString()));
             context.Accounts.Add(rec);
         }
         else
         {
             WriteLog(VMGlobal.LOG_ACTION.UPDATE, string.Format("{0} {1}", rec.BadgeNumber, rec.ToString()));
             context.Entry(rec).State = EntityState.Modified;
         }
     }
     catch
     {
     }
 }