private void Save() { string sqlField = string.Format(@"select name,xtype,length,isnullable from syscolumns where id = (select top 1 ID from sysobjects where name = '{0}')", TBName); DataTable dtField = SQLHelper.GetDataTable1(sqlField); string sql = string.Format("UPDATE {0} SET ", TBName); for (int i = 0; i < dtField.Rows.Count; i++) { string FieldName = dtField.Rows[i]["name"].ToString(); if (i > 0) { sql += ","; } if (FieldName == "FormsData") { sql += FieldName + "='" + FormsMethod.Filter2(Request.Form[FieldName].ToString().Replace(">\r\n<", "><")) + "'"; } else { sql += FieldName + "='" + FormsMethod.Filter2(Request.Form[FieldName].ToString()) + "'"; } } sql += string.Format(" WHERE ID={0}", TBID); int ret = SQLHelper.ExecuteNonQuery1(sql); if (ret > 0) { JScript.ShowMsgBox(Page, MsgType.VbCritical, "保存成功"); } }
/// <summary> /// 删除附件 /// </summary> /// <param name="sender"></param> /// <param name="e"></param> protected void btnDel_Click(object sender, EventArgs e) { try { String URL = (sender as LinkButton).CommandName; if (UCIsAgain == "1")// 二次分发不刷新实体和不真正删除附件 { Remove(URL); } else { int ret = MossObject.Del(UCProcessType, URL); if (ret > 0) { Remove(URL); //刷新实体 MossObject mossObject = new MossObject(); mossObject.SaveNewList(UCProcessType, UCWorkItemID, UCDataList, UCTBID); } } RepeaterFiles.DataSource = UCDataList; RepeaterFiles.DataBind(); RunScript(); } catch (Exception ex) { JScript.ShowMsgBox(Page, MsgType.VbExclamation, ex.Message); } }
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> /// <param name="sender"></param> /// <param name="e"></param> protected void btnDetail_Click(object sender, EventArgs e) { if (String.IsNullOrEmpty(txtDocumentNo.Text.TrimEnd())) { JScript.ShowMsgBox(this.Page, "请先选择一条收文记录!", false); return; } Response.Redirect("Container.aspx?ClassName=FS.ADIM.OA.WebUI.WorkFlow.Receive.ReDetail.PG_ReDetail&" + ConstString.QueryString.REGISTER_ID + "=" + Convert.ToString(txtRegisterID.Text), true); }
protected void btnCirculate_Click(object sender, EventArgs e) { if (String.IsNullOrEmpty(this.txtCirculateDeptID.Text.TrimEnd()) && String.IsNullOrEmpty(this.txtCirculatePeopleID.Text.TrimEnd())) { m_strAryMessages.Add("分发:没有选择分发范围!"); JScript.ShowMsgBox(Page, MsgType.VbCritical, m_strAryMessages); return; } base.Circulate(this.txtCirculateDeptID.Text, "1", "", this.txtCirculatePeopleID.Text, "1", true, "", false); }
/// <summary> /// 查询按钮的处理 /// </summary> /// <param name="sender"></param> /// <param name="e"></param> protected void btnQuery_Click(object sender, EventArgs e) { if (!VerifyQueryField()) { JScript.ShowMsgBox(Page, MsgType.VbCritical, m_strAryMessages); return; } LoadRegisterList(); }
protected void ddlProcessTemplate_SelectedIndexChanged(object sender, EventArgs e) { //检查查询条件数据有效性 if (!ValidateQueryCondition()) { JScript.ShowMsgBox(Page, MsgType.VbCritical, m_strAryMessages); return; } LoadTaskList(); }
/// <summary> /// 查询按钮点击事件 /// </summary> /// <param name="sender"></param> /// <param name="e"></param> protected void btnSearch_Click(object sender, EventArgs e) { //检查查询条件数据有效性 if (!ValidateQueryCondition()) { JScript.ShowMsgBox(Page, MsgType.VbCritical, m_strAryMessages); return; } LoadTaskList(); }
/// <summary> /// 修改按钮处理 /// </summary> /// <param name="sender"></param> /// <param name="e"></param> protected void btnModify_Click(object sender, EventArgs e) { B_ReceiveEdit l_BusReceiveEdit = null; if (String.IsNullOrEmpty(txtDocumentNo.Text.TrimEnd())) { JScript.ShowMsgBox(this.Page, "请先选择一条收文记录!", false); return; } if (!VerifyEditField()) { JScript.ShowMsgBox(Page, MsgType.VbCritical, m_strAryMessages); return; } l_BusReceiveEdit = new B_ReceiveEdit(); l_BusReceiveEdit.ID = Convert.ToInt32(txtRegisterID.Text); if (this.txtSendNo.Text.TrimEnd() != l_BusReceiveEdit.SendLetterNo)//任金权增加 { //行文号是否重复 if (B_ReceiveEdit.IsHaveSendNo(this.txtSendNo.Text.TrimEnd())) { JScript.ShowMsgBox(this.Page, "行文号重复", false); this.txtSendNo.Focus(); return; } } if (l_BusReceiveEdit.CreateDate == DateTime.MinValue) { JScript.ShowMsgBox(this.Page, "当前收文登记信息已经被删除,不能做修改动作!", false); return; } PopulateEntity(l_BusReceiveEdit); //归档状态 if (chkIsArchive.Checked) { l_BusReceiveEdit.ArchiveStatus = "已归档"; } else { l_BusReceiveEdit.ArchiveStatus = "未完成"; } if (l_BusReceiveEdit.Save()) { JScript.ShowMsgBox(this.Page, "保存成功", false); PopulateEditField(l_BusReceiveEdit); LoadRegisterList(); } }
protected void btnSaveDraft_Click(object sender, EventArgs e) { //表单的合法性验证 if (!VerifyField()) { JScript.ShowMsgBox(Page, MsgType.VbCritical, m_strAryMessages); return; } this.m_strSubmitAction = ProcessConstString.SubmitAction.ACTION_SAVE_DRAFT; base.FormSubmit(true, m_strSubmitAction, null, this.ControlToEntity(true)); }
protected void btnSumitInspect_Click(object sender, EventArgs e) { B_ReceiveEdit l_BusReceiveEdit = null; String l_strInspector = String.Empty; if (String.IsNullOrEmpty(ddlPoliticalOfficer.SelectedValue)) { JScript.ShowMsgBox(this.Page, MsgType.VbCritical, "没有选择党群工作处处长"); return; } l_strInspector = ddlPoliticalOfficer.SelectedValue; //表单的合法性验证 if (!VerifyField()) { JScript.ShowMsgBox(Page, MsgType.VbCritical, m_strAryMessages); return; } //提交动作 this.m_strSubmitAction = ProcessConstString.SubmitAction.ReceiveBase.SUBMIT_INSPECT; if (String.IsNullOrEmpty(WorkItemID)) { //流程创建时候设置自定义属性 l_htAttribute.Add(ConstString.CustomAttr.Receive.Initiator, CurrentUserInfo.UserName); l_BusReceiveEdit = new B_ReceiveEdit(); l_BusReceiveEdit.ID = Convert.ToInt32(this.RegisterID); if (l_BusReceiveEdit != null) { l_BusReceiveEdit.ProcessID = base.ProcessID; l_BusReceiveEdit.Save(); } } ViewBase l_objClerks = OAUser.GetUserByRole(OUConstString.RoleName.PartysDocument); String l_strClerkField = String.Empty; foreach (User user in l_objClerks.Ens) { l_strClerkField += user.DomainUserID + ";"; } l_strClerkField = SysString.TrimLastWord(l_strClerkField); l_htAttribute.Add(ConstString.CustomAttr.Receive.Officer, l_strInspector); l_htAttribute.Add(ConstString.CustomAttr.Receive.Clerks, l_strClerkField); base.FormSubmit(false, m_strSubmitAction, l_htAttribute, this.ControlToEntity(false)); }
protected void btnDeny_Click(object sender, EventArgs e) { //表单的合法性验证 if (!VerifyField()) { JScript.ShowMsgBox(Page, MsgType.VbCritical, m_strAryMessages); return; } //提交动作 this.m_strSubmitAction = ProcessConstString.SubmitAction.ACTION_DENY; l_htAttribute.Add(ConstString.CustomAttr.Receive.IsDeny, true); base.FormSubmit(false, m_strSubmitAction, l_htAttribute, this.ControlToEntity(false)); }
/// <summary> /// 启动流程按钮处理 /// </summary> /// <param name="sender"></param> /// <param name="e"></param> protected void btnLaunch_Click(object sender, EventArgs e) { B_ReceiveEdit l_BusReceiveEdit = null; if (String.IsNullOrEmpty(txtDocumentNo.Text.TrimEnd())) { JScript.ShowMsgBox(this.Page, "请先选择一条收文记录!", false); return; } l_BusReceiveEdit = new B_ReceiveEdit(); l_BusReceiveEdit.ID = Convert.ToInt32(txtRegisterID.Text); l_BusReceiveEdit.Save(); if (!String.IsNullOrEmpty(l_BusReceiveEdit.ProcessID)) { JScript.ShowMsgBox(this.Page, "当前选择的收文登记记录已经启动!", false); return; } String l_strSuffix = ConstString.QueryString.REGISTER_ID + "=" + Convert.ToString(txtRegisterID.Text); switch (SubTemplateName) { case ProcessConstString.TemplateName.COMPANY_RECEIVE: Response.Redirect("Container.aspx?ClassName=FS.ADIM.OA.WebUI.WorkFlow.Receive.PG_CompanyReceive&TemplateName=" + Server.UrlEncode(ProcessConstString.TemplateName.COMPANY_RECEIVE) + "&" + l_strSuffix, true); break; case ProcessConstString.TemplateName.TRADE_UNION_RECEIVE: Response.Redirect("Container.aspx?ClassName=FS.ADIM.OA.WebUI.WorkFlow.Receive.PG_Receive&TemplateName=" + Server.UrlEncode(ProcessConstString.TemplateName.MERGED_RECEIVE) + "&" + l_strSuffix, true); break; case ProcessConstString.TemplateName.PARTY_DISCIPLINE_RECEIVE: Response.Redirect("Container.aspx?ClassName=FS.ADIM.OA.WebUI.WorkFlow.Receive.PG_Receive&TemplateName=" + Server.UrlEncode(ProcessConstString.TemplateName.MERGED_RECEIVE) + "&" + l_strSuffix, true); break; case ProcessConstString.TemplateName.YOUTH_LEAGUE_RECEIVE: Response.Redirect("Container.aspx?ClassName=FS.ADIM.OA.WebUI.WorkFlow.Receive.PG_Receive&TemplateName=" + Server.UrlEncode(ProcessConstString.TemplateName.MERGED_RECEIVE) + "&" + l_strSuffix, true); break; } }
/// <summary> /// 删除按钮处理 /// </summary> /// <param name="sender"></param> /// <param name="e"></param> protected void btnDelete_Click(object sender, EventArgs e) { B_ReceiveEdit l_BusReceiveEdit = null; if (String.IsNullOrEmpty(txtDocumentNo.Text.TrimEnd())) { JScript.ShowMsgBox(this.Page, "请先选择一条收文记录!", false); return; } l_BusReceiveEdit = new B_ReceiveEdit(); l_BusReceiveEdit.ID = Convert.ToInt32(txtRegisterID.Text); if (l_BusReceiveEdit.Delete()) { JScript.ShowMsgBox(this.Page, "删除成功", false); ClearEditField(); LoadRegisterList(); } }
/// <summary> /// 新增按钮处理 /// </summary> /// <param name="sender"></param> /// <param name="e"></param> protected void btnAddNew_Click(object sender, EventArgs e) { B_HSEdit l_BusReceiveEdit = null; //表单的合法性验证 if (!VerifyEditField()) { ValidateUtility.ShowMsgBox(this.Page, FS.ADIM.OA.BLL.Common.Utility.MessageType.VbCritical, "表单验证失败"); return; } l_BusReceiveEdit = new B_HSEdit(); PopulateEntity(l_BusReceiveEdit); l_BusReceiveEdit.DocumentNo = B_ReceiveID.GenerateReceiveNo(DateTime.Now.Year.ToString(), TemplateName); if (l_BusReceiveEdit.Save()) { JScript.ShowMsgBox(Page, "新增成功", false); PopulateEditField(l_BusReceiveEdit); LoadRegisterList(); } }
/// <summary> /// 打印按钮处理 /// </summary> /// <param name="sender"></param> /// <param name="e"></param> protected void btnPrint_Click(object sender, EventArgs e) { if (this.TemplateName != ProcessConstString.TemplateName.COMPANY_RECEIVE) { if (this.ddlProcessTemplate.SelectedValue == string.Empty) { JScript.ShowMsgBox(this.Page, "请先选择流程类型!", false); return; } else { this.TemplateName = this.ddlProcessTemplate.SelectedValue; } } //if (String.IsNullOrEmpty(txtDocumentNo.Text.TrimEnd())) //{ // JScript.ShowMsgBox(this.Page, "请先选择一条收文记录!", false); // return; //} Response.Redirect("Container.aspx?ClassName=FS.ADIM.OA.WebUI.WorkFlow.Receive.RePrint.PG_RePrint&" + ConstString.QueryString.TEMPLATE_NAME + "=" + TemplateName + "&" + ConstString.QueryString.REGISTER_ID + "=" + Convert.ToString(txtRegisterID.Text), true); //Response.Redirect("Container.aspx?ClassName=FS.ADIM.OA.WebUI.WorkFlow.Receive.RePrint.PG_RePrint&" + ConstString.QueryString.REGISTER_ID + "=" + Convert.ToString(txtRegisterID.Text), true); }
protected void btnAssignMember_Click(object sender, EventArgs e) { if (ddlUnderTakePeople.SelectedValue == String.Empty) { JScript.ShowMsgBox(this.Page, MsgType.VbCritical, "没有选择承办人员"); return; } //表单的合法性验证 if (!VerifyField()) { JScript.ShowMsgBox(Page, MsgType.VbCritical, m_strAryMessages); return; } switch (base.StepName) { case ProcessConstString.StepName.ReceiveStepName.STEP_SECTION_DIRECTOR: l_htAttribute.Add(ConstString.CustomAttr.Receive.IsAssignSection, false); l_htAttribute.Add(ConstString.CustomAttr.Receive.IsAssignPeople, true); l_htAttribute.Add(ConstString.CustomAttr.Receive.SectionMember, ddlUnderTakePeople.SelectedValue); break; case ProcessConstString.StepName.ReceiveStepName.STEP_SECTION_CHIEF: l_htAttribute.Add(ConstString.CustomAttr.Receive.IsAssignSection, true); l_htAttribute.Add(ConstString.CustomAttr.Receive.SectionMember, ddlUnderTakePeople.SelectedValue); break; default: break; } //提交动作 this.m_strSubmitAction = ProcessConstString.SubmitAction.ReceiveBase.ASSIGN_PEOPLE; base.FormSubmit(false, m_strSubmitAction, l_htAttribute, this.ControlToEntity(false)); }
protected void btnSubmitInstruct_Click(object sender, EventArgs e) { if (String.IsNullOrEmpty(ddlLeadShip.SelectedValue)) { JScript.ShowMsgBox(this.Page, MsgType.VbCritical, "没有选择批示领导"); return; } //表单的合法性验证 if (!VerifyField()) { JScript.ShowMsgBox(Page, MsgType.VbCritical, m_strAryMessages); return; } //提交动作 this.m_strSubmitAction = ProcessConstString.SubmitAction.ReceiveBase.SUBMIT_POSTIL; l_htAttribute.Add(ConstString.CustomAttr.Receive.IsPlot, true); l_htAttribute.Add(ConstString.CustomAttr.Receive.IsDeny, false); l_htAttribute.Add(ConstString.CustomAttr.Receive.LeadShip, ddlLeadShip.SelectedValue); base.FormSubmit(false, m_strSubmitAction, l_htAttribute, this.ControlToEntity(false)); }
protected void btnAssignChief_Click(object sender, EventArgs e) { if (ddlUnderTakeSection.SelectedValue == String.Empty) { JScript.ShowMsgBox(this.Page, MsgType.VbCritical, "没有选择承办科室"); return; } //表单的合法性验证 if (!VerifyField()) { JScript.ShowMsgBox(Page, MsgType.VbCritical, m_strAryMessages); return; } //提交动作 this.m_strSubmitAction = ProcessConstString.SubmitAction.ReceiveBase.ASSIGN_SECTION; //获取科级领导 String[] l_strArray = OAUser.GetDeptManagerArray(ddlUnderTakeSection.SelectedValue, 0); String l_strSectionLeaders = l_strArray[0]; if (String.IsNullOrEmpty(l_strArray[0])) { JScript.ShowMsgBox(this.Page, MsgType.VbCritical, "组织结构:未能获取科级领导,无法交办科室"); return; } String l_strSectionLeaderNames = l_strArray[1]; l_htAttribute.Add(ConstString.CustomAttr.Receive.SectionChief, l_strSectionLeaders); l_htAttribute.Add(ConstString.CustomAttr.Receive.IsAssignSection, true); l_htAttribute.Add(ConstString.CustomAttr.Receive.IsAssignPeople, false); base.FormSubmit(false, m_strSubmitAction, l_htAttribute, this.ControlToEntity(false)); }
/// <summary> /// 从服务器端下载附件到客户端 /// </summary> /// <param name="filePath_New"></param> /// <param name="filename_Show"></param> private void DownLoad_File(string filePath_New, string filename_Show) { System.IO.Stream iStream = null; // Buffer to read 10K bytes in chunk: byte[] buffer = new Byte[10000]; // Length of the file: int length; // Total bytes to read: long dataToRead; // Identify the file name. string filename = System.IO.Path.GetFileName(filePath_New); try { // Open the file. iStream = new System.IO.FileStream(filePath_New, System.IO.FileMode.Open, System.IO.FileAccess.Read, System.IO.FileShare.Read); // Total bytes to read: dataToRead = iStream.Length; Response.ContentType = "application/octet-stream"; Response.AddHeader("Content-Disposition", "attachment; filename=" + filename_Show); // Read the bytes. while (dataToRead > 0) { // Verify that the client is connected. if (Response.IsClientConnected) { // Read the data in buffer. length = iStream.Read(buffer, 0, 10000); // Write the data to the current output stream. Response.OutputStream.Write(buffer, 0, length); // Flush the data to the HTML output. Response.Flush(); buffer = new Byte[10000]; dataToRead = dataToRead - length; } else { //prevent infinite loop if user disconnects dataToRead = -1; } } Response.End(); } catch (Exception ex) { JScript.ShowMsgBox(Page, MsgType.VbExclamation, ex.Message); } finally { if (iStream != null) { //Close the file. iStream.Close(); } if (System.IO.File.Exists(filePath_New)) { System.IO.File.Delete(filePath_New); } } }
/// <summary> /// 实体填充控件 /// </summary> protected override void EntityToControl() { B_MergeReceiveBase l_objReceiveBase = null; //收文登记号 this.RegisterID = Request.QueryString[ConstString.QueryString.REGISTER_ID]; if (!String.IsNullOrEmpty(this.RegisterID)) { B_ReceiveEdit l_BusReceiveEdit = new B_ReceiveEdit(); l_BusReceiveEdit.ID = Convert.ToInt32(this.RegisterID); if (l_BusReceiveEdit == null) { JScript.ShowMsgBox(this.Page, MsgType.VbCritical, "当前选择的收文登记信息不存在或者已经被删除,无法继续操作", "Container.aspx?ClassName=FS.ADIM.OA.WebUI.WorkflowMenu.ToDoTask.PG_WaitHandle"); return; } //附件列表 this.ucAttachment.UCDataList = XmlUtility.DeSerializeXml <List <CFuJian> >(l_BusReceiveEdit.FileData); //收文号 this.txtReceiveNo.Text = l_BusReceiveEdit.ReceiveNo; //收文日期 this.txtReceiveDate.Text = l_BusReceiveEdit.ReceiveDate.ToString(ConstString.DateFormat.Normal); //原文号 this.txtSendLetterNo.Text = l_BusReceiveEdit.SendLetterNo; //来文单位 this.txtCommunicationUnit.Text = l_BusReceiveEdit.ReceiveUnit; //卷号 this.txtPreVolumeNo.Text = l_BusReceiveEdit.PreVolumeNo; //文件名称 this.txtDocumentTitle.Text = l_BusReceiveEdit.DocumentTitle; //紧急程度 this.txtUrgentDegree.Text = l_BusReceiveEdit.UrgentDegree; //步骤名称 base.StepName = ProcessConstString.StepName.ReceiveStepName.STEP_INITIAL; this.SubTemplateName = l_BusReceiveEdit.ProcessName; //党群工作处处长 OAUser.GetUserByRole(this.ddlPoliticalOfficer, OUConstString.RoleName.PARTYS_DIRECTOR); } else { l_objReceiveBase = base.EntityData as B_MergeReceiveBase; this.SubTemplateName = l_objReceiveBase.TemplateName; this.RegisterID = l_objReceiveBase.RegisterID; //党群工作处处长 OAUser.GetUserByRole(this.ddlPoliticalOfficer, OUConstString.RoleName.PARTYS_DIRECTOR); ddlPoliticalOfficer.SelectedValue = l_objReceiveBase.Officer; txtPoliticalOfficerComment.Text = l_objReceiveBase.Officer_Comment; //附件列表 this.ucAttachment.UCDataList = l_objReceiveBase.FileList; //收文号 this.txtReceiveNo.Text = l_objReceiveBase.DocumentNo; //收文日期 this.txtReceiveDate.Text = l_objReceiveBase.DocumentReceiveDate.ToString(ConstString.DateFormat.Normal); //原文号 this.txtSendLetterNo.Text = l_objReceiveBase.SendNo; //来文单位 this.txtCommunicationUnit.Text = l_objReceiveBase.CommunicationUnit; //卷号 this.txtPreVolumeNo.Text = l_objReceiveBase.VolumeNo; //文件名称 this.txtDocumentTitle.Text = l_objReceiveBase.DocumentTitle; //紧急程度 this.txtUrgentDegree.Text = l_objReceiveBase.UrgentDegree; //发起人ID this.txtDrafter.Text = l_objReceiveBase.DrafterID; //发起日期 this.txtDraftDate.Text = l_objReceiveBase.DraftDate.ToString(); //公司领导 this.ddlLeadShip.SelectedValue = l_objReceiveBase.LeaderShip; //公司批示意见 this.txtLeadCommentView.Text = l_objReceiveBase.LS_Comment; if (base.StepName == ProcessConstString.StepName.ReceiveStepName.STEP_INSTRUCTION) { this.txtLeadCommentEdit.Text = l_objReceiveBase.LS_Comment; } switch (base.StepName) { case ProcessConstString.StepName.ReceiveStepName.STEP_SECTION_DIRECTOR: //获取处室下属科室 OADept.GetChildDept(this.ddlUnderTakeSection, l_objReceiveBase.UnderTakeDept, 2); //获取处室下属人员 OAUser.GetUserByDeptID(this.ddlUnderTakePeople, l_objReceiveBase.UnderTakeDept, -1); break; case ProcessConstString.StepName.ReceiveStepName.STEP_SECTION_CHIEF: //获取科室下属人员 OAUser.GetUserByDeptID(this.ddlUnderTakePeople, l_objReceiveBase.UnderTakeChief, -1); break; case ProcessConstString.StepName.ReceiveStepName.STEP_SECTION_MEMBER: break; } //承办部门 this.txtUnderTakeDeptID.Text = l_objReceiveBase.UnderTakeDept; this.txtUnderTakeDeptName.Text = l_objReceiveBase.UnderTakeDeptName; //承办科室 this.ddlUnderTakeSection.SelectedValue = l_objReceiveBase.UnderTakeChief; //承办人员 this.ddlUnderTakePeople.SelectedValue = l_objReceiveBase.UnderTakePeople; //承办意见 this.txtUnderTakeCommentEdit.Text = l_objReceiveBase.UnderTake_Comment; this.txtCirculatePeopleName.Text = l_objReceiveBase.CPeopleName; this.txtCirculatePeopleID.Text = l_objReceiveBase.CPeopleID; this.txtCirculateDeptName.Text = l_objReceiveBase.CDeptName; this.txtCirculateDeptID.Text = l_objReceiveBase.CDeptID; //党群工作处处长处理后显示label形式的处长姓名与时间 if (l_objReceiveBase.DraftDate == DateTime.MinValue) { this.ddlPoliticalOfficer.Visible = false; this.lbParty.Visible = true; this.lbParty.Text = l_objReceiveBase.Officer + strNewLine + l_objReceiveBase.Officer_Date; } //领导;批示处理后显示label形式的领导人姓名与时间 if (l_objReceiveBase.LS_Date != "" && l_objReceiveBase.LS_Date != null) { this.ddlLeadShip.Visible = false; this.lbLeadShip.Visible = true; this.lbLeadShip.Text = l_objReceiveBase.LeaderShipName + strNewLine + l_objReceiveBase.LS_Date; } //提示信息 this.txtPrompt.Text = l_objReceiveBase.Prompt; if (l_objReceiveBase.IsFormSave) { this.txtPromptEdit.Text = l_objReceiveBase.PromptEdit; } } }
/// <summary> /// 上传附件 /// </summary> /// <param name="sender"></param> /// <param name="e"></param> protected void btnUpload_Click(object sender, EventArgs e) { try { if (String.IsNullOrEmpty(UCProcessType)) { JScript.ShowMsgBox(Page, MsgType.VbExclamation, "文档库设置不能为空!"); return; } if (multiFile.Files.Length <= 0) { return; } foreach (UploadedFile file in multiFile.Files) { if (file.FileName.Contains("#") || file.FileName.Contains("'")) { JScript.ShowMsgBox(Page, MsgType.VbExclamation, file.FileName + "含有特殊字符,请替换后再上传"); JScript.ResponseScript(this, "javascript:__doPostBack('LinkButton1','')"); return; } } foreach (UploadedFile file in multiFile.Files) { if (file.ContentLength <= MossObject.maxFileSize * 1024 * 1024) { MossObject attach = new MossObject(); attach.ServerWeb = OAConfig.GetConfig("MOSS认证", "ServerWeb"); attach.OldFileName = file.FileName; attach.DocumentName = UCProcessType; #region 更新栏位 List <DictionaryEntry> lst = new List <DictionaryEntry>(); DictionaryEntry de = new DictionaryEntry(); de.Key = "流程实例"; de.Value = UCProcessID; lst.Add(de); de = new DictionaryEntry(); de.Key = "别名"; de.Value = file.FileName; lst.Add(de); de = new DictionaryEntry(); de.Key = "上次修改者"; de.Value = CurrentUserInfo.DisplayName; lst.Add(de); #endregion DictionaryEntry[] result = attach.ConvertToDE(lst.ToArray()); attach.DocumentEntry = result; //文件扩展名 string fileType = System.IO.Path.GetExtension(file.FileName); if (fileType.IndexOf('.') == 0) { fileType = fileType.Substring(1); } bool IsSuccess = false; if ("exe,dll".Contains(fileType.ToLower())) { IMessage im = new WebFormMessage(Page, "不可上传exe或dll文件!"); im.Show(); IsSuccess = false; } else { attach.UploadFilesStream = file.InputStream; //上传附件并更新栏位 IsSuccess = attach.Upload(); } if (IsSuccess) { CFuJian ff = new CFuJian(); ff.Type = System.IO.Path.GetExtension(attach.FileName); if (ff.Type.IndexOf('.') == 0) { ff.Type = ff.Type.Substring(1); } ff.Title = attach.FileName; ff.Alias = System.IO.Path.GetFileNameWithoutExtension(attach.OldFileName); ff.FolderName = attach.FolderName; ff.FileName = attach.FileName; ff.Size = attach.ToFileSize_new(file.ContentLength); //文件大小 ff.ProcessType = UCProcessType; ff.WorkItemID = UCWorkItemID; ff.fullURL = attach.UploadFullName; //全路径 ff.URL = attach.UploadURL; //文件夹+/文件名 UCDataList.Add(ff); } //CFuJian l_objAttachment = MossObject.Upload(file, UCProcessType, UCProcessID, UCWorkItemID); //UCDataList.Add(l_objAttachment); } else { JScript.ShowMsgBox(Page, MsgType.VbExclamation, file.FileName + "大小超过" + MossObject.maxFileSize + "M"); } } RepeaterFiles.DataSource = UCDataList; RepeaterFiles.DataBind(); RunScript(); } catch (Exception ex) { JScript.ShowMsgBox(Page, MsgType.VbExclamation, ex.Message); } }
protected void Page_Load(object sender, EventArgs e) { try { //进度条 inlineProgressBar.AddTrigger(btnUpload); //首次加载 if (!IsPostBack) { //Response.Expires = -1; //Response.ExpiresAbsolute = DateTime.Now; //Response.CacheControl = "no-cache"; //设置控件状态 if (UCIsAgain == "") { if (!UCIsEditable) { tbUpload.Visible = false; divUpload.Visible = false; btnOL.Visible = false; } } #region 接收值 //初始化赋值 if (Session["附件ListTemp"] != null) //从用户控件接收过来 { UCDataList = MossObject.Xml2FuJianList((String)Session["附件ListTemp"]); txtFJXML.Value = Session["附件ListTemp"].ToString(); Session.Remove("附件ListTemp"); //移除Session } #endregion multiFile.StorageConfig["tempDirectory"] = Path.Combine("App_Data", "file1temp"); //zhouli 处理历史附件 if (UCDataList.Count > 0 && UCWorkItemID != "" && UCIsEditable) { MossObject mossObject = new MossObject(); UCDataList = mossObject.GetNewListFuJian(UCProcessType, UCWorkItemID, UCDataList); } RepeaterFiles.DataSource = UCDataList; RepeaterFiles.DataBind(); #region 在线编辑设置 //在线编辑设置 //第一个是webservice地址 第二个是本地路径地址 第三个moss server web地址 第四个当前用户名 txtServicePath.Value = OAConfig.GetConfig("MOSS认证", "MossServiceUrl") + @",C:\\LocalTemp," + OAConfig.GetConfig("MOSS认证", "ServerWeb") + "," + CurrentUserInfo.DisplayName + ","; if (!UCIsEditable) { Panel1.Visible = false; } else { btnOL.Attributes.Add("onClick", String.Format("AttachmentWork('{0}','{1}');", UCControlID, txtServicePath.ClientID)); } #endregion RunScript(); } } catch (Exception ex) { JScript.ShowMsgBox(Page, MsgType.VbExclamation, ex.Message); } }
/// <summary> /// 提交按钮处理事件 /// </summary> /// <param name="sender"></param> /// <param name="e"></param> protected void SubmitBtn_Click(object sender, EventArgs e) { try { //提交动作 string strActionName = ((Button)sender).Text.Trim(); base.SubAction = strActionName; string strErrorMessage = string.Empty; //保存 if (strActionName == ProcessConstString.SubmitAction.ACTION_SAVE_DRAFT) { B_DJGTSend entity = ControlToEntity(true) as B_DJGTSend; entity.SubmitAction = strActionName; base.FormSubmit(true, strActionName, null, entity); } else { B_DJGTSend entity = ControlToEntity(false) as B_DJGTSend; entity.SubmitAction = strActionName; //撤销 if (strActionName == ProcessConstString.SubmitAction.ACTION_CANCEL) { base.FormCancel(entity); } else { //返回验证提示和流程提示 entity.GetSubmitMessage(base.StepName, strActionName, ref strErrorMessage); if (!string.IsNullOrEmpty(strErrorMessage)) { JScript.ShowMsgBox(this.Page, strErrorMessage, false); return; } else { switch (base.SubAction) { case ProcessConstString.SubmitAction.CompanySendAction.ACTION_TJJD: B_DocumentNo_SN sn = new B_DocumentNo_SN(); if (!sn.UpdateNo(ProcessConstString.TemplateName.DJGT_Send, entity.ProcessID, entity.DocumentYear, entity.DocumentNum, entity.DocumentNo)) { return; } break; case ProcessConstString.SubmitAction.CompanySendAction.ACTION_WCGD: if (!string.IsNullOrEmpty(entity.CirculateDeptIDs) || !string.IsNullOrEmpty(entity.CirculateLeaderIDs)) { base.Circulate(entity.CirculateDeptIDs, "1", string.Empty, entity.CirculateLeaderIDs, "1", false, string.Empty, false); } //党纪工团归档 try { string strMessage = string.Empty; this.Devolve(out strMessage); base.Devolved(base.ProcessID, base.TemplateName); JScript.Alert("归档成功!\\n流水号:" + strMessage, false); } catch (Exception ex) { base.WriteLog(ex.Message); JScript.Alert("归档失败!请查看配置是否正确!", false); return; } break; } //调用工作流 Hashtable nValues = entity.GetProcNameValue(base.StepName, strActionName); base.FormSubmit(false, strActionName, nValues, entity); } } } } catch (Exception ex) { JScript.ShowMsgBox(this.Page, ex.Message, false); } }
/// <summary> /// 提交按钮处理事件 /// </summary> /// <param name="sender"></param> /// <param name="e"></param> protected void SubmitBtn_Click(object sender, EventArgs e) { try { //提交动作 string strActionName = ((Button)sender).Text.Trim(); base.SubAction = strActionName; string strErrorMessage = string.Empty; //保存 if (strActionName == ProcessConstString.SubmitAction.ACTION_SAVE_DRAFT) { B_Finance entity = ControlToEntity(true) as B_Finance; entity.SubmitAction = strActionName; base.FormSubmit(true, strActionName, null, entity); } else { B_Finance entity = ControlToEntity(false) as B_Finance; entity.SubmitAction = strActionName; //撤销 if (strActionName == ProcessConstString.SubmitAction.ACTION_CANCEL) { base.FormCancel(entity); } else { //返回验证信息 entity.GetSubmitMessage(base.StepName, strActionName, ref strErrorMessage); if (!string.IsNullOrEmpty(strErrorMessage)) { JScript.ShowMsgBox(this.Page, strErrorMessage, false); return; } else { switch (base.StepName) { case ProcessConstString.StepName.STEP_DRAFT: strActionName = base.SubAction; break; case ProcessConstString.StepName.FinanceStepName.STEP_DISTRIBUTION: if (strActionName == ProcessConstString.SubmitAction.FinanceAction.ACTION_WCGD) { if (!string.IsNullOrEmpty(entity.ChuanYueDeptID) || !string.IsNullOrEmpty(entity.ChuanYueRenYuanID)) { base.Circulate(entity.ChuanYueDeptID, "1", string.Empty, entity.ChuanYueRenYuanID, "1", false, string.Empty, false); } try { string strMessage = string.Empty; this.Devolve(out strMessage); base.Devolved(base.ProcessID, base.TemplateName); JScript.Alert("归档成功!\\n流水号:" + strMessage, false); } catch (Exception ex) { base.WriteLog(ex.Message); JScript.Alert("归档失败!请查看配置是否正确!", false); return; } } break; } } //调用工作流 Hashtable nValues = entity.GetProcNameValue(base.StepName, strActionName); base.FormSubmit(false, strActionName, nValues, entity); } } } catch (Exception ex) { base.ShowMsgBox(this.Page, MsgType.VbExclamation, ex.Message); } }
protected void Page_Load(object sender, EventArgs e) { DataSet l_dstDataSet = null; if (!Page.IsPostBack) { this.ucSendUnit.UCNameControl = this.txtReceiveUnit.ClientID; this.CompanyUC2.UCNameControl = this.txtQueryRecUnit.ClientID; this.TemplateName = Request.QueryString[ConstString.QueryString.TEMPLATE_NAME]; if (String.IsNullOrEmpty(this.TemplateName)) { JScript.ShowMsgBox(this.Page, MsgType.VbCritical, "没有指定收文流程模版!", "Container.aspx?ClassName=FS.ADIM.OA.WebUI.WorkflowMenu.ToDoTask.PG_WaitHandle"); return; } l_dstDataSet = OAConfig.GetRankConfig(); DataTable l_dtbDataTable = l_dstDataSet.Tables[this.TemplateName == ProcessConstString.TemplateName.COMPANY_RECEIVE ? this.TemplateName : ProcessConstString.TemplateName.MERGED_RECEIVE];//renjinquan+ String[] l_strAryRoleName = l_dtbDataTable.Rows[0]["角色"].ToString().Split(new char[] { ';' }, StringSplitOptions.RemoveEmptyEntries); if (l_strAryRoleName.Length == 0) { JScript.RedirectPage(this.Page, "未配置收文登记权限", this.TemplateName, "1"); return; } String[] l_strAryUserRoleNames = CurrentUserInfo.RoleName.ToArray(); IEnumerable <String> l_enumRole = l_strAryUserRoleNames.Intersect(l_strAryRoleName); if (l_enumRole.Count() == 0) { JScript.RedirectPage(this.Page, string.Format("只有[{0}] {1} 可以访问该表单!", l_strAryRoleName[0], OAUser.GetUserByRole(l_strAryRoleName[0]).GetFieldVals("Name", ",")), TemplateName, "1"); return; } if (TemplateName != ProcessConstString.TemplateName.COMPANY_RECEIVE) { trProcessTemplate.Visible = true; this.ddlProcessTemplate.SelectedValue = this.TemplateName; } else { SubTemplateName = TemplateName; } //设置客户端只读 txtReceiveUnit.Attributes.Add("readOnly", "true"); ////////////////////////////////////////////////////20110124 扬子江 //if (!(TemplateName.Equals("党纪工团收文"))) //{ txtDocumentNo.Attributes.Add("readonly", "true"); //} this.ucFileList.UCTemplateName = TemplateName; //收文年份默认加载前后十年,并且默认选择当前年份 int l_intYear = DateTime.Now.Year; for (int i = l_intYear - 10; i < l_intYear + 10; i++) { ddlReceiveYear.Items.Add(i.ToString()); ddlQueryRecYear.Items.Add(i.ToString()); } ddlReceiveYear.Text = l_intYear.ToString(); txtReceiveDate.Text = DateTime.Now.ToString("yyyy-MM-dd"); LoadRegisterList(); if (!String.IsNullOrEmpty(FormID)) { SetFormByID(FormID); } if (this.TemplateName != ProcessConstString.TemplateName.COMPANY_RECEIVE && this.ddlProcessTemplate.SelectedIndex >= 0) { ddlProcessTemplate_SelectedIndexChanged(null, null); } } }
/// <summary> /// 新增按钮处理 /// </summary> /// <param name="sender"></param> /// <param name="e"></param> protected void btnAddNew_Click(object sender, EventArgs e) { B_ReceiveEdit l_BusReceiveEdit = null; //表单的合法性验证 if (!VerifyEditField()) { JScript.ShowMsgBox(Page, MsgType.VbCritical, m_strAryMessages); return; } //行文号是否重复 if (B_ReceiveEdit.IsHaveSendNo(this.txtSendNo.Text.TrimEnd()))//任金权增加 { JScript.ShowMsgBox(this.Page, "行文号重复", false); this.txtSendNo.Focus(); return; } l_BusReceiveEdit = new B_ReceiveEdit(); PopulateEntity(l_BusReceiveEdit); //l_BusReceiveEdit.ReceiveNo = B_ReceiveID.GenerateReceiveNo(DateTime.Now.Year.ToString(), TemplateName); ////////////////////////////////////////////////////20110124 扬子江 if (!(TemplateName.Equals("党纪工团收文"))) { l_BusReceiveEdit.ReceiveNo = B_ReceiveID.GenerateReceiveNo(DateTime.Now.Year.ToString(), TemplateName); } else { this.SubTemplateName = ddlProcessTemplate.SelectedValue; if (this.SubTemplateName == "工会收文") { l_BusReceiveEdit.ReceiveNo = B_ReceiveID.GenerateDJGTReceiveNo("H" + DateTime.Now.Year.ToString(), this.SubTemplateName); } if (this.SubTemplateName == "团委收文") { l_BusReceiveEdit.ReceiveNo = B_ReceiveID.GenerateDJGTReceiveNo("T" + DateTime.Now.Year.ToString(), this.SubTemplateName); } if (this.SubTemplateName == "党委纪委收文") { l_BusReceiveEdit.ReceiveNo = B_ReceiveID.GenerateDJGTReceiveNo("D" + DateTime.Now.Year.ToString(), this.SubTemplateName); } } //归档状态 if (chkIsArchive.Checked) { l_BusReceiveEdit.ArchiveStatus = "已归档"; } else { l_BusReceiveEdit.ArchiveStatus = "未完成"; } if (l_BusReceiveEdit.Save()) { JScript.ShowMsgBox(this.Page, "新增成功", false); PopulateEditField(l_BusReceiveEdit); btnQuery_Click(null, null); } }
protected void Page_Load(object sender, EventArgs e) { DataSet l_dstDataSet = null; if (!Page.IsPostBack) { this.TemplateName = Request.QueryString[ConstString.QueryString.TEMPLATE_NAME]; if (String.IsNullOrEmpty(this.TemplateName)) { JScript.ShowMsgBox(this.Page, MsgType.VbCritical, "没有指定收文流程模版!", "Container.aspx?ClassName=FS.ADIM.OA.WebUI.WorkflowMenu.ToDoTask.PG_WaitHandle"); return; } this.ucCompany.UCNameControl = this.txtReceiveUnit.ClientID; this.ucQueryCompany.UCNameControl = this.txtQueryRecUnit.ClientID; OAList.BindHJLX2(ddlDocumentType, false);//任金权修改 ddlDocumentType.Items.Insert(0, new ListItem()); this.ucAttachment.UCTemplateName = TemplateName; l_dstDataSet = OAConfig.GetRankConfig(); DataTable l_dtbDataTable = l_dstDataSet.Tables[TemplateName]; String[] l_strAryRoleName = l_dtbDataTable.Rows[0]["角色"].ToString().Split(new char[] { ';' }, StringSplitOptions.RemoveEmptyEntries); if (l_strAryRoleName.Length == 0) { JScript.RedirectPage(this.Page, "未配置收文登记权限", TemplateName, "1"); return; } String[] l_strAryUserRoleNames = CurrentUserInfo.RoleName.ToArray(); IEnumerable <String> l_enumRole = l_strAryUserRoleNames.Intersect(l_strAryRoleName); if (l_enumRole.Count() == 0) { JScript.RedirectPage(this.Page, string.Format("只有[{0}] {1} 可以访问该表单!", l_strAryRoleName[0], OAUser.GetUserByRole(l_strAryRoleName[0]).GetFieldVals("Name", ",")), TemplateName, "1"); return; } //初始化设置控件的验证功能 txtReceiveUnit.RequiredType = RequiredType.NotNull; txtReceiveDate.RequiredType = RequiredType.NotNull; txtDocumentTitle.RequiredType = RequiredType.NotNull; txtPageCount.RequiredType = RequiredType.PositiveInteger; txtReceiveUnit.BackColor = System.Drawing.Color.Empty; txtReceiveDate.BackColor = System.Drawing.Color.Empty; txtXingWenDate.BackColor = System.Drawing.Color.Empty; txtDocumentTitle.BackColor = System.Drawing.Color.Empty; //设置客户端只读 txtReceiveUnit.Attributes.Add("readOnly", "true"); txtQueryRecUnit.Attributes.Add("readOnly", "true"); txtDocumentNo.Attributes.Add("readonly", "true"); //收文年份默认加载前后十年,并且默认选择当前年份 txtReceiveDate.Text = DateTime.Now.ToString("yyyy-MM-dd"); txtXingWenDate.Text = DateTime.Now.ToString("yyyy-MM-dd"); txtFormationDate.Text = DateTime.Now.ToString("yyyy-MM-dd"); ddlUrgentDegree.SelectedIndex = 1; txtPageCount.Text = "1"; ddlKeepTime.SelectedIndex = 3; LoadRegisterList(); if (m_ID != null) { SetFormByID(m_ID); } } }