public bool UpdateSysConfig(string modulecode, string controlcode, Bse_CheckValue val) { Sys_Config_Fieled field = cfInstance.GetListByWhere(string.Format("AND D_ModuleCode='{0}' AND D_Index='{1}'", modulecode, controlcode)).FirstOrDefault(); if (field != null) { field.D_Name = val.SC_Bak1; if (val.SC_Stat == "UnValid") { field.D_Hidden = "true"; } else { field.D_Hidden = "false"; } cfInstance.Update(field); if (string.IsNullOrEmpty(val.SC_Warn)) { var f1 = cfInstance.GetListByWhere(string.Format("AND D_ModuleCode='{0}' AND D_Index='{1}'", modulecode, "Data_W" + val.SC_Position)).FirstOrDefault(); f1.D_Hidden = "true"; cfInstance.Update(f1); } else { var f1 = cfInstance.GetListByWhere(string.Format("AND D_ModuleCode='{0}' AND D_Index='{1}'", modulecode, "Data_W" + val.SC_Position)).FirstOrDefault(); f1.D_Hidden = "false"; cfInstance.Update(f1); } if (string.IsNullOrEmpty(val.SC_Alarm)) { var f1 = cfInstance.GetListByWhere(string.Format("AND D_ModuleCode='{0}' AND D_Index='{1}'", modulecode, "Data_A" + val.SC_Position)).FirstOrDefault(); f1.D_Hidden = "true"; cfInstance.Update(f1); } else { var f1 = cfInstance.GetListByWhere(string.Format("AND D_ModuleCode='{0}' AND D_Index='{1}'", modulecode, "Data_A" + val.SC_Position)).FirstOrDefault(); f1.D_Hidden = "false"; cfInstance.Update(f1); } return(true); } return(false); }
/// <summary> /// 更新数据 /// </summary> /// <param name='model'>实体</param> /// <returns>bool</returns> public bool Update(Sys_Config_Fieled model) { bool result = false; var e = new ModelExceptions(); int _rseult = instance.Update(model); if (_rseult > 0) { result = true; } return(result); }
/// <summary> /// 更新数据 /// </summary> /// <param name='model'>实体</param> /// <returns>bool</returns> /// <summary> /// 更新数据 /// </summary> /// <param name='model'>实体</param> /// <returns>bool</returns> /// <summary> /// 逻辑删除数据 /// </summary> /// <param name='model'>model</param> /// <returns>bool</returns> public bool Delete(string Condition) { bool result = false; List <Sys_Config_Fieled> list = instance.GetListByWhere(Condition); if (list.Count > 0) { Sys_Config_Fieled model = list[0]; model.Stat = 1; int _rseult = instance.Update(model); if (_rseult > 0) { result = true; } } return(result); }