public ServiceResponseData DeleteDeptDic() { int deptDicID = requestData.GetData <int>(0); DG_DeptDic model = (DG_DeptDic)NewObject <DG_DeptDic>().getmodel(deptDicID); if (model.DeptType == 0) { //药房 string where = "DeptID=" + model.DeptID; DataTable dtStoage = ((DS_Storage)NewObject <DS_Storage>()).gettable(where); if (dtStoage.Rows.Count > 0) { throw new Exception("当前科室已经发生业务,无法删除,只能停用"); } } else { //药库 string where = "DeptID=" + model.DeptID; DataTable dtStoage = ((DW_Storage)NewObject <DW_Storage>()).gettable(where); if (dtStoage.Rows.Count > 0) { throw new Exception("当前科室已经发生业务,无法删除,只能停用"); } } int retVal = NewObject <DrugDeptMgr>().DeleteDeptDic(deptDicID); responseData.AddData(retVal); return(responseData); }
/// <summary> /// 启用药剂科室 /// </summary> /// <param name="deptID">科室Id</param> public void StartDept(int deptID) { DG_DeptDic deptDic = NewObject <DG_DeptDic>(); deptDic.StopFlag = 0; deptDic.save(); }
public ServiceResponseData AddDrugDept() { DG_DeptDic deptdic = requestData.GetData <DG_DeptDic>(0); this.BindDb(deptdic); int retVal = deptdic.save(); responseData.AddData(retVal); return(responseData); }