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(); } }
private bool?SaveChanges() { return(context.SaveChanges() > 0); }