Exemple #1
0
 public void UpdateUserColumns(string userID, int reportID, string settingName, string columnList)
 {
     using (var cmaDB = new CMAEntities())
     {
         var userSetting = cmaDB.USERCOLUMNSETTINGS.FirstOrDefault(
             x => x.USERID == userID && x.REPORTID == reportID && x.SETTINGNAME == settingName);
         if (userSetting == null)
         {
             userSetting = new USERCOLUMNSETTING
             {
                 USERID      = userID,
                 REPORTID    = reportID,
                 SETTINGNAME = settingName,
                 COLUMNLIST  = columnList
             };
             cmaDB.USERCOLUMNSETTINGS.Add(userSetting);
         }
         else
         {
             userSetting.COLUMNLIST = columnList;
         }
         cmaDB.SaveChanges();
     }
 }
Exemple #2
0
 private bool?SaveChanges()
 {
     return(context.SaveChanges() > 0);
 }