protected void Page_Load(object sender, EventArgs e) { if (!IsPostBack) { InitStartDeptment(); InitApproveList(); string instId = Request.QueryString["id"]; if (string.IsNullOrEmpty(instId)) { FormId = BPMHelp.GetSerialNumber("HR_EN_"); StartDeptId = ddlDeptName.SelectedItem.Value; tbReportCode.Text = FormId; UpdatedTextBox.Value = DateTime.Now.ToShortDateString(); } else { WorkFlowInstance info = new WF_WorkFlowInstance().GetWorkFlowInstanceById(instId); FormId = info.FormId; FormTitle = info.FormTitle; InitFormData(); } InitLeader(); } }
protected void Page_Load(object sender, EventArgs e) { if (!IsPostBack) { InitDepartName(); WorkflowHelper.CurrentUser = "******" + _BPMContext.CurrentUser.LoginId; if (!string.IsNullOrEmpty(Request.QueryString["id"])) { WorkFlowInstance info = new WF_WorkFlowInstance().GetWorkFlowInstanceById(Request.QueryString["id"]); if (info != null) { ViewState["FormID"] = info.FormId; BindFormData(); SetUserControlInstance(); } } else { FormId = BPMHelp.GetSerialNumber("OA_IQS_"); tbReportCode.Text = FormId; UpdatedTextBox.Value = DateTime.Now.ToShortDateString(); tbUserName.Text = CurrentEmployee.EmployeeName; tbMobile.Text = CurrentEmployee.MobilePhone; cbAP.Checked = true; cbVP.Checked = true; cbChairman.Checked = true; } InitLeader(); InitCheckBoxList(); Countersign1.CounterSignDeptId = GroupCode;//集团作为会签基准部门 } }
/// <summary> /// 初始化领导名称 /// </summary> private void InitLeader() { string CompanyCode = BPMHelp.GetCompanyCodeByDeptID(StartDeptId); string GeneralDeptCode = BPMHelp.GetDeptIDByOtherIDAndName(StartDeptId, "综合管理部"); BFPmsUserRoleDepartment bfurd = new BFPmsUserRoleDepartment(); DataTable dtDeptManager = bfurd.GetSelectRoleUser(StartDeptId, "部门负责人"); DataTable dtPresident = bfurd.GetSelectRoleUser(CompanyCode, "总经理"); DataTable dtZHDeptManager = bfurd.GetSelectRoleUser(GeneralDeptCode, "部门负责人"); if (dtDeptManager.Rows.Count != 0) { lbDeptManager.Text = "(" + dtDeptManager.Rows[0]["EmployeeName"].ToString() + ")审批"; } else { lbDeptManager.Text = ""; } if (dtPresident.Rows.Count != 0) { lbPresident.Text = "(" + dtPresident.Rows[0]["EmployeeName"].ToString() + ")审批"; } if (dtZHDeptManager.Rows.Count != 0) { lbZHDeptManager.Text = "(" + dtZHDeptManager.Rows[0]["EmployeeName"].ToString() + ")审核"; } }
protected void Page_Load(object sender, EventArgs e) { if (!IsPostBack) { InitApproveList(); WorkflowHelper.CurrentUser = "******" + _BPMContext.CurrentUser.LoginId; if (!string.IsNullOrEmpty(Request.QueryString["id"])) { WorkFlowInstance info = new WF_WorkFlowInstance().GetWorkFlowInstanceById(Request.QueryString["id"]); if (info != null) { ViewState["FormID"] = info.FormId; BindFormData(); SetUserControlInstance(); } } else { FormId = BPMHelp.GetSerialNumber("HR_CR_"); tbReportCode.Text = FormId; } InitLeader(); if (chkCadresOrRemoval.SelectedIndex != -1) { tbCadre.Visible = chkCadresOrRemoval.SelectedIndex != 1 ? true : false; tbRemoval.Visible = chkCadresOrRemoval.SelectedIndex != 0 ? true : false; } } }
protected void BindBPMDataList(int page = 0) { string user = GetEmployee().LoginId; string proName = tbxTitle.Text.ToString().Trim(); string startTime = tbxBeginTime.Value.ToString().Trim(); string endTime = tbxEndTime.Value.ToString().Trim(); int count = 0; string sourceBPM = "BPM"; if (page != 0) { this.AspNetPager2.CurrentPageIndex = page; } if (user.Contains("\\")) { int beginIndex = user.LastIndexOf("\\"); user = user.Substring(beginIndex + 1, user.Length - beginIndex - 1); } System.Diagnostics.Stopwatch w = new System.Diagnostics.Stopwatch(); w.Start(); DataTable dt = BPMHelp.GetArchiveList_bpm(user, sourceBPM, this.AspNetPager2.CurrentPageIndex, this.AspNetPager2.PageSize, proName, startTime, endTime, out count); //count = BPMHelp.GetArchiveCount(user, sourceBPM, proName, startTime, endTime); w.Stop(); Trace.Write(w.Elapsed.ToString()); LoggerR.logger.DebugFormat("1:{0}", w.Elapsed.ToString()); this.AspNetPager2.RecordCount = count; lblBPMList.DataSource = dt; lblBPMList.DataBind(); }
/// <summary> /// 设置用户DataField /// </summary> /// <returns></returns> protected override List <K2_DataFieldInfo> LoadUserDataField() { var info = BizContext.HR_InternEmploy.FirstOrDefault(x => x.FormID == FormId); StartDeptId = info.InternDeptCode; //string startDeptId = _BPMContext.CurrentUser.MainDeptId; string HRDepartmentCode = BPMHelp.GetDeptIDByOtherIDAndName(StartDeptId, "人力资源部"); string CompanyCode = BPMHelp.GetCompanyCodeByDeptID(StartDeptId); List <K2_DataFieldInfo> dfInfos = new List <K2_DataFieldInfo>(); ///已存在dataField:ActJumped,HRManager,Interviewer,IsPass,StaffingDeptManager ///自动生成 dfInfos.Add(new K2_DataFieldInfo() { DeptCode = HRDepartmentCode, RoleName = "面试负责人", Name = "Interviewer" }); dfInfos.Add(new K2_DataFieldInfo() { DeptCode = StartDeptId, RoleName = "部门负责人", Name = "StaffingDeptManager" }); dfInfos.Add(new K2_DataFieldInfo() { DeptCode = HRDepartmentCode, RoleName = "部门负责人", Name = "HRManager" }); return(dfInfos); }
protected void Page_Load(object sender, EventArgs e) { if (!IsPostBack) { tbQualityScore1.Attributes.Add("onBlur", "Check(this,5);"); tbQualityScore2.Attributes.Add("onBlur", "Check(this,5);"); tbQualityScore3.Attributes.Add("onBlur", "Check(this,20);"); tbQualityScore4.Attributes.Add("onBlur", "Check(this,7.5);"); tbQualityScore5.Attributes.Add("onBlur", "Check(this,7.5);"); tbQualityScore6.Attributes.Add("onBlur", "Check(this,7.5);"); tbQualityScore7.Attributes.Add("onBlur", "Check(this,7.5);"); tbQualityScore8.Attributes.Add("onBlur", "Check(this,10);"); tbQualityScore9.Attributes.Add("onBlur", "Check(this,10);"); tbQualityScore10.Attributes.Add("onBlur", "Check(this,15);"); InitApproveList(); StartDeptId = _BPMContext.CurrentUser.MainDeptId; string instId = Request.QueryString["id"]; if (string.IsNullOrEmpty(instId)) { FormId = BPMHelp.GetSerialNumber("HR_ER_"); tbReportCode.Text = FormId; } else { WorkFlowInstance info = new WF_WorkFlowInstance().GetWorkFlowInstanceById(instId); FormId = info.FormId; FormTitle = info.FormTitle; InitFormData(); } InitLeader(); } }
protected void Page_Load(object sender, EventArgs e) { if (!IsPostBack) { //初始化起始部门 InitStartDeptment(); string instId = Request.QueryString["id"]; if (string.IsNullOrEmpty(instId)) { //得到序列号(FormId) FormId = BPMHelp.GetSerialNumber("ERP_JS_"); //设置标题 FormTitle = ContractApproval_Common.GetErpFormTitle(this); StartDeptId = ddlDepartName.SelectedItem.Value; //判断该流程是否存在【根据erpFormId判断】 if (Pkurg.PWorldBPM.Business.BIZ.ERP.ERP_Common.IsExsitRunFlow(Request["erpFormId"], ERP_WF_T_Name.ERP_ContractFinalAccount)) { ERP_CallbackResultType resultType = new ERP_ContractFinalAccount_Service().NotifyStartAdvance(Request["erpFormId"], true); ScriptManager.RegisterStartupScript(Page, Page.GetType(), "ajax", "alert('" + ConstString.RepeatAlertTip + "'); window.opener=null;window.open('', '_self', '');window.close();", true); return; } } else { WorkFlowInstance info = new WF_WorkFlowInstance().GetWorkFlowInstanceById(instId); FormId = info.FormId; FormTitle = info.FormTitle; //初始化表单数据 InitFormData(); } } }
//WF_WorkFlowInstance wf_WorkFlowInstance = new WF_WorkFlowInstance(); //BFApprovalRecord bfApproval = new BFApprovalRecord(); #region 执行过程中更新参数 /// <summary> /// 执行过程中更新参数 /// </summary> private void UpdateWFParams() { string CompanyCode = BPMHelp.GetCompanyCodeByDeptID(StartDeptId); NameValueCollection dataFields = new NameValueCollection(); if (K2_TaskItem.ActivityInstanceDestination.Name == "部门负责人意见") { if (cbVP.Checked) { dataFields.Add("VicePresident", Workflow_Common.GetRoleUsers(StartDeptId + "," + Countersign1.Result, "主管副总经理")); } else { dataFields.Add("VicePresident", "noapprovers"); } if (cbPresident.Checked) { dataFields.Add("VicePresident", Workflow_Common.GetRoleUsers(CompanyCode, "总经理")); } else { dataFields.Add("President", "noapprovers"); } } if (dataFields.Count != 0 && !string.IsNullOrEmpty(_BPMContext.Sn)) { WorkflowHelper.UpdateDataFields(_BPMContext.Sn, dataFields, _BPMContext.CurrentUser.ApprovalUser); } }
protected void btnConfirm_Click(object sender, EventArgs e) { //proId,name, string procId = lblProcId.Text; string procName = lblProcName.Text; string userCode = GetEmployee().Id; string userName = GetEmployee().Name; List <Person> items = new List <Person>(); if (ViewState["SelectedPersons"] != null) { items = (List <Person>)ViewState["SelectedPersons"]; } //insert foreach (var item in items) { if (!BPMHelp.ExistAuthorization(procId, userCode, item.EmployeeCode)) { BPMHelp.InsertAuthorization(userCode, userName, procId, procName, item.EmployeeCode, item.EmployeeName); } } GoToPage(); }
/// <summary> /// 初始化领导 /// </summary> private void InitLeader() { string CompanyCode = BPMHelp.GetCompanyCodeByDeptID(StartDeptId); BFPmsUserRoleDepartment bfurd = new BFPmsUserRoleDepartment(); DataTable dtDeptManager = bfurd.GetSelectRoleUser(StartDeptId, "部门负责人"); DataTable dtEVP = bfurd.GetSelectRoleUser(CompanyCode, "常务副总裁"); DataTable dtCFO = bfurd.GetSelectRoleUser(CompanyCode, "主管财务领导"); DataTable dtPresident = bfurd.GetSelectRoleUser(CompanyCode, "总裁"); DataTable dtChairman = bfurd.GetSelectRoleUser(CompanyCode, "董事长"); if (dtDeptManager.Rows.Count != 0) { lbDeptManager.Text = "(" + dtDeptManager.Rows[0]["EmployeeName"].ToString() + ")审批"; } if (dtCFO.Rows.Count != 0) { lbCFO.Text = "(" + dtCFO.Rows[0]["EmployeeName"].ToString() + ")审批"; } else { lbCFO.Text = "尚未配置"; } if (dtEVP.Rows.Count != 0) { lbEVP.Text = "(" + dtEVP.Rows[0]["EmployeeName"].ToString() + ")审批"; } if (dtPresident.Rows.Count != 0) { lbPresident.Text = "(" + dtPresident.Rows[0]["EmployeeName"].ToString() + ")审批"; } if (dtChairman.Rows.Count != 0) { lbChairman.Text = "(" + dtChairman.Rows[0]["EmployeeName"].ToString() + ")审批"; } }
//public new string AppID = "2004"; protected void Page_Load(object sender, EventArgs e) { if (!IsPostBack) { InitStartDeptment(); string instId = Request.QueryString["id"]; if (string.IsNullOrEmpty(instId)) { FormId = BPMHelp.GetSerialNumber("ERP_SA_"); FormTitle = ContractApproval_Common.GetErpFormTitle(this);//设置标题 StartDeptId = ddlDepartName.SelectedItem.Value; if (Pkurg.PWorldBPM.Business.BIZ.ERP.ERP_Common.IsExsitRunFlow(Request["erpFormId"], ERP_WF_T_Name.ERP_SupplementalAgreement)) { ERP_CallbackResultType resultType = new ContractApproval_Service().NotifyStartAdvance(Request["erpFormId"], true); ScriptManager.RegisterStartupScript(Page, Page.GetType(), "ajax", "alert('" + ConstString.RepeatAlertTip_BPM + "'); window.opener=null;window.open('', '_self', '');window.close();", true); return; } } else { WorkFlowInstance info = new WF_WorkFlowInstance().GetWorkFlowInstanceById(instId); FormId = info.FormId; FormTitle = info.FormTitle; InitFormData(); //Countersign1.CounterSignDeptId = StartDeptId; } //detailContract.InnerHtml = string.Format("<a href='{0}'>原合同详细信息</a>", SupplementalAgreement_Common.GetPoUrl()); } }
protected void Page_Load(object sender, EventArgs e) { //防止二次提交 ScriptManager.RegisterOnSubmitStatement(Page, typeof(Page), "Go_disabled", "disabledButton('lbAgree');disabledButton('lbReject');disabledButton('lbSubmit');"); ScriptManager.RegisterStartupScript(Page, typeof(Page), "Clear_disabled", "enableButton('lbAgree');enableButton('lbReject');enableButton('lbSubmit');", true); if (!IsPostBack) { FormTitle = "员工离职\\调动转单"; string instId = Request.QueryString["id"]; if (string.IsNullOrEmpty(instId)) { //得到序列号(FormId) FormId = BPMHelp.GetSerialNumber("HR_EL_"); } else { WorkFlowInstance info = new WF_WorkFlowInstance().GetWorkFlowInstanceById(instId); FormId = info.FormId; FormTitle = info.FormTitle; //初始化表单数据 InitFormData(); } } }
protected void lblList1_ItemDataBound(object sender, RepeaterItemEventArgs e) { //绑定已经选中的Checkbox if (ViewState["SelectItems"] != null) { if (e.Item.ItemType == ListItemType.Item || e.Item.ItemType == ListItemType.AlternatingItem) { List <Authorization> items = new List <Authorization>(); items = (List <Authorization>)ViewState["SelectItems"]; CheckBox cbxChoose = (CheckBox)e.Item.FindControl("cbxChoose"); Label lblAuthorizationID = (Label)e.Item.FindControl("lblAuthorizationID"); if (items.Any(p => p.AuthorizationID == lblAuthorizationID.Text)) { cbxChoose.Checked = true; } } } if (e.Item.ItemType == ListItemType.Item || e.Item.ItemType == ListItemType.AlternatingItem) { HyperLink hyperLink = (HyperLink)e.Item.FindControl("hyperLink"); Label lblProcId = (Label)e.Item.FindControl("lblProcId"); string instanceId = ""; string url = BPMHelp.GetUrl(lblProcId.Text, out instanceId); //此处url存在问题,页面存在路径以及参数未知 hyperLink.NavigateUrl = "~/Workflow/ViewPage/V_" + url + "?ID=" + instanceId; } }
protected void Page_Load(object sender, EventArgs e) { if (!IsPostBack) { InitStartDeptment(); string instId = Request.QueryString["id"]; if (string.IsNullOrEmpty(instId)) { FormId = BPMHelp.GetSerialNumber("OA_Custom_"); FormTitle = SysContext.WF_AppDict.FirstOrDefault(x => x.AppId == AppID).AppName; StartDeptId = ddlDepartName.SelectedItem.Value; } else { Pkurg.PWorldBPM.Business.Sys.WF_WorkFlowInstance info = SysContext.WF_WorkFlowInstance.FirstOrDefault(x => x.InstanceID == instId); FormId = info.FormID; FormTitle = info.FormTitle; InitFormData(); } tbPhone.Text = _BPMContext.CurrentPWordUser.MobilePhone; tbPerson.Text = _BPMContext.CurrentPWordUser.EmployeeName; tbDate.Text = DateTime.Now.ToShortDateString(); } else { } }
/// <summary> /// 设置用户DataField /// </summary> /// <returns></returns> protected override List <K2_DataFieldInfo> LoadUserDataField() { var info = BizContext.HR_EmployeeLeft.FirstOrDefault(x => x.FormID == FormId); StartDeptId = info.DeptID; //string startDeptId = _BPMContext.CurrentUser.MainDeptId; string CompanyCode = BPMHelp.GetCompanyCodeByDeptID(StartDeptId); string HRDepartmentCode = BPMHelp.GetDeptIDByOtherIDAndName(StartDeptId, "人力资源部"); string Employee = info.LoginName; List <K2_DataFieldInfo> dfInfos = new List <K2_DataFieldInfo>(); ///已存在dataField:ActJumped,Employee,HRInterface,HRManager,IsPass,RelatedDeptInterface,RelatedDeptManager,StaffingDeptManager ///自动生成 if (cbEmployee.Checked == true) { dfInfos.Add(new K2_DataFieldInfo() { Result = Employee, Name = "Employee" }); } else { dfInfos.Add(new K2_DataFieldInfo() { Result = "noapprovers", Name = "Employee" }); } if (cbDeptManager.Checked == true) { dfInfos.Add(new K2_DataFieldInfo() { DeptCode = StartDeptId, RoleName = "部门负责人", Name = "StaffingDeptManager" }); } else { dfInfos.Add(new K2_DataFieldInfo() { Result = "noapprovers", Name = "StaffingDeptManager" }); } dfInfos.Add(new K2_DataFieldInfo() { DeptCode = CompanyCode, RoleName = "离职流程相关部门接口人", Name = "RelatedDeptInterface" }); dfInfos.Add(new K2_DataFieldInfo() { DeptCode = CompanyCode, RoleName = "离职流程相关部门负责人", Name = "RelatedDeptManager" }); dfInfos.Add(new K2_DataFieldInfo() { DeptCode = CompanyCode, RoleName = "离职流程人力接口人", Name = "HRInterface" }); dfInfos.Add(new K2_DataFieldInfo() { DeptCode = HRDepartmentCode, RoleName = "部门负责人", Name = "HRManager" }); return(dfInfos); }
protected void Page_Load(object sender, EventArgs e) { string methodName = "Page_Load"; Logger.Write(this.GetType(), EnumLogLevel.Info, className + ":" + methodName + ":" + Pkurg.PWorldBPM.Common.Log.MessageType.IN); if (!IsPostBack) { if (!string.IsNullOrEmpty(Request.QueryString["max"])) { txtTotalPrice.Text = Request.QueryString["max"]; } InitDepartName(); if (ddlDepartName.Items.Count < 1) { RunJs(this.Page, "alert('您没有发起该流程权限!请联系管理员');window.close();"); return; } WorkflowHelper.CurrentUser = "******" + _BPMContext.CurrentUser.LoginId; if (!string.IsNullOrEmpty(Request.QueryString["id"])) { WorkFlowInstance info = new WF_WorkFlowInstance().GetWorkFlowInstanceById(Request.QueryString["id"]); if (info != null) { ViewState["FormID"] = info.FormId; BindFormData(); } } else { tbNumber.Text = BPMHelp.GetSerialNumber("JC_");; ViewState["FormID"] = tbNumber.Text; tbPerson.Text = CurrentEmployee.EmployeeName; tbPhone.Text = CurrentEmployee.OfficePhone; UpdatedTextBox.Value = DateTime.Now.ToShortDateString(); if (!string.IsNullOrEmpty(Request.QueryString["ORDERTYPE"])) { tbOrderType.Text = Request.QueryString["ORDERTYPE"]; } if (!string.IsNullOrEmpty(Request.QueryString["ORDERID"])) { tbOrderID.Text = Request.QueryString["ORDERID"]; } if (!string.IsNullOrEmpty(Request.QueryString["URL"])) { tbContent.Text = Request.QueryString["URL"]; } if (!string.IsNullOrEmpty(Request.QueryString["TITLE"])) { tbTitle.Text = Request.QueryString["TITLE"]; } } string StartDeptId = ddlDepartName.SelectedItem.Value; Countersign1.CounterSignDeptId = StartDeptId; } }
protected void Page_Load(object sender, EventArgs e) { string methodName = "Page_Load"; Logger.Write(this.GetType(), EnumLogLevel.Info, className + ":" + methodName + ":" + Pkurg.PWorldBPM.Common.Log.MessageType.IN); if (!IsPostBack) { string currentUser = new IdentityUser().GetEmployee().LoginId; UploadAttachments1._BPMContext.LoginId = currentUser; ViewState["IsSubmit"] = false; ViewState["loginName"] = currentUser.ToLower().Replace(@"k2:founder\", "").Replace(@"founder\", ""); WorkflowHelper.CurrentUser = ViewState["loginName"].ToString(); BFEmployee bfEmployee = new BFEmployee(); EmployeeAdditional employeeaddInfo = bfEmployee.GetEmployeeAdditionalByLoginName(ViewState["loginName"].ToString()); currentEmployee = bfEmployee.GetEmployeeByEmployeeCode(employeeaddInfo.EmployeeCode); Session["CurrentEmployee"] = currentEmployee; if (!string.IsNullOrEmpty(Request.QueryString["sn"])) { sn.Value = Request.QueryString["sn"]; WorklistItem listItem = WorkflowHelper.GetWorklistItemWithSN(sn.Value); taskID.Value = listItem.ID.ToString(); nodeID.Value = listItem.ActivityInstanceDestination.ActID.ToString(); nodeName.Value = listItem.ActivityInstanceDestination.Name; InitApproveOpinion(nodeName.Value); } if (!string.IsNullOrEmpty(Request.QueryString["id"])) { WorkFlowInstance info = new WF_WorkFlowInstance().GetWorkFlowInstanceById(Request.QueryString["id"]); ViewState["FormID"] = info.FormId; InintData(); } else { ContractID = BPMHelp.GetSerialNumber("SQ_");; tbNumber.Text = ContractID; ViewState["FormID"] = ContractID; } //tbPerson.Text = CurrentEmployee.EmployeeName; } Countersign1.SimulateUser = ViewState["loginName"].ToString(); FlowRelated1.SimulateUser = ViewState["loginName"].ToString(); Logger.Write(this.GetType(), EnumLogLevel.Info, className + ":" + methodName + ":" + Pkurg.PWorldBPM.Common.Log.MessageType.OUT); ShowButton(); }
protected void Page_Load(object sender, EventArgs e) { //if (!IsPostBack) //{ // //get worklists // Worklist li = WorkflowHelper.GetWorklistItem(Page.User.Identity.Name); // foreach (WorklistItem lit in li) // { // //显示的单号 // //lit.ProcessInstance.Folio // } //} string methodName = "Page_Load"; string currentUser = new IdentityUser().GetEmployee().LoginId; ViewState["loginName"] = currentUser; Logger.Write(this.GetType(), EnumLogLevel.Info, className + ":" + methodName + ":" + Pkurg.PWorldBPM.Common.Log.MessageType.IN); if (!IsPostBack) { UploadAttachments1._BPMContext.LoginId = currentUser; BFEmployee bfEmployee = new BFEmployee(); EmployeeAdditional employeeaddInfo = bfEmployee.GetEmployeeAdditionalByLoginName(currentUser); currentEmployee = bfEmployee.GetEmployeeByEmployeeCode(employeeaddInfo.EmployeeCode); WorkflowHelper.CurrentUser = currentUser; Session["CurrentEmployee"] = currentEmployee; if (!string.IsNullOrEmpty(Request.QueryString["id"])) { WorkFlowInstance info = new WF_WorkFlowInstance().GetWorkFlowInstanceById(Request.QueryString["id"]); ViewState["FormID"] = info.FormId; InintData(); } else { ContractID = BPMHelp.GetSerialNumber("SQ_"); tbNumber.Text = ContractID; ViewState["FormID"] = ContractID; tbPerson.Text = CurrentEmployee.EmployeeName; tbDepartName.Text = CurrentEmployee.DepartName; UpdatedTextBox.Value = DateTime.Now.ToShortDateString(); Countersign1.CounterSignDeptId = CurrentEmployee.DepartCode; } InintLeader(); } //Countersign1.SimulateUser = ViewState["loginName"].ToString(); //FlowRelated1.SimulateUser = ViewState["loginName"].ToString(); Logger.Write(this.GetType(), EnumLogLevel.Info, className + ":" + methodName + ":" + Pkurg.PWorldBPM.Common.Log.MessageType.OUT); }
protected void Page_Load(object sender, EventArgs e) { if (!IsPostBack) { InitStartDeptment(); if (!string.IsNullOrEmpty(Request.QueryString["id"])) { WorkFlowInstance info = new WF_WorkFlowInstance().GetWorkFlowInstanceById(Request.QueryString["id"]); FormId = info.FormId; InitFormData(); SetUserControlInstance(); } else { string erpFormId = HttpContext.Current.Request["erpFormId"]; string erpFormType = HttpContext.Current.Request["erpFormType"]; if (string.IsNullOrEmpty(erpFormId) || string.IsNullOrEmpty(erpFormType)) { //参数错误 ExceptionHander.GoToErrorPage(); return; } if (Pkurg.PWorldBPM.Business.BIZ.ERP.ERP_Common.IsExsitRunFlow(Request["erpFormId"], ERP_WF_T_Name.ERP_PaymentApplication)) { ERP_CallbackResultType resultType = new ContractApproval_Service().NotifyStartAdvance(Request["erpFormId"], true); ScriptManager.RegisterStartupScript(Page, Page.GetType(), "ajax", "alert('" + ConstString.RepeatAlertTip_BPM + "'); window.opener=null;window.open('', '_self', '');window.close();", true); return; } ContractID = BPMHelp.GetSerialNumber("ERP_FK_"); FormId = ContractID; StartDeptId = ddlDepartName.SelectedItem.Value; LoadRelationPerson(); Countersign1.CounterSignDeptId = StartDeptId; } } //如果起始部门为“营销管理部”,则计划内外的控件隐藏 if (ddlDepartName.SelectedItem.Text.Contains("营销")) { //cblIsInPan.Visible = true; IsInPan.Visible = true; } else { //cblIsInPan.Visible = false; IsInPan.Visible = false; cblIsInPan.SelectedItem.Value = "0"; } }
/// <summary> /// 页面初始化 /// </summary> /// <param name="sender"></param> /// <param name="e"></param> protected void Page_Load(object sender, EventArgs e) { //防止二次提交 ScriptManager.RegisterOnSubmitStatement(Page, typeof(Page), "Go_disabled", "disabledButton('lbAgree');disabledButton('lbReject');disabledButton('lbSubmit');"); ScriptManager.RegisterStartupScript(Page, typeof(Page), "Clear_disabled", "enableButton('lbAgree');enableButton('lbReject');enableButton('lbSubmit');", true); if (!IsPostBack) { //初始化起始部门 InitStartDeptment(); string instId = Request.QueryString["id"]; if (string.IsNullOrEmpty(instId)) { //得到表单编号 FormId = BPMHelp.GetSerialNumber("RWSP_"); //得到起始部门列表 StartDeptId = ddlDepartName.SelectedItem.Value; Department deptInfo = new Pkurg.PWorld.Services.DepartmentService().GetByDepartCode(StartDeptId); //根据登录名得到申请时间 tbDateTime.Text = DateTime.Now.ToString(); } else { WorkFlowInstance info = new WF_WorkFlowInstance().GetWorkFlowInstanceById(instId); FormId = info.FormId; //根据FormId初始化表单数据 InitFormData(FormId); //设置用户控制实例 SetUserControlInstance(); } if (ddlDepartName.SelectedItem.Text.Contains("开封")) { cblFirstLevel.Visible = true; } //根据发起部门来判断是属于集团还是子公司 if (StartDeptId.Contains("S363")) { cblIsImpowerProject.Visible = false; lbIsImpowerProject.Visible = false; zbcgOpinion.Visible = false; fwOpinion.Visible = false; } else { cblIsImpowerProject.Visible = true; lbIsImpowerProject.Visible = true; zbcgOpinion.Visible = true; fwOpinion.Visible = true; } } }
/// <summary> /// 页面初始化[页面第一次加载时就需要根据当前登录用户自动填写申请人,电话,日期,表单编号等内容] /// </summary> /// <param name="sender"></param> /// <param name="e"></param> protected void Page_Load(object sender, EventArgs e) { //防止二次提交 ScriptManager.RegisterOnSubmitStatement(Page, typeof(Page), "Go_disabled", "disabledButton('lbAgree');disabledButton('lbReject');disabledButton('lbSubmit');"); ScriptManager.RegisterStartupScript(Page, typeof(Page), "Clear_disabled", "enableButton('lbAgree');enableButton('lbReject');enableButton('lbSubmit');", true); if (!IsPostBack) { //初始化起始部门 InitStartDeptment(); string instId = Request.QueryString["id"]; if (string.IsNullOrEmpty(instId)) { //得到表单编号 FormId = BPMHelp.GetSerialNumber("ZBXQ_"); //得到起始部门列表 StartDeptId = ddlDepartName.SelectedItem.Value; Department deptInfo = new Pkurg.PWorld.Services.DepartmentService().GetByDepartCode(StartDeptId); //根据登录名得到申请人的姓名,电话,以及当前时间 tbDateTime.Text = DateTime.Now.ToString(); tbUserName.Text = _BPMContext.CurrentPWordUser.EmployeeName; if (_BPMContext.CurrentPWordUser.MobilePhone == null) { tbMobile.Text = ""; } else { tbMobile.Text = _BPMContext.CurrentPWordUser.MobilePhone; } tbReportCode.Text = FormId; } else { WorkFlowInstance info = new WF_WorkFlowInstance().GetWorkFlowInstanceById(instId); FormId = info.FormId; //根据FormId初始化表单数据 InitFormData(FormId); //设置用户控制实例 SetUserControlInstance(); } //InitcbGroupRealateDept(); if (ddlDepartName.SelectedItem.Text.Contains("开封")) { cblFirstLevel.Visible = true; cblFirstLevel.SelectedIndex = 0; } } }
private void InitLeader() { string CompanyCode = BPMHelp.GetCompanyCodeByDeptID(StartDeptId); BFPmsUserRoleDepartment bfurd = new BFPmsUserRoleDepartment(); DataTable dtDeptManager = bfurd.GetSelectRoleUser(StartDeptId, "部门负责人"); DataTable dtPresident = bfurd.GetSelectRoleUser(CompanyCode, "总裁"); DataTable dtCGDeptManager = bfurd.GetSelectRoleUser(CGDeptCode, "部门负责人"); DataTable dtDoorManager = bfurd.GetSelectRoleUser(CGDeptCode, "入户门审核员"); DataTable dtPaintManager = bfurd.GetSelectRoleUser(CGDeptCode, "涂料审核员"); DataTable dtJJuManager = bfurd.GetSelectRoleUser(CGDeptCode, "洁具审核员"); DataTable dtProjectDiretor = bfurd.GetSelectRoleUser(XMYYDeptCode, "部门副总经理"); DataTable dtPurchaseDiretor = bfurd.GetSelectRoleUser(CGDeptCode, "集采复审员"); DataTable dtGroupLeader = bfurd.GetSelectRoleUser(CGDeptCode, "主管副总裁"); if (dtDeptManager.Rows.Count != 0) { lbDeptManager.Text = "(" + dtDeptManager.Rows[0]["EmployeeName"].ToString() + ")审核"; } if (dtPresident.Rows.Count != 0) { lbPresident.Text = "(" + dtPresident.Rows[0]["EmployeeName"].ToString() + ")审批"; } if (dtCGDeptManager.Rows.Count != 0) { lbGroupDeptManager.Text = "(" + dtCGDeptManager.Rows[0]["EmployeeName"].ToString() + ")审核"; } if (dtDoorManager.Rows.Count != 0) { cbDoorManager.Text = "选择 " + dtDoorManager.Rows[0]["EmployeeName"].ToString() + "(入户门)"; } if (dtPaintManager.Rows.Count != 0) { cbPaintManager.Text = "选择 " + dtPaintManager.Rows[0]["EmployeeName"].ToString() + "(涂料)"; } if (dtJJuManager.Rows.Count != 0) { cbJJuManager.Text = "选择 " + dtJJuManager.Rows[0]["EmployeeName"].ToString() + "(洁具)"; } if (dtProjectDiretor.Rows.Count != 0) { lbProjectDiretor.Text = "(" + dtProjectDiretor.Rows[0]["EmployeeName"].ToString() + ")审核"; } if (dtPurchaseDiretor.Rows.Count != 0) { lbPurchaseDiretor.Text = "(" + dtPurchaseDiretor.Rows[0]["EmployeeName"].ToString() + ")审核"; } if (dtGroupLeader.Rows.Count != 0) { lbGroupLeader.Text = "(" + dtGroupLeader.Rows[0]["EmployeeName"].ToString() + ")审批"; } }
protected void lbtnSave2_Click(object sender, EventArgs e) { if (!string.IsNullOrEmpty(rbtnListSteps.SelectedValue)) { GoToActitvy(Convert.ToInt32(lblId.Text), rbtnListSteps.SelectedItem.Text); new Pkurg.PWorldBPM.Business.Controls.Management().GoToActitvy(Convert.ToInt32(lblId.Text), rbtnListSteps.SelectedValue, rbtnListSteps.SelectedItem.Text); BPMHelp.InsertInstanceLog("流程跳转 ", lblTitle2.Text.Replace("-", "").Trim(), string.Format("activityId={0},activityName={1}", rbtnListSteps.SelectedValue, rbtnListSteps.SelectedItem.Text), Employee_Name + " - " + CurrentEmployee.EmployeeCode, HttpContext.Current.User.Identity.Name.Replace("founder\\", "")); lblMsg2.Text = "保存成功"; } }
//撤销授权 protected void lbtnDelete_Click(object sender, EventArgs e) { List <Authorization> items = new List <Authorization>(); if (ViewState["SelectItems"] != null) { items = (List <Authorization>)ViewState["SelectItems"]; } foreach (var item in items) { BPMHelp.DeleteAuthorizations(item.AuthorizationID); } Response.Redirect("AuthorizationList.aspx", false); }
protected void lblBPMList_ItemDataBound(object sender, RepeaterItemEventArgs e) { if (e.Item.ItemType == ListItemType.Item || e.Item.ItemType == ListItemType.AlternatingItem) { Label lblProId = (Label)e.Item.FindControl("lblProId"); HyperLink hyperLink = (HyperLink)e.Item.FindControl("hyperLink"); string parameter = ""; string url = "~/Workflow/ViewPage/V_" + BPMHelp.GetUrl(lblProId.Text, out parameter); if (url.ToLower().EndsWith(".ascx")) { url = System.Configuration.ConfigurationManager.AppSettings["ViewProcInstPageUrl"].ToString(); } hyperLink.NavigateUrl = url + "?ID=" + parameter; } }
/// <summary> /// 绑定默认DataFields /// </summary> /// <param name="procInstID"></param> private void LoadDataFields(int procInstID) { int count = 0; DataTable dt = BPMHelp.Get_K2_ProcInstDataAudit(procInstID, out count); try { rptList.DataSource = dt; rptList.DataBind(); } catch (Exception ex) { lblException.Text = "异常信息:" + ex.Message; lblException.Visible = true; } }
protected void Page_Load(object sender, EventArgs e) { if (!IsPostBack) { //初始化起始部门 InitStartDeptment(); string instId = Request.QueryString["id"]; if (string.IsNullOrEmpty(instId)) { FormId = BPMHelp.GetSerialNumber("OA_WYQS_"); FormTitle = SysContext.WF_AppDict.FirstOrDefault(x => x.AppId == AppID).AppName; StartDeptId = ddlDepartName.SelectedItem.Value; tbReportCode.Text = FormId; UpdatedTextBox.Value = DateTime.Now.ToShortDateString(); tbUserName.Text = CurrentEmployee.EmployeeName; tbMobile.Text = CurrentEmployee.MobilePhone; cbAP.Checked = true; cbVP.Checked = true; } else { WorkFlowInstance info = new WF_WorkFlowInstance().GetWorkFlowInstanceById(instId); FormId = info.FormId; FormTitle = info.FormTitle; InitFormData(); } } if (StartDeptId.Contains("S366-S976")) { Company.Visible = false; Group.Visible = true; Group1.Visible = false; IsReportToWY.Visible = false; //cblIsReportToWY.Visible = false; } else if (!StartDeptId.Contains("S366-S976")) { Company.Visible = true; Company1.Visible = true; Group.Visible = true; IsReportToGroup.Visible = false; } }
protected void lbtnSave_Click(object sender, EventArgs e) { Dictionary <string, string> dicts = new Dictionary <string, string>(); foreach (RepeaterItem item in rptList.Items) { Label lblName = (Label)item.FindControl("lblName"); Label lblOldValue = (Label)item.FindControl("lblOldValue"); TextBox txtNewValue = (TextBox)item.FindControl("txtNewValue"); dicts.Add(lblName.Text, txtNewValue.Text.Trim()); } UpdateDataFields(Convert.ToInt32(lblId.Text), dicts); Logger.Write(this.GetType(), EnumLogLevel.Info, string.Format("***更新DataField成功,Current User="******"修改审批人", lblTitle.Text.Replace("-", "").Trim(), "", Employee_Name + " - " + CurrentEmployee.EmployeeCode, HttpContext.Current.User.Identity.Name.Replace("founder\\", "")); lblMsg.Text = "保存成功"; //Response.Redirect("ProcessesManage_List.aspx", false); }
protected void Page_Load(object sender, EventArgs e) { if (!IsPostBack) { FormTitle = "实习生录用审批"; string instId = Request.QueryString["id"]; if (string.IsNullOrEmpty(instId)) { FormId = BPMHelp.GetSerialNumber("HR_IE_"); } else { WorkFlowInstance info = new WF_WorkFlowInstance().GetWorkFlowInstanceById(instId); FormId = info.FormId; InitFormData(); } } }