protected void SubmitBtn_Click(object sender, EventArgs e) { try { if (this.cwfAppCheck.CheckInputData()) { String attachmentName = string.Empty; String realAttachmentName = string.Empty; AuthorizationDS.StuffUserRow currentStuff = (AuthorizationDS.StuffUserRow)Session["StuffUser"]; string ProxyStuffName = null; if (Session["ProxyStuffUserId"] != null) { ProxyStuffName = new StuffUserBLL().GetStuffUserById(int.Parse(Session["ProxyStuffUserId"].ToString()))[0].StuffName; } new APFlowBLL().ApproveForm(CommonUtility.GetAPHelper(Session), this.cwfAppCheck.FormID, currentStuff.StuffUserId, currentStuff.StuffName, this.cwfAppCheck.GetApproveOrReject(), this.cwfAppCheck.GetComments(), ProxyStuffName, int.Parse(ViewState["OrganizationUnitID"].ToString())); if (this.Request["Source"] != null) { this.Response.Redirect(this.Request["Source"].ToString()); } else { this.Response.Redirect("~/Home.aspx"); } } } catch (Exception exception) { this.cwfAppCheck.ReloadCtrl(); PageUtility.DealWithException(this, exception); } }
protected void SubmitBtn_Click(object sender, EventArgs e) { try { if (this.cwfAppCheck.CheckInputData()) { AuthorizationDS.StuffUserRow currentStuff = (AuthorizationDS.StuffUserRow)Session["StuffUser"]; string ProxyStuffName = null; if (Session["ProxyStuffUserId"] != null) { ProxyStuffName = new StuffUserBLL().GetStuffUserById(int.Parse(Session["ProxyStuffUserId"].ToString()))[0].StuffName; } new APFlowBLL().ApproveForm(CommonUtility.GetAPHelper(Session), this.cwfAppCheck.FormID, currentStuff.StuffUserId, currentStuff.StuffName, this.cwfAppCheck.GetApproveOrReject(), this.cwfAppCheck.GetComments(), ProxyStuffName, int.Parse(ViewState["OrganizationUnitID"].ToString())); //如果是票扣的话,如果拒绝的话要unlock PKRecord记录 FormDS.FormReimburseRow row = this.SalesReimburseBLL.GetFormReimburseByID(this.cwfAppCheck.FormID)[0]; if (!this.cwfAppCheck.GetApproveOrReject() && row.PaymentTypeID == (int)SystemEnums.PaymentType.PiaoKou) { new PKRecordTableAdapter().UnLockPKRecord(row.FormReimburseID); } if (this.Request["Source"] != null) { this.Response.Redirect(this.Request["Source"].ToString()); } else { this.Response.Redirect("~/Home.aspx"); } } } catch (Exception exception) { this.cwfAppCheck.ReloadCtrl(); PageUtility.DealWithException(this, exception); } }
public string GetStuffNameByID(object stuffUserID) { int id = Convert.ToInt32(stuffUserID); StuffUserBLL bll = new StuffUserBLL(); if (bll.GetStuffUserById(id).Count != 0) { return(bll.GetStuffUserById(id)[0].StuffName); } else { return(string.Empty); } }
protected void SubmitBtn_Click(object sender, EventArgs e) { //如果是票扣的话自动生成报销但 //int formApplyID = int.Parse(this.ViewState["ObjectId"].ToString()); //FormDS.FormApplyRow formApply = this.SalesApplyBLL.GetFormApplyByID(formApplyID)[0]; //if (formApply.PaymentTypeID == (int)SystemEnums.PaymentType.PiaoKou) { // new APFlowBLL().GenerateRebateReimburse(formApplyID); //} try { if (this.cwfAppCheck.CheckInputData()) { AuthorizationDS.StuffUserRow currentStuff = (AuthorizationDS.StuffUserRow)Session["StuffUser"]; string ProxyStuffName = null; if (Session["ProxyStuffUserId"] != null) { ProxyStuffName = new StuffUserBLL().GetStuffUserById(int.Parse(Session["ProxyStuffUserId"].ToString()))[0].StuffName; } new APFlowBLL().ApproveForm(CommonUtility.GetAPHelper(Session), this.cwfAppCheck.FormID, currentStuff.StuffUserId, currentStuff.StuffName, this.cwfAppCheck.GetApproveOrReject(), this.cwfAppCheck.GetComments(), ProxyStuffName, int.Parse(ViewState["OrganizationUnitID"].ToString())); //如果是票扣的话自动生成报销单(返利申请单不会跨月)//如果是审批完成,对于返利自动认为执行完成 FormDS.FormApplyRow formApply = this.SalesApplyBLL.GetFormApplyByID(this.cwfAppCheck.FormID)[0]; if (this.SalesApplyBLL.GetFormByID(this.cwfAppCheck.FormID)[0].StatusID == 2) { this.SalesApplyBLL.ExecuteConfirmForRebate(this.cwfAppCheck.FormID); if (formApply.PaymentTypeID == (int)SystemEnums.PaymentType.PiaoKou) { new APFlowBLL().GenerateRebateReimburse(this.cwfAppCheck.FormID); } } if (this.Request["Source"] != null) { this.Response.Redirect(this.Request["Source"].ToString()); } else { this.Response.Redirect("~/Home.aspx"); } } } catch (Exception exception) { this.cwfAppCheck.ReloadCtrl(); PageUtility.DealWithException(this, exception); } }
protected bool IsUpdateDetailValid() { int stuffUserID = int.Parse(this.StuffUserFormView.DataKey["StuffUserId"].ToString()); TextBox UserNameTextBox = (TextBox)this.StuffUserFormView.FindControl("UserNameTextBox"); if (UserNameTextBox.Text.Trim() != string.Empty) { StuffUserBLL bll = new StuffUserBLL(); if ((int)bll.StuffUserAdapter.QueryForUpdDistinct(stuffUserID, UserNameTextBox.Text.Trim()) > 0) { PageUtility.ShowModelDlg(this, "登陆帐号重复,请修改!"); return(false); } } TextBox StuffIdTextBox = (TextBox)this.StuffUserFormView.FindControl("StuffIdTextBox"); if (StuffIdTextBox.Text.Trim() != string.Empty) { StuffUserBLL bll = new StuffUserBLL(); if ((int)bll.StuffUserAdapter.QueryForUpdDistinctStuffID(StuffIdTextBox.Text.Trim(), stuffUserID) > 0) { PageUtility.ShowModelDlg(this, "员工工号重复,请修改!"); return(false); } } TextBox pwCtl = (TextBox)this.StuffUserFormView.FindControl("UserPasswordTextBox"); if (pwCtl.Text.Trim().Length < 6) { PageUtility.ShowModelDlg(this, "密码长度不能小于6"); return(false); } UserControls_UCDateInput UCAttendDate = (UserControls_UCDateInput)this.StuffUserFormView.FindControl("UCAttendDate"); if (UCAttendDate.SelectedDate == string.Empty) { PageUtility.ShowModelDlg(this, "必须录入入职日期"); return(false); } return(true); }
protected void SubmitBtn_Click(object sender, EventArgs e) { try { if (this.cwfAppCheck.CheckInputData()) { AuthorizationDS.StuffUserRow currentStuff = (AuthorizationDS.StuffUserRow)Session["StuffUser"]; string ProxyStuffName = null; if (Session["ProxyStuffUserId"] != null) { ProxyStuffName = new StuffUserBLL().GetStuffUserById(int.Parse(Session["ProxyStuffUserId"].ToString()))[0].StuffName; } new APFlowBLL().ApproveForm(CommonUtility.GetAPHelper(Session), this.cwfAppCheck.FormID, currentStuff.StuffUserId, currentStuff.StuffName, this.cwfAppCheck.GetApproveOrReject(), this.cwfAppCheck.GetComments(), ProxyStuffName, int.Parse(ViewState["OrganizationUnitID"].ToString())); //如果是跨越的话,拆分申请单 FormDS.FormApplyRow formApply = this.SalesApplyBLL.GetFormApplyByID(this.cwfAppCheck.FormID)[0]; FormDS.FormRow formRow = this.SalesApplyBLL.GetFormByID(this.cwfAppCheck.FormID)[0]; //审批完成后,就应该是执行确认的步骤,要更改pagetype if (formRow.StatusID == 2) { formRow.PageType = (int)SystemEnums.PageType.PromotionApplyExecute; new FormTableAdapter().Update(formRow); if (formApply.EndPeriod > formApply.BeginPeriod) { new APFlowBLL().GenerateApplyForm(this.cwfAppCheck.FormID); } } if (this.Request["Source"] != null) { this.Response.Redirect(this.Request["Source"].ToString()); } else { this.Response.Redirect("~/Home.aspx"); } } } catch (Exception exception) { this.cwfAppCheck.ReloadCtrl(); PageUtility.DealWithException(this, exception); } }