/// <summary> /// 添加科室 /// </summary> /// <param name="p_id">科室id</param> private void AddDept(string p_id) { //判断是否已经包含科室 if ((from a in lstResult where a.deptCode == p_id select a).Count() > 0) { return; } //添加科室到已选 IEnumerable <EntityCodeDepartment> lstTemp = (from a in lstDept where a.deptCode == p_id select a); if (lstTemp.Count() > 0) { EntityCodeDepartment info = lstTemp.First(); lstResult.Add(info); TreeListNode node = tlAllDept.FindNodeByID(lstDept.IndexOf(lstTemp.First())); if (node != null && info.leafFlag == "T") { node.ImageIndex = 1; node.SelectImageIndex = 1; node.Tag = 0; } string parentid = lstTemp.First().parent; if (!string.IsNullOrEmpty(parentid)) { AddDept(parentid); } } }
/// <summary> /// SaveDepartment /// </summary> /// <param name="deptVo"></param> /// <param name="deptOrig"></param> /// <param name="lstDeptRoom"></param> /// <param name="lstDeptReg"></param> /// <returns></returns> public int SaveDepartment(EntityCodeDepartment deptVo, EntityCodeDepartment deptOrig, List <EntityDicDeptRoom> lstDeptRoom, List <EntityDicDeptReg> lstDeptReg) { using (BizDictionary biz = new BizDictionary()) { return(biz.SaveDepartment(deptVo, deptOrig, lstDeptRoom, lstDeptReg)); } }
private void lueDept_HandleDBValueChanged(object sender) { if (this.lueDept.Properties.DBRow != null) { DeptVo = this.lueDept.Properties.DBRow as EntityCodeDepartment; } }
/// <summary> /// 移除科室 /// </summary> /// <param name="p_id">科室id</param> private void RemoveDept(string p_id) { //获取科室 IEnumerable <EntityCodeDepartment> lstTemp = (from a in lstResult where a.deptCode == p_id select a); if (lstTemp.Count() > 0) { EntityCodeDepartment info = lstTemp.First(); if (info.leafFlag != null && info.leafFlag == "T") //判断是否子节点 { //更改已选标志 int nodeId = lstDept.IndexOf(info); TreeListNode rightNode = tlAllDept.FindNodeByID(nodeId); rightNode.ImageIndex = 0; rightNode.SelectImageIndex = 0; rightNode.Tag = null; } //移除科室 if ((from a in lstResult where a.parent == p_id select a).Count() == 0) //判断是否没有子节点 { lstResult.Remove(info); if (!string.IsNullOrEmpty(info.parent)) { RemoveDept(info.parent); } } } }
/// <summary> /// Del /// </summary> internal void Del() { EntityCodeDepartment vo = Viewer.txtDeptCode.Tag as EntityCodeDepartment; if (vo == null || string.IsNullOrEmpty(vo.deptCode)) { return; } if (DialogBox.Msg("是否删除当前科室?", MessageBoxIcon.Question) == DialogResult.Yes) { ProxyDictionary proxy = new ProxyDictionary(); int ret = proxy.Service.DelDepartment(vo.deptCode); proxy = null; if (ret > 0) { // 刷新树 SetMainInfo(null); Refresh(); Viewer.ValueChanged = false; DialogBox.Msg("删除成功!"); } else { DialogBox.Msg("删除失败。"); } } }
/// <summary> /// SetMainInfo /// </summary> /// <param name="vo"></param> void SetMainInfo(EntityCodeDepartment vo) { if (vo == null) { Viewer.txtDeptCode.Tag = null; Viewer.txtDeptCode.Text = string.Empty; Viewer.txtDeptName.Text = string.Empty; Viewer.lueParent.Properties.DBValue = null; Viewer.lueParent.Text = string.Empty; Viewer.cboType.SelectedIndex = -1; Viewer.cboType.Text = string.Empty; Viewer.cboLevel.SelectedIndex = -1; Viewer.cboLevel.Text = string.Empty; Viewer.cboLeaf.SelectedIndex = 1; Viewer.cboIsBk.Text = string.Empty; Viewer.cboIsBk.SelectedIndex = 0; Viewer.txtXh.Text = string.Empty; InitRoom(); InitExpert(); } else { Viewer.txtDeptCode.Tag = vo; Viewer.txtDeptCode.Text = vo.deptCode; Viewer.txtDeptName.Text = vo.deptName; Viewer.txtXh.Text = vo.xh.ToString(); Viewer.lueParent.Properties.DBValue = vo.parent; SetLueParent(vo.parent); if (Function.Int(vo.type) > 0) { Viewer.cboType.SelectedIndex = Function.Int(vo.type) - 1; } else { Viewer.cboType.SelectedIndex = -1; Viewer.cboType.Text = string.Empty; } if (Function.Int(vo.grade) > 0) { Viewer.cboLevel.SelectedIndex = Function.Int(vo.grade) - 1; } else { Viewer.cboLevel.SelectedIndex = -1; Viewer.cboLevel.Text = string.Empty; } Viewer.cboLeaf.SelectedIndex = (!string.IsNullOrEmpty(vo.leafFlag) && vo.leafFlag.ToUpper() == "T") ? 1 : 0; Viewer.cboIsBk.SelectedIndex = Function.Int(vo.isBk); #region room、expert using (ProxyDictionary proxy = new ProxyDictionary()) { this.gvDataBindingSourceRoom.DataSource = proxy.Service.LoadDeptRoom(vo.deptCode); this.gvDataBindingSourceExpert.DataSource = proxy.Service.LoadDeptExpert(vo.deptCode); } #endregion } Viewer.ValueChanged = false; }
/// <summary> /// LoadDataSource /// </summary> void LoadDataSource() { using (ProxyDictionary proxy = new ProxyDictionary()) { this.isInit = true; DataSourceDept = proxy.Service.LoadDeptInfo(); Viewer.tvDept.BeginUpdate(); Viewer.tvDept.DataSource = DataSourceDept; Viewer.tvDept.ExpandAll(); Viewer.tvDept.EndUpdate(); if (DataSourceDept == null) { Viewer.lueParent.Properties.DataSource = null; } else { EntityCodeDepartment[] data = new EntityCodeDepartment[DataSourceDept.Count + 1]; for (int i = 0; i < DataSourceDept.Count; i++) { data[i] = DataSourceDept[i]; } EntityCodeDepartment vo = new EntityCodeDepartment(); vo.deptCode = "&"; vo.deptName = "全院"; data[data.Length - 1] = vo; Viewer.lueParent.Properties.DataSource = data; } Viewer.lueParent.Properties.SetSize(); this.isInit = false; } }
/// <summary> /// SelectDept /// </summary> public void SelectDept(EntityDeptInfo vo) { this.rdoType.SelectedIndex = 1; this.lueDept.Properties.DBValue = vo.DeptID.ToString(); this.lueDept.Properties.DisplayValue = vo.DeptName; this.lueDept.Text = vo.DeptName; if (DeptVo == null) { DeptVo = new EntityCodeDepartment(); //DeptVo.Deptid = vo.DeptID; DeptVo.deptCode = vo.DeptCode; DeptVo.deptName = vo.DeptName; } this.Refresh(); }
/// <summary> /// LoadDeptInfo /// </summary> /// <param name="node"></param> void LoadDeptInfo(TreeListNode node) { if (node == null) { return; } uiHelper.BeginLoading(Viewer); this.PauseRedraw(); try { EntityCodeDepartment deptVo = (EntityCodeDepartment)Viewer.tvDept.GetDataRecordByNode(node); SetMainInfo(deptVo); } finally { this.StartRedraw(); uiHelper.CloseLoading(Viewer); } }
/// <summary> /// 查找表单 /// </summary> /// <param name="val"></param> internal void FindDept(string deptCode) { if (string.IsNullOrEmpty(deptCode)) { return; } EntityCodeDepartment deptVo = null; for (int i = 0; i < Viewer.tvDept.AllNodesCount; i++) { deptVo = (EntityCodeDepartment)Viewer.tvDept.GetDataRecordByNode(Viewer.tvDept.GetNodeByVisibleIndex(i)); if (deptVo.deptCode == deptCode) { Viewer.tvDept.SetFocusedNode(Viewer.tvDept.GetNodeByVisibleIndex(i)); FilterDept(deptCode); break; } } }
/// <summary> /// Refresh /// </summary> internal void Refresh() { uiHelper.BeginLoading(Viewer); try { EntityCodeDepartment vo = null; if (Viewer.txtDeptCode.Tag != null) { vo = Viewer.txtDeptCode.Tag as EntityCodeDepartment; } LoadDataSource(); if (vo != null) { Viewer.tvDept.SetFocusedNode(Viewer.tvDept.FindNodeByKeyID(vo.deptCode)); } } finally { uiHelper.CloseLoading(Viewer); } }
/// <summary> /// 获取登录者信息 /// </summary> /// <param name="strEmpNo"></param> /// <param name="loginVo"></param> /// <param name="hospitalVo"></param> /// <returns></returns> public void GetLoginInfo(string strEmpNo, ref EntityLogin loginVo, ref EntityHospital hospitalVo) { string SQL = string.Empty; string strValue = string.Empty; DataTable dtResult = null; loginVo = new EntityLogin(); hospitalVo = new EntityHospital(); SqlHelper svc = new SqlHelper(EnumBiz.onlineDB); IDataParameter[] objParamArr = null; try { EntityCodeOperator voEmp = new EntityCodeOperator(); voEmp.disable = "F"; voEmp.operCode = strEmpNo; List <EntityCodeOperator> lstEmployee = EntityTools.ConvertToEntityList <EntityCodeOperator>(svc.Select(voEmp, new List <string> { EntityCodeOperator.Columns.disable, EntityCodeOperator.Columns.operCode })); if (lstEmployee != null && lstEmployee.Count == 1) { voEmp = lstEmployee[0]; EntityPlusOperator voEmpPlus = new EntityPlusOperator(); voEmpPlus.operCode = strEmpNo; List <EntityPlusOperator> lstEmpPlus = EntityTools.ConvertToEntityList <EntityPlusOperator>(svc.Select(voEmpPlus, new List <string> { EntityPlusOperator.Columns.operCode })); if (lstEmpPlus != null && lstEmpPlus.Count > 0) { voEmpPlus = lstEmpPlus[0]; } bool blnLock = false; if (voEmp.acctStatus.ToString() == "1") { blnLock = true; if (voEmp.acctLockDate != null) { strValue = SysParameter(72); int intTemp = 24;//默认24小时后自动解锁 if (!string.IsNullOrEmpty(strValue)) { intTemp = Function.Int(strValue); } if (intTemp != 0) { DateTime dtmLock = voEmp.acctLockDate.Value; DateTime dtmNow = DateTime.Now; if (dtmNow.Subtract(dtmLock).TotalHours >= intTemp) { blnLock = false; Dictionary <string, object> dicSet = new Dictionary <string, object>(); dicSet.Add(EntityCodeOperator.Columns.acctStatus, 0); dicSet.Add(EntityCodeOperator.Columns.acctLockDate, null); Dictionary <string, object> dicWhere = new Dictionary <string, object>(); dicWhere.Add(EntityCodeOperator.Columns.operCode, strEmpNo); svc.Commit(svc.GetUpdateParm(voEmp, dicSet, dicWhere)); } } } } //loginVo.EmpId = voEmp.Empid.ToString(); loginVo.EmpNo = voEmp.operCode; loginVo.EmpName = voEmp.operName; //loginVo.Sex = voEmpPlus.Sex; loginVo.Birthday = voEmpPlus.birth; //loginVo.IdCard = voEmpPlus.Idcard; loginVo.Tel = voEmpPlus.tel; loginVo.Addr = voEmpPlus.addr; //loginVo.IdentityFlag = voEmp.Identity; loginVo.AdminlevelCode = voEmpPlus.dutyCode; loginVo.TechLevelCode = voEmpPlus.rankCode; //loginVo.SignKeyID = voEmp.Signdigital; if (!string.IsNullOrEmpty(voEmp.pwd)) { loginVo.Pwd = voEmp.pwd; //ESCryptography.Decrypt(voEmp.pwd); } else { loginVo.Pwd = string.Empty; } loginVo.LoginTime = svc.ServerTime().ToString("yyyy-MM-dd HH:mm:ss"); if (!string.IsNullOrEmpty(voEmpPlus.clsCode) && voEmpPlus.clsCode.Trim() == "01") { loginVo.EmpFlag = 1; } else if (!string.IsNullOrEmpty(voEmpPlus.clsCode) && voEmpPlus.clsCode.Trim() == "02") { loginVo.EmpFlag = 2; } else { loginVo.EmpFlag = 3; } loginVo.clsCode = voEmpPlus.clsCode.Trim(); // 是否管理员 if (loginVo.EmpNo.Trim() == "00") { loginVo.IsAdmin = true; } //if (voEmp.Pwdusedate == null) // loginVo.PwdUseDate = null; //else // loginVo.PwdUseDate = Convert.ToDateTime(voEmp.Pwdusedate.Value); loginVo.AcctLock = blnLock; #region 职称改从code_rank取值 //EntityCommonDic voComm = new EntityCommonDic(); //voComm.Status = 1; //voComm.Classid = 1; //voComm.Itemcode = loginVo.TechLevelCode; //List<EntityCommonDic> lstComm = EntityTools.ConvertToEntityList<EntityCommonDic>(svc.Select(voComm, new List<string> { EntityCommonDic.Columns.Status, EntityCommonDic.Columns.Classid, EntityCommonDic.Columns.Itemcode })); //if (lstComm.Count > 0) //{ // loginVo.TechLevelName = lstComm[0].Itemname; //} EntityCodeRank rankVo = new EntityCodeRank(); rankVo.rankCode = loginVo.TechLevelCode; List <EntityCodeRank> lstRank = EntityTools.ConvertToEntityList <EntityCodeRank>(svc.Select(rankVo, new List <string> { EntityCodeRank.Columns.rankCode })); if (lstRank.Count > 0) { loginVo.TechLevelName = lstRank[0].rankName; } #endregion string strIDArr = string.Empty; //DataTable dtTemp = null; //if (loginVo.EmpFlag == 1 || loginVo.EmpFlag == 3) //{ SQL = @"select b.defaultflag as defaultflag, null as deptid, a.dept_code as deptcode, a.dept_name as deptname, a.py_code as pycode, a.wb_code as wbcode from code_department a inner join defDeptemployee b on a.dept_code = b.deptcode where b.opercode = ?"; objParamArr = svc.CreateParm(1); objParamArr[0].Value = loginVo.EmpNo; dtResult = svc.GetDataTable(SQL, objParamArr); if (dtResult.Rows.Count > 0) { EntityCodeDepartment deptVo = null; loginVo.lstDept = new List <EntityCodeDepartment>(); foreach (DataRow dr in dtResult.Rows) { deptVo = new EntityCodeDepartment(); //deptVo.Deptid = Function.Int(dr["deptid"]); deptVo.deptCode = dr["deptcode"].ToString(); deptVo.deptName = dr["deptname"].ToString(); deptVo.pyCode = dr["pycode"].ToString().ToUpper(); deptVo.wbCode = dr["wbcode"].ToString().ToUpper(); loginVo.lstDept.Add(deptVo); if (Function.Int(dr["defaultflag"]) == 1) { //loginVo.DeptID = Function.Int(deptVo.Deptid); loginVo.DeptName = deptVo.deptName; loginVo.DeptCode = dr["deptcode"].ToString(); // SQL = @"select b.areaid, // b.areaname, // b.pycode, // b.wbcode, // '' as c_code // from defDeptarea a // left join dicArea b // on a.areaid = b.areaid // where a.deptid = ?"; // objParamArr = svc.CreateParm(1); // objParamArr[0].Value = deptVo.Deptid; // dtTemp = svc.GetDataTable(SQL, objParamArr); // if (dtTemp != null && dtTemp.Rows.Count > 0) // { // loginVo.AreaID = Function.Int(dtTemp.Rows[0]["areaid"]); // loginVo.AreaName = dtTemp.Rows[0]["areaname"].ToString(); // loginVo.DeptCode_zy = dtTemp.Rows[0]["c_code"].ToString(); // } } //strIDArr += dr["deptid"].ToString() + ","; } // SQL = @"select distinct b.areaid, b.areaname, b.pycode, b.wbcode // from defDeptarea a, dicArea b // where a.areaid = b.areaid // and a.deptid in (" + strIDArr.Substring(0, strIDArr.Length - 1) + ")"; // dtResult = svc.GetDataTable(SQL); // if (dtResult.Rows.Count > 0) // { // EntityArea dcAreaInfo = null; // loginVo.lstArea = new List<EntityArea>(); // foreach (DataRow dr in dtResult.Rows) // { // dcAreaInfo = new EntityArea(); // dcAreaInfo.Areaid = Function.Int(dr["areaid"]); // dcAreaInfo.Areaname = dr["areaname"].ToString(); // dcAreaInfo.Pycode = dr["pycode"].ToString(); // dcAreaInfo.Wbcode = dr["wbcode"].ToString(); // loginVo.lstArea.Add(dcAreaInfo); // } // } // } // } // else if (loginVo.EmpFlag == 2) // { // SQL = @"select a.defaultflag, b.areaid, b.areaname, b.pycode, b.wbcode // from defDeptemployee a, dicArea b // where a.deptid = b.areaid // and a.attrflag = 2 // and a.empid = ?"; // objParamArr = svc.CreateParm(1); // objParamArr[0].Value = loginVo.EmpId; // dtResult = svc.GetDataTable(SQL, objParamArr); // if (dtResult.Rows.Count > 0) // { // EntityArea dcAreaInfo = null; // loginVo.lstArea = new List<EntityArea>(); // foreach (DataRow dr in dtResult.Rows) // { // dcAreaInfo = new EntityArea(); // dcAreaInfo.Areaid = Function.Int(dr["areaid"]); // dcAreaInfo.Areaname = dr["areaname"].ToString(); // dcAreaInfo.Pycode = dr["pycode"].ToString(); // dcAreaInfo.Wbcode = dr["wbcode"].ToString(); // loginVo.lstArea.Add(dcAreaInfo); // if (Function.Int(dr["defaultflag"]) == 1) // { // loginVo.AreaID = Function.Int(dcAreaInfo.Areaid); // loginVo.AreaName = dcAreaInfo.Areaname; // SQL = @"select b.deptid, b.deptname, b.deptcode, b.pycode, b.wbcode // from defDeptarea a, dicDepartment b // where a.deptid = b.deptid // and a.areaid = ?"; // objParamArr = svc.CreateParm(1); // objParamArr[0].Value = dcAreaInfo.Areaid; // dtTemp = svc.GetDataTable(SQL, objParamArr); // if (dtTemp != null && dtTemp.Rows.Count > 0) // { // loginVo.DeptID = Function.Int(dtTemp.Rows[0]["deptid"]); // loginVo.DeptName = dtTemp.Rows[0]["deptname"].ToString(); // loginVo.DeptCode = dtTemp.Rows[0]["deptcode"].ToString(); // } // } // strIDArr += dr["areaid"].ToString() + ","; // } // SQL = @"select distinct b.deptid, b.deptcode, b.deptname, b.pycode, b.wbcode // from defDeptarea a, dicDepartment b // where a.deptid = b.deptid // and a.areaid in (" + strIDArr.Substring(0, strIDArr.Length - 1) + ")"; // dtResult = svc.GetDataTable(SQL); // if (dtResult.Rows.Count > 0) // { // EntityDepartment dcDeptInfo = null; // loginVo.lstDept = new List<EntityDepartment>(); // foreach (DataRow dr in dtResult.Rows) // { // dcDeptInfo = new EntityDepartment(); // dcDeptInfo.Deptid = Function.Int(dr["deptid"]); // dcDeptInfo.Deptcode = dr["deptcode"].ToString(); // dcDeptInfo.Deptname = dr["deptname"].ToString(); // dcDeptInfo.Pycode = dr["pycode"].ToString(); // dcDeptInfo.Wbcode = dr["wbcode"].ToString(); // loginVo.lstDept.Add(dcDeptInfo); // } // } } //} if (loginVo != null) { EntityDefOperatorRole voRoleEmp = new EntityDefOperatorRole(); voRoleEmp.operCode = loginVo.EmpNo; List <EntityDefOperatorRole> lstRoleEmp = EntityTools.ConvertToEntityList <EntityDefOperatorRole>(svc.Select(voRoleEmp, new List <string> { EntityDefOperatorRole.Columns.operCode })); if (lstRoleEmp.Count > 0) { loginVo.lstRoleID = new List <string>(); foreach (EntityDefOperatorRole vo in lstRoleEmp) { loginVo.lstRoleID.Add(vo.roleCode); } } } EntityHospital voHospital = new EntityHospital(); List <EntityHospital> lstHospital = EntityTools.ConvertToEntityList <EntityHospital>(svc.Select(voHospital)); if (lstHospital.Count > 0) { hospitalVo = lstHospital[0]; GlobalHospital.HospitalName = hospitalVo.Hospitalname; } //密码有效期 loginVo.PwdValidDays = Function.Int(SysParameter(2)); } dtResult = null; } catch (Exception e) { ExceptionLog.OutPutException(e); } finally { svc = null; } }
/// <summary> /// Save /// </summary> /// <param name="isExit">是否窗体退出时</param> internal void Save(bool isExit) { // 1.main EntityCodeDepartment mainVo = new EntityCodeDepartment(); mainVo.deptCode = Viewer.txtDeptCode.Text.Trim(); mainVo.deptName = Viewer.txtDeptName.Text.Trim(); mainVo.parent = Viewer.lueParent.Properties.DBValue; mainVo.type = Convert.ToString(Viewer.cboType.SelectedIndex + 1); mainVo.grade = Viewer.cboLevel.SelectedIndex + 1; mainVo.leafFlag = Viewer.cboLeaf.Text == "是" ? "T" : "F"; mainVo.isBk = Viewer.cboIsBk.SelectedIndex; mainVo.xh = Function.Int(Viewer.txtXh.Text); #region 校验 if (string.IsNullOrEmpty(mainVo.deptCode)) { DialogBox.Msg("请输入科室编码。"); Viewer.txtDeptCode.Focus(); return; } if (string.IsNullOrEmpty(mainVo.deptName)) { DialogBox.Msg("请输入科室名称"); Viewer.txtDeptName.Focus(); return; } if (string.IsNullOrEmpty(mainVo.parent)) { DialogBox.Msg("请选择父级科室"); Viewer.lueParent.Focus(); return; } if (string.IsNullOrEmpty(Viewer.cboType.Text)) { DialogBox.Msg("请选择科室类型"); Viewer.cboType.Focus(); return; } if (string.IsNullOrEmpty(Viewer.cboLevel.Text)) { DialogBox.Msg("请选择科室级别"); Viewer.cboLevel.Focus(); return; } if (string.IsNullOrEmpty(Viewer.cboLeaf.Text)) { DialogBox.Msg("请指定是否为末级科室"); Viewer.cboLeaf.Focus(); return; } #endregion EntityCodeDepartment deptOrig = null; if (Viewer.txtDeptCode.Tag != null) { deptOrig = Viewer.txtDeptCode.Tag as EntityCodeDepartment; } List <string> lstKey = new List <string>(); // 2.room Viewer.gvRoom.CloseEditor(); List <EntityDicDeptRoom> lstDeptRoom = this.gvDataBindingSourceRoom.DataSource as List <EntityDicDeptRoom>; for (int i = lstDeptRoom.Count - 1; i >= 0; i--) { if (!string.IsNullOrEmpty(lstDeptRoom[i].roomCode) && !string.IsNullOrEmpty(lstDeptRoom[i].roomName)) { lstDeptRoom[i].deptCode = mainVo.deptCode; lstDeptRoom[i].status = 1; if (lstKey.IndexOf(lstDeptRoom[i].roomCode) >= 0) { DialogBox.Msg("诊室编号不能重复,请检查。"); Viewer.gcRoom.Focus(); return; } else { lstKey.Add(lstDeptRoom[i].roomCode); } } else { lstDeptRoom.RemoveAt(i); } } // 3.expert lstKey.Clear(); Viewer.gvExpert.CloseEditor(); List <EntityDicDeptReg> lstDeptExpert = this.gvDataBindingSourceExpert.DataSource as List <EntityDicDeptReg>; if (lstDeptExpert != null) { for (int i = lstDeptExpert.Count - 1; i >= 0; i--) { if (!string.IsNullOrEmpty(lstDeptExpert[i].regCode) && !string.IsNullOrEmpty(lstDeptExpert[i].regName)) { lstDeptExpert[i].deptCode = mainVo.deptCode; lstDeptExpert[i].status = 1; if (lstKey.IndexOf(lstDeptExpert[i].regCode) >= 0) { DialogBox.Msg("专科号编号不能重复,请检查。"); Viewer.gcExpert.Focus(); return; } else { lstKey.Add(lstDeptExpert[i].regCode); } } else { lstDeptExpert.RemoveAt(i); } } } ProxyDictionary proxy = new ProxyDictionary(); int ret = proxy.Service.SaveDepartment(mainVo, deptOrig, lstDeptRoom, lstDeptExpert); proxy = null; if (ret > 0) { Viewer.ValueChanged = false; // 刷新树 if (!isExit) { Viewer.txtDeptCode.Tag = mainVo; Refresh(); } DialogBox.Msg("保存成功!"); } else { DialogBox.Msg("保存失败。"); } }