protected void btnSubmitUnderTake_Click(object sender, EventArgs e) { String l_strUndertakeInfo = String.Empty; String l_strMessageInfo = String.Empty; Boolean l_blnIsUnderTake = false; String l_strDeptLeaderID = null; if (String.IsNullOrEmpty(txtUnderTakeDeptID.Text.TrimEnd())) { JScript.ShowMsgBox(this.Page, MsgType.VbCritical, "没有选择承办部门"); return; } //表单的合法性验证 if (!VerifyField()) { JScript.ShowMsgBox(this.Page, MsgType.VbCritical, m_strAryMessages); return; } //提交动作 this.m_strSubmitAction = ProcessConstString.SubmitAction.ReceiveBase.SUBMIT_UNDERTAKE; //获取承办部门ID String[] l_strAryUnderTakeDeptID = txtUnderTakeDeptID.Text.TrimEnd().Split(new char[] { ',' }, StringSplitOptions.RemoveEmptyEntries); if (l_strAryUnderTakeDeptID.Length > 0) { foreach (String l_strUnderTakeDeptID in l_strAryUnderTakeDeptID) { //流程创建时候设置自定义属性 l_strDeptLeaderID = OAUser.GetUserByDeptPostArray(this.txtUnderTakeDeptID.Text, null, true, true)[0]; String l_strDeptName = OADept.GetDeptByDeptID(l_strUnderTakeDeptID).Name; if (String.IsNullOrEmpty(l_strDeptLeaderID)) { l_strUndertakeInfo += l_strDeptName + ":无处级领导,该部门不参与承办\\n"; } else { l_blnIsUnderTake = true; } } } //不能承办 if (!l_blnIsUnderTake) { JScript.ShowMsgBox(this.Page, MsgType.VbCritical, "提交承办处理失败:承办部门都无处级领导,无法承办"); return; } l_htAttribute.Add(ConstString.CustomAttr.Receive.DeptDirector, l_strDeptLeaderID); l_htAttribute.Add(ConstString.CustomAttr.Receive.IsMultipleDept, false); l_htAttribute.Add(ConstString.CustomAttr.Receive.IsDirectArchive, false); l_htAttribute.Add(ConstString.CustomAttr.Receive.IsPlot, false); base.FormSubmit(false, m_strSubmitAction, l_htAttribute, this.ControlToEntity(false)); }
/// <summary> /// 获得部门成员(负责人、部门领导、大于副处长) /// </summary> private String[] GetDeptMember(String strDeptID) { GetType1(); if (type1 == "1") //负责人 { m_blnIsManager = true; } if (type2 == "1") //职位大于副处长 { strPName = OUConstString.PostName.FUCHUZHANG; } if (type3 == "1") //部门领导 { m_blnIsLeader = true; } return(OAUser.GetUserByDeptPostArray(strDeptID, strPName, m_blnIsManager, m_blnIsLeader)); }
/// <summary> /// 分发 对与已经分发过的则不再分发 /// </summary> /// <param name="yiFenFaUser">已分发人员</param> /// <returns></returns> public void DoCirculate(ref string sSuccesName, ref string sFailedName) { if (!string.IsNullOrEmpty(this.txtCirculatesIDs.Value) || !string.IsNullOrEmpty(this.txtCirculatesDeptIDs.Value)) { string id = Request["CirculateID"] != null ? Request["CirculateID"].ToString() : "-1"; string sql = string.Format(@"SELECT * FROM {0} WHERE ID={1}", TableName.GetCirculateTableName(UCProcessType), id); DataTable dt = Entity.RunQuery(sql); B_ToCirculate tocir = new B_ToCirculate(); tocir.ToProcessID = this.UCProcessID; tocir.ToWorkItemID = this.UCWorkItemID; tocir.YiJian = FormsMethod.GetPrompt(this.txtCommentView.Text, this.txtCommentEdit.Text); tocir.IsAgain = false; tocir.ToProcessType = this.UCProcessType; tocir.ToUserIDS = this.txtCirculatesIDs.Value; tocir.ToiLevelCode = dt != null && dt.Rows.Count > 0 ? dt.Rows[0]["ID"].ToString() : "0"; tocir.ToiLastLevel = dt != null && dt.Rows.Count > 0 ? dt.Rows[0]["LevelCode"].ToString() : ""; if (!string.IsNullOrEmpty(this.txtCirculatesDeptIDs.Value)) { string strUserids = OAUser.GetUserByDeptPostArray(this.txtCirculatesDeptIDs.Value, OUConstString.PostName.FUKEZHANG, true, true)[0]; if (string.IsNullOrEmpty(strUserids) == false && strUserids.Length > 0) { strUserids = strUserids.Replace(";", ","); } if (!string.IsNullOrEmpty(this.txtCirculatesIDs.Value)) { tocir.ToUserIDS += "," + strUserids; } else { tocir.ToUserIDS += strUserids; } } string info = tocir.ChuanYueToDB(); sSuccesName = info; } }
/// <summary> /// 控件填充实体 /// </summary> /// <param name="IsSave">是否保存</param> /// <returns>EntityBase</returns> protected override EntityBase ControlToEntity(Boolean p_blnIsSaveDraft) { B_MergeReceiveBase l_objReceiveBase = base.EntityData != null ? base.EntityData as B_MergeReceiveBase : new B_MergeReceiveBase(); l_objReceiveBase.TemplateName = this.SubTemplateName; l_objReceiveBase.RegisterID = base.RegisterID; l_objReceiveBase.Officer = ddlPoliticalOfficer.SelectedValue; if (!String.IsNullOrEmpty(l_objReceiveBase.Officer)) { l_objReceiveBase.OfficerName = ddlPoliticalOfficer.SelectedItem.Text; } l_objReceiveBase.Officer_Comment = txtPoliticalOfficerComment.Text.TrimEnd(); //附件信息 l_objReceiveBase.FileList = this.ucAttachment.UCDataList; //意见列表 l_objReceiveBase.CommentList = base.Comments; //收文号 l_objReceiveBase.DocumentNo = this.txtReceiveNo.Text; //收文日期 l_objReceiveBase.DocumentReceiveDate = this.txtReceiveDate.ValDate; //文件名称 l_objReceiveBase.DocumentTitle = this.txtDocumentTitle.Text; //原文号 l_objReceiveBase.SendNo = this.txtSendLetterNo.Text; //来文单位 l_objReceiveBase.CommunicationUnit = this.txtCommunicationUnit.Text; //预立卷号 l_objReceiveBase.VolumeNo = this.txtPreVolumeNo.Text; //紧急程度 l_objReceiveBase.UrgentDegree = this.txtUrgentDegree.Text; //提交时间 l_objReceiveBase.SubmitDate = DateTime.Now; if (String.IsNullOrEmpty(l_objReceiveBase.Drafter)) { //发起人ID l_objReceiveBase.DrafterID = CurrentUserInfo.UserName; //发起人姓名 l_objReceiveBase.Drafter = CurrentUserInfo.DisplayName; //发起日期 l_objReceiveBase.DraftDate = DateTime.Now; } else { //发起人ID l_objReceiveBase.DrafterID = l_objReceiveBase.ReceiveUserID; //发起人姓名 l_objReceiveBase.Drafter = l_objReceiveBase.ReceiveUserName; //发起日期 l_objReceiveBase.DraftDate = txtDraftDate.ValDate; } //公司领导批示 l_objReceiveBase.LeaderShip = this.ddlLeadShip.SelectedValue; if (!String.IsNullOrEmpty(this.ddlLeadShip.SelectedValue)) { l_objReceiveBase.LeaderShipName = this.ddlLeadShip.SelectedItem.Text; } if (base.StepName == ProcessConstString.StepName.ReceiveStepName.STEP_INSTRUCTION) { l_objReceiveBase.LS_Comment = this.txtLeadCommentEdit.Text.TrimEnd(); l_objReceiveBase.LS_Date = System.DateTime.Now.ToString(); } else { l_objReceiveBase.LS_Comment = this.txtLeadCommentView.Text.TrimEnd(); } //承办部门 if (!String.IsNullOrEmpty(this.txtUnderTakeDeptID.Text.TrimEnd())) { l_objReceiveBase.UnderTakeDept = this.txtUnderTakeDeptID.Text; l_objReceiveBase.UnderTakeDeptName = this.txtUnderTakeDeptName.Text; l_objReceiveBase.UnderTakeDeptLeaderID = OAUser.GetUserByDeptPostArray(this.txtUnderTakeDeptID.Text, null, true, true)[0]; } //承办科室 if (!String.IsNullOrEmpty(this.ddlUnderTakeSection.SelectedValue)) { l_objReceiveBase.UnderTakeChief = this.ddlUnderTakeSection.SelectedValue; l_objReceiveBase.UnderTakeChiefName = this.ddlUnderTakeSection.SelectedItem.Text; l_objReceiveBase.UnderTakeChiefLeaderID = FormsMethod.GetUserIDByViewBase(OAUser.GetDeptManager(this.ddlUnderTakeSection.SelectedValue, 0)); } //承办人员 if (!String.IsNullOrEmpty(this.ddlUnderTakePeople.SelectedValue)) { l_objReceiveBase.UnderTakePeople = this.ddlUnderTakePeople.SelectedValue; l_objReceiveBase.UnderTakePeopleName = this.ddlUnderTakePeople.SelectedItem.Text; } if (p_blnIsSaveDraft) { l_objReceiveBase.UnderTake_Comment = this.txtUnderTakeCommentEdit.Text; } //传阅 l_objReceiveBase.CPeopleName = this.txtCirculatePeopleName.Text; l_objReceiveBase.CPeopleID = this.txtCirculatePeopleID.Text; l_objReceiveBase.CDeptName = this.txtCirculateDeptName.Text; l_objReceiveBase.CDeptID = this.txtCirculateDeptID.Text; if (base.StepName == ProcessConstString.StepName.ReceiveStepName.STEP_SECTION_DIRECTOR || base.StepName == ProcessConstString.StepName.ReceiveStepName.STEP_SECTION_CHIEF || base.StepName == ProcessConstString.StepName.ReceiveStepName.STEP_SECTION_MEMBER) { if (!p_blnIsSaveDraft) { CYiJian l_objComment = new CYiJian(); l_objComment.Content = this.txtUnderTakeCommentEdit.Text; l_objComment.FinishTime = DateTime.Now.ToString(); l_objComment.UserID = l_objReceiveBase.ReceiveUserID; l_objComment.UserName = l_objReceiveBase.ReceiveUserName; l_objComment.ViewName = base.StepName; l_objComment.Action = m_strSubmitAction; l_objReceiveBase.CommentList.Add(l_objComment); } } else if (base.StepName == ProcessConstString.StepName.ReceiveStepName.STEP_PLOT) { if (!p_blnIsSaveDraft) { CYiJian l_objComment = new CYiJian(); l_objComment.Content = this.txtPoliticalOfficerComment.Text; l_objComment.FinishTime = DateTime.Now.ToString(); l_objComment.UserID = l_objReceiveBase.ReceiveUserID; l_objComment.UserName = l_objReceiveBase.ReceiveUserName; l_objComment.ViewName = base.StepName; l_objComment.Action = m_strSubmitAction; l_objReceiveBase.CommentList.Add(l_objComment); } } else if (base.StepName == ProcessConstString.StepName.ReceiveStepName.STEP_INSTRUCTION) { if (!p_blnIsSaveDraft) { CYiJian l_objComment = new CYiJian(); l_objComment.Content = this.txtLeadCommentEdit.Text; l_objComment.FinishTime = DateTime.Now.ToString(); l_objComment.UserID = l_objReceiveBase.ReceiveUserID; l_objComment.UserName = l_objReceiveBase.ReceiveUserName; l_objComment.ViewName = base.StepName; l_objComment.Action = m_strSubmitAction; l_objReceiveBase.CommentList.Add(l_objComment); } } else if (base.StepName == ProcessConstString.StepName.ReceiveStepName.STEP_PROCESS_CENTER) { if (!p_blnIsSaveDraft && m_strSubmitAction == ProcessConstString.SubmitAction.ReceiveBase.SUBMIT_UNDERTAKE) { CYiJian l_objComment = new CYiJian(); l_objComment.Content = this.txtUnderTakeCommentEdit.Text; l_objComment.FinishTime = DateTime.Now.ToString(); l_objComment.UserID = l_objReceiveBase.ReceiveUserID; l_objComment.UserName = l_objReceiveBase.ReceiveUserName; l_objComment.ViewName = base.StepName; l_objComment.Action = m_strSubmitAction; l_objReceiveBase.CommentList.Add(l_objComment); } } l_objReceiveBase.IsFormSave = p_blnIsSaveDraft; if (p_blnIsSaveDraft) { l_objReceiveBase.Prompt = this.txtPrompt.Text; l_objReceiveBase.PromptEdit = this.txtPromptEdit.Text; } else { if (!String.IsNullOrEmpty(this.txtPromptEdit.Text.TrimEnd())) { l_objReceiveBase.Prompt = this.txtPrompt.Text + "[" + (l_objReceiveBase.ReceiveUserName == string.Empty ? CurrentUserInfo.DisplayName : l_objReceiveBase.ReceiveUserName) + "][" + System.DateTime.Now.ToString(ConstString.DateFormat.Long) + "]:" + this.txtPromptEdit.Text + ConstString.Miscellaneous.NEW_LINE; } } return(l_objReceiveBase); }