/// <summary>新增 /// /// </summary> /// <param name="diagnosis"></param> /// <returns></returns> public bool AddDictdiagnosesmutex(Dictdiagnosesmutex dictdiagnosesmutex) { try { dictdiagnosesmutex.Dictdiagnosesmutexid = getSeqID("SEQ_DICTDIAGNOSESMUTEX"); this.insert("Dict.InsertDictdiagnosesmutex", dictdiagnosesmutex); CacheHelper.RemoveAllCache("daan.GetDictdiagnosesmutexLst"); List <LogInfo> logLst = getLogInfo <Dictdiagnosesmutex>(new Dictdiagnosesmutex(), dictdiagnosesmutex); AddMaintenanceLog("Dictdiagnosesmutex", dictdiagnosesmutex.Dictdiagnosisid, logLst, "新增", dictdiagnosesmutex.Diagnosisname, dictdiagnosesmutex.Dictdiagnosesmutexid.ToString(), modulename); return(true); } catch (Exception ex) { return(false); } }
/// <summary>删除 /// /// </summary> /// <param name="id">诊断建议主键</param> /// <returns></returns> public int DelDictdiagnosesmute(Dictdiagnosesmutex dictdiagnosesmutex) { int nflag = 0; try { nflag = this.delete("Dict.DeleteDictdiagnosesmutex", dictdiagnosesmutex.Dictdiagnosesmutexid); CacheHelper.RemoveAllCache("daan.GetDictdiagnosesmutexLst"); List <LogInfo> logLst = getLogInfo <Dictdiagnosesmutex>(dictdiagnosesmutex, new Dictdiagnosesmutex()); AddMaintenanceLog("Dictdiagnosesmutex", dictdiagnosesmutex.Dictdiagnosisid, logLst, "删除", dictdiagnosesmutex.Diagnosisname, dictdiagnosesmutex.Dictdiagnosesmutexid.ToString(), modulename); } catch (Exception ex) { throw new Exception(ex.Message); } return(nflag); }
//添加互斥建议 protected void gvNoSelect_RowCommand(object sender, GridCommandEventArgs e) { if (e.CommandName == "ActionAdd") { double? dictdiagnosisid = 0; double? dictmutexdiagnosisid = 0; object[] rowsValue = null; if (gdDiagnosis.SelectedRowIndexArray.Length > 0) { dictdiagnosisid = Convert.ToDouble(gdDiagnosis.DataKeys[gdDiagnosis.SelectedRowIndexArray[0]][0]); rowsValue = gvNoSelect.DataKeys[gvNoSelect.SelectedRowIndexArray[0]]; dictmutexdiagnosisid = Convert.ToDouble(rowsValue[0]); } else { MessageBoxShow("请选择左边列表中选择要维护的异常建议", MessageBoxIcon.Information); return; } Hashtable htPara = new Hashtable(); htPara.Add("dictdiagnosisid", dictdiagnosisid); htPara.Add("dictmutexdiagnosisid", dictmutexdiagnosisid); if (!dictdiagnosesmutexService.SelectIsHaveMutexd(htPara)) { MessageBoxShow("已包含该项,不能重复添加", MessageBoxIcon.Information); return; } Dictdiagnosesmutex mutex = new Dictdiagnosesmutex(); mutex.Dictdiagnosisid = dictdiagnosisid; mutex.Dictmutexdiagnosisid = dictmutexdiagnosisid; mutex.Diagnosisname = rowsValue[1].ToString(); try { dictdiagnosesmutexService.AddDictdiagnosesmutex(mutex); gvSelectBinder(); } catch (Exception ex) { MessageBoxShow(ex.Message, MessageBoxIcon.Error); } } }
//删除已添加的互斥建议 protected void gvSelect_RowCommand(object sender, GridCommandEventArgs e) { if (e.CommandName == "ActionDel") { object[] rowsValue = gvSelect.DataKeys[gvSelect.SelectedRowIndexArray[0]]; Dictdiagnosesmutex mutex = new Dictdiagnosesmutex(); mutex.Dictdiagnosesmutexid = Convert.ToDouble(rowsValue[0]); mutex.Dictdiagnosisid = Convert.ToDouble(rowsValue[1]); mutex.Dictmutexdiagnosisid = Convert.ToDouble(rowsValue[2]); mutex.Createdate = Convert.ToDateTime(rowsValue[3]); mutex.Diagnosisname = rowsValue[4].ToString(); try { dictdiagnosesmutexService.DelDictdiagnosesmute(mutex); gvSelectBinder(); } catch (Exception ex) { MessageBoxShow(ex.Message, MessageBoxIcon.Error); } } }