public virtual bool InsertConfig(MED_CONFIG mc) { bool flag = dapper.Set <MED_CONFIG>().Insert(mc); dapper.SaveChanges(); return(flag); }
public static void ModifyConfigTable(string key, string value) { if (!string.IsNullOrEmpty(key)) { List <MED_CONFIG> configList = DictService.ClientInstance.GetConfigList(); configList = configList.Where(x => x.PARAKEY == key).ToList(); MED_CONFIG configRow = null; if (configList != null && configList.Count > 0) { configRow = configList[0]; } if (configRow == null) { configRow = new MED_CONFIG(); configRow.PARAKEY = key; configRow.ModelStatus = ModelStatus.Add; configList.Add(configRow); //ExtendAppContext.Current.CommDict.ConfigDict = configList; ApplicationModel.Instance.AllDictList.ConfigList = configList; } else { configRow.ModelStatus = ModelStatus.Modeified; } if (string.IsNullOrEmpty(value)) { configRow.PARAVALUE = new byte[] { 0 }; } else { configRow.PARAVALUE = StringHelper.Str2Arr(value); } DictService.ClientInstance.UpdateConfigList(configList); } }
public RequestResult <bool> InsertConfig(MED_CONFIG mc) { return(Success(_config.InsertConfig(mc))); }