private void InitForm() { if (!string.IsNullOrEmpty(Request.QueryString["id"])) { SystemDispatchInfo info = SystemDispatch.GetSystemDispatchInfo(FormId); cblSecurityLevel.SelectedIndex = Convert.ToInt32(info.SecurityLevel); cblUrgenLevel.SelectedIndex = Convert.ToInt32(info.UrgenLevel); UpdatedTextBox.Value = info.DateTime; tbDateTime.Text = info.DateTime; tbUserName.Text = info.UserName; tbMobile.Text = info.Mobile; tbTitle.Text = info.Title; tbContent.Text = info.Content; cblRedHeadDocument.SelectedIndex = int.Parse(info.RedHeadDocument); cblIsPublish.SelectedIndex = int.Parse(info.IsPublish); cblSecurityLevel.SelectedIndex = int.Parse(info.SecurityLevel); cblUrgenLevel.SelectedIndex = int.Parse(info.UrgenLevel); tbReportCode.Text = info.FormId; } else { tbUserName.Text = _BPMContext.CurrentPWordUser.EmployeeName; tbMobile.Text = _BPMContext.CurrentPWordUser.MobilePhone; UpdatedTextBox.Value = DateTime.Now.ToString("yyyy/MM/dd"); } }
/// <summary> /// 加载发起部门及相关控件 /// </summary> private void InitFormData() { try { SystemDispatchInfo formDataInfo = SystemDispatch.GetSystemDispatchInfo(FormId); ListItem item = ddlDepartName.Items.FindByValue(formDataInfo.StartDeptId); if (item != null) { ddlDepartName.SelectedIndex = ddlDepartName.Items.IndexOf(item); } ListItem departItem = ddlDepartName.Items.FindByValue(formDataInfo.StartDeptId); if (departItem == null) { ExceptionHander.GoToErrorPage(); return; } departItem.Selected = true; Countersign1.CounterSignDeptId = formDataInfo.StartDeptId; } catch (Exception ex) { throw ex; } }
/// <summary> /// 加载表单 /// </summary> private void InitFormData() { try { if (!string.IsNullOrEmpty(Request.QueryString["id"])) { SystemDispatchInfo info = SystemDispatch.GetSystemDispatchInfo(FormId); cblSecurityLevel.SelectedIndex = Convert.ToInt32(info.SecurityLevel); cblUrgenLevel.SelectedIndex = Convert.ToInt32(info.UrgenLevel); tbDepartName.Text = info.DeptName; tbDateTime.Text = info.DateTime; tbDateTime.Text = info.DateTime; tbUserName.Text = info.UserName; tbMobile.Text = info.Mobile; tbTitle.Text = info.Title; tbContent.Text = info.Content; cblRedHeadDocument.SelectedIndex = int.Parse(info.RedHeadDocument); cblIsPublish.SelectedIndex = int.Parse(info.IsPublish); cblSecurityLevel.SelectedIndex = int.Parse(info.SecurityLevel); cblUrgenLevel.SelectedIndex = int.Parse(info.UrgenLevel); tbReportCode.Text = info.FormId; } } catch (Exception ex) { throw ex; } }
/// <summary> /// 初始化总办会成员复选框和董事长勾选框 /// </summary> private void InitCheckBoxList() { BFPmsUserRoleDepartment bfurd = new BFPmsUserRoleDepartment(); DataTable dtLeaders = bfurd.GetSelectRoleUser(PKURGICode, "总办会成员"); string strLeaders = GetRoleUsers(PKURGICode, "总办会成员"); foreach (DataRow user in dtLeaders.Rows) { ListItem li = new ListItem(); li.Value = "K2:Founder\\" + user["LoginName"].ToString(); li.Text = user["EmployeeName"].ToString(); if (!cblTopLeaders.Items.Contains(li)) { cblTopLeaders.Items.Add(li); } } if (!string.IsNullOrEmpty(Request.QueryString["id"])) { XmlDocument xmldoc = new XmlDocument(); SystemDispatchInfo formDataInfo = SystemDispatch.GetSystemDispatchInfo(FormId); if (!string.IsNullOrEmpty(formDataInfo.LeadersSelected)) { xmldoc.LoadXml(formDataInfo.LeadersSelected); } XmlNode NodeLeaders = xmldoc.SelectSingleNode("//TopLeaders"); if (NodeLeaders != null && NodeLeaders.Attributes["ID"].Value.Length > 0) { foreach (string UserGuid in NodeLeaders.Attributes["ID"].Value.Split(',')) { for (int i = 0; i < cblTopLeaders.Items.Count; i++) { if (cblTopLeaders.Items[i].Value == UserGuid) { cblTopLeaders.Items[i].Selected = true; } } } } XmlNode NodeChairman = xmldoc.SelectSingleNode("//Chairman"); if (NodeChairman != null && NodeChairman.Attributes["ID"].Value != "noapprovers") { cbChairman.Checked = true; } } else { for (int i = 0; i < cblTopLeaders.Items.Count; i++) { cblTopLeaders.Items[i].Selected = true; } } }
/// <summary> /// 保存表单 /// </summary> /// <returns></returns> private SystemDispatchInfo SaveFormData() { bool isEdit = false; SystemDispatchInfo info = null; try { info = SystemDispatch.GetSystemDispatchInfo(FormId); if (info == null) { info = new SystemDispatchInfo(); info.FormId = FormId; info.StartDeptId = ddlDepartName.SelectedItem.Value; info.DeptName = ddlDepartName.SelectedItem.Text; info.SecurityLevel = cblSecurityLevel.SelectedIndex.ToString(); info.UrgenLevel = cblUrgenLevel.SelectedIndex.ToString(); FormId = BPMHelp.GetSerialNumber("OA_ZD_"); info.FormId = FormId; info.DateTime = UpdatedTextBox.Value; info.UserName = tbUserName.Text; info.Mobile = tbMobile.Text; info.Title = tbTitle.Text; info.IsPublish = cblIsPublish.SelectedIndex.ToString(); info.RedHeadDocument = cblRedHeadDocument.SelectedIndex.ToString(); info.Content = tbContent.Text; info.LeadersSelected = strApprovers; } else { isEdit = true; info.FormId = FormId; info.StartDeptId = ddlDepartName.SelectedItem.Value; info.DeptName = ddlDepartName.SelectedItem.Text; info.SecurityLevel = cblSecurityLevel.SelectedIndex.ToString(); info.UrgenLevel = cblUrgenLevel.SelectedIndex.ToString(); info.FormId = tbReportCode.Text; info.DateTime = UpdatedTextBox.Value; info.UserName = tbUserName.Text; info.Mobile = tbMobile.Text; info.Title = tbTitle.Text; info.IsPublish = cblIsPublish.SelectedIndex.ToString(); info.RedHeadDocument = cblRedHeadDocument.SelectedIndex.ToString(); info.Content = tbContent.Text; info.LeadersSelected = strApprovers; } if (!isEdit) { SystemDispatch.InsertSystemDispatchInfo(info); } else { SystemDispatch.UpdateSystemDispatch(info); } } catch (Exception ex) { throw ex; } return(info); }