/// <summary> /// 提交事件 /// </summary> /// <param name="sender"></param> /// <param name="e"></param> protected void Button_sumbit_Click(object sender, EventArgs e) { try { tag.Text = ""; string coutws = ""; FeeAppointment1.SetValue(); string ProjectID = FeeAppointment1.setProjectID; string CashCertificateID = FeeAppointment1.setCardListID; string CarDetails = FeeAppointment1.setCarDetails; string ApplyCount = FeeAppointment1.setApplyCount; string GetDateTime = txtGetDateTime.Value; DateTime dTimeInput = Convert.ToDateTime(GetDateTime + RadioButtonList_shijian.SelectedValue.ToString()); string UseFor = txtUseFor.Text; string ApplierTel = txtApplierTel.Text; string ApplierID = ((Model.USER_Users)Session["USER_Users"]).ID; string str = FeeAppointment1.setTolStr; string SpecialFundsID = FeeAppointment1.setSpecialFundsID; string Attribute = FeeAppointment1.setAttribute; string Temp2 = FeeAppointment1.setTemp2; modelCash_Apply.ProjectID = int.Parse(ProjectID); modelCash_Apply.CashCertificateID = CashCertificateID; modelCash_Apply.ApplyCount = decimal.Parse(ApplyCount); modelCash_Apply.GetDateTime = dTimeInput; modelCash_Apply.UseFor = UseFor; modelCash_Apply.ApplierTel = ApplierTel; modelCash_Apply.ApplierID = ApplierID; modelCash_Apply.DATETIME = DateTime.Now; modelCash_Apply.Statas = 0;//(0-待审核、1表示审核通过、2表示审核不通过) modelCash_Apply.DoUserID = ((Model.USER_Users)Session["USER_Users"]).ID; modelCash_Apply.CarDetails = CarDetails; modelCash_Apply.SpecialFundsID = int.Parse(SpecialFundsID); modelCash_Apply.Attribute = Attribute; modelCash_Apply.TEMP1 = str; modelCash_Apply.TEMP2 = Temp2; bool B = bllextCash_Account_Subscription.OperationAccount(str, GetDateTime, "1"); if (B) { bllCash_Apply.Add(modelCash_Apply); SendMessage("0", modelCash_Apply); coutws = "alert(\"操作成功!现在进入列表页面\"); "; } else { coutws = "alert(\"操作失败,申请金额超标!现在返回列表页面\"); "; } coutws += "location.href = \"" + ReturnPage + "?" + ReturnCS() + "\";"; ScriptManager.RegisterStartupScript(this.Page, this.GetType(), "updateScript", coutws, true); } catch { tag.Text = "操作失败,请重试!"; } }
protected void Page_Load(object sender, EventArgs e) { AjaxPro.Utility.RegisterTypeForAjax(typeof(add), this.Page); if (!IsPostBack) { Button[] SonBtn = new Button[] { }; if (Request["ApplyID"] != null) { ApplyID = Request["ApplyID"]; modelCash_Apply = bllCash_Apply.GetModel(int.Parse(ApplyID)); } if (Request.Params["parentpage"] != null && !String.IsNullOrEmpty(Request["parentpage"])) { parentpage = Request["parentpage"]; } else { parentpage = ""; } ShowButtonVisibleFalse(); //按钮全部不可见,按条件显示 if (_parentpage == "manageCashApplyPerson") { /*设置模板页中的管理值*/ (Master.FindControl("Label_navigation") as Label).Text = "经费 > 经费预约 > 新建预约 "; /*设置模板页中的管理值*/ ReturnPage = ManageCashApplyPersonPage; SonBtn = new Button[] { Button_sumbit }; } else if (_parentpage == "cashCardManageManageCashApplyPage") { string key = ""; //按key值显示按钮 if (Request["key"] != null) { SetKey = Request["key"]; } /*设置模板页中的管理值*/ if (SetKey == "1") { (Master.FindControl("Label_navigation") as Label).Text = "管理 > 财务管理 > 预约审核 "; if (modelCash_Apply.Statas == 0) { SonBtn = new Button[] { Btn_Through, Btn_Unthread }; Pan_AuditOpinion.Visible = true; } } else if (SetKey == "2") { (Master.FindControl("Label_navigation") as Label).Text = "管理 > 财务管理 > 审核完成 "; if (modelCash_Apply.Statas == 1) { SonBtn = new Button[] { Btn_Done } } ; } /*设置模板页中的管理值*/ ReturnPage = cashCardManageManageCashApplyPage; } else { /*设置模板页中的管理值*/ (Master.FindControl("Label_navigation") as Label).Text = "管理 > 财务管理 "; /*设置模板页中的管理值*/ ReturnPage = ManageCashApplyPage; SonBtn = new Button[] { Button_sumbit }; string ProjectID = ""; if (Session["Work_ProjectId"] != null) { ProjectID = Session["Work_ProjectId"].ToString(); } FeeAppointment1.setProjectID = ProjectID; } //调用自定义控件事件 if (Session["USER_Users"] == null) { return; } FeeAppointment1.UserName = ((Model.USER_Users)Session["USER_Users"]).USERNAME; FeeAppointment1.UserID = ((Model.USER_Users)Session["USER_Users"]).ID; FeeAppointment1.SetKey = SetKey; if (modelCash_Apply.ID != 0) { setValue(modelCash_Apply); FeeAppointment1._modelCash_Apply = modelCash_Apply; } FeeAppointment1.Show(); //获取项目下拉列表 //GetddlProjectID(); ShowButtonVisibleTrue(SonBtn); } }