/// <summary> /// 页面初始 /// </summary> /// <param name="sender"></param> /// <param name="e"></param> protected void Page_Load(object sender, EventArgs e) { if (!IsPostBack) { if (!CheckGrant(global::Common.Enum.TravelPermission.财务管理_团款支出_付款登记)) { Utils.ResponseNoPermit(global::Common.Enum.TravelPermission.财务管理_团款支出_付款登记, false); } DdlPayTypeInit(""); BindInfo(); } #region ajax修改 if (Utils.GetQueryStringValue("act") == "update") { Response.Clear(); EyouSoft.BLL.FinanceStructure.OutRegister regist = new EyouSoft.BLL.FinanceStructure.OutRegister(SiteUserInfo); EyouSoft.Model.FinanceStructure.OutRegisterInfo model = regist.GetOutRegisterList(new EyouSoft.Model.FinanceStructure.QueryOutRegisterInfo() { ReceiveId = Utils.GetQueryStringValue("id") }).SingleOrDefault(x => x.RegisterId == Utils.GetFormValue("registid")); model.BillNo = Utils.GetFormValue("billno"); model.IsBill = Utils.GetFormValue("isbill") == "1" ? true : false; model.PaymentAmount = Utils.GetDecimal(Utils.GetFormValue("payMoney")); model.PaymentDate = Utils.GetDateTime(Utils.GetFormValue("payDate")); model.PaymentType = (EyouSoft.Model.EnumType.TourStructure.RefundType)(Utils.GetInt(Utils.GetFormValue("payType"))); model.Remark = Utils.GetFormValue("desc"); model.StaffName = Utils.GetFormValue("staffname"); model.ReceiveCompanyId = Utils.GetInt(Utils.GetFormValue("comId")); model.ReceiveCompanyName = Utils.GetFormValue("comName"); if (!string.IsNullOrEmpty(Utils.GetFormValue("IsJidiao"))) { model.ReceiveType = Utils.GetEnumValue <EyouSoft.Model.EnumType.FinanceStructure.OutPlanType>(Utils.GetFormValue("jidiaoleibie"), (EyouSoft.Model.EnumType.FinanceStructure.OutPlanType)Utils.GetInt(Utils.GetFormValue("jidiaoleibie"))); } else { model.ReceiveType = Utils.GetEnumValue <EyouSoft.Model.EnumType.FinanceStructure.OutPlanType>(Utils.GetFormValue("jidiaoleibie"), EyouSoft.Model.EnumType.FinanceStructure.OutPlanType.单项服务供应商安排); } int j = regist.UpdateOutRegister(model); if (j > 0) { Response.Write("修改成功!"); } else if (j == -1) { Response.Write("计调项目支出所有登记金额不能大于计调项目支出金额!"); } else { Response.Write("修改失败!"); } Response.End(); } #endregion }
void BindInfo() { EyouSoft.BLL.FinanceStructure.OutRegister regist = new EyouSoft.BLL.FinanceStructure.OutRegister(SiteUserInfo); IList <EyouSoft.Model.FinanceStructure.OutRegisterInfo> list = regist.GetOutRegisterList(new EyouSoft.Model.FinanceStructure.QueryOutRegisterInfo() { ReceiveId = Utils.GetQueryStringValue("id") }); rpt_list.DataSource = list; rpt_list.DataBind(); }
/// <summary> /// 绑定列表 /// </summary> void BindInfo() { string selValue = Utils.GetFormValue(selOperator.UniqueID); selValue = selValue == "" ? "0" : selValue; BindUserList(selValue); IList <EyouSoft.Model.FinanceStructure.OutRegisterInfo> list = new List <EyouSoft.Model.FinanceStructure.OutRegisterInfo>(); EyouSoft.BLL.FinanceStructure.OutRegister bll = new EyouSoft.BLL.FinanceStructure.OutRegister(SiteUserInfo); EyouSoft.Model.FinanceStructure.QueryOutRegisterInfo searchInfo = new EyouSoft.Model.FinanceStructure.QueryOutRegisterInfo(); int count = 0; #region 查询参数 searchInfo.CompanyId = CurrentUserCompanyID; //searchInfo.FTime = Utils.GetDateTimeNullable(Utils.GetQueryStringValue("date")); txt_Date.Value = Utils.GetQueryStringValue("date"); searchInfo.RegisterType = EyouSoft.Model.EnumType.FinanceStructure.OutRegisterType.团队; searchInfo.TourNo = Utils.GetQueryStringValue("teamNum"); txt_teamNum.Value = searchInfo.TourNo; searchInfo.OperatorId = Utils.GetInt(Utils.GetQueryStringValue("Operator")); searchInfo.RegisterStatus = Utils.GetIntNull(Utils.GetQueryStringValue("Status")); if (selOperator.Items.FindByValue(searchInfo.OperatorId.ToString()) != null) { selOperator.Items.FindByValue(searchInfo.OperatorId.ToString()).Selected = true; } if (seleState.Items.FindByValue(searchInfo.RegisterStatus.ToString()) != null) { seleState.Items.FindByValue(searchInfo.RegisterStatus.ToString()).Selected = true; } searchInfo.ReceiveCompanyName = Utils.GetQueryStringValue("com"); txt_com.Value = searchInfo.ReceiveCompanyName; searchInfo.StartTime = Utils.GetDateTimeNullable(Utils.GetQueryStringValue("date")); searchInfo.EndTime = Utils.GetDateTimeNullable(Utils.GetQueryStringValue("regedate")); #endregion list = bll.GetOutRegisterList(searchInfo, 20, Utils.GetInt(Utils.GetQueryStringValue("page")), ref count); rpt_list.DataSource = list; rpt_list.DataBind(); bll.GetOutRegisterList(searchInfo, ref paymentAmount); #region 分页 ExportPageInfo1.intPageSize = 20; ExportPageInfo1.intRecordCount = count; ExportPageInfo1.PageLinkURL = Request.Path + "?"; ExportPageInfo1.UrlParams = Request.QueryString; ExportPageInfo1.CurrencyPage = EyouSoft.Common.Utils.GetInt(Request.QueryString["page"], 1); #endregion rpt_list.EmptyText = "<tr><td id=\"EmptyData\" colspan='8' bgcolor='#e3f1fc' height='50px' align='center'>暂时没有数据!</td></tr>"; }
protected void LinkButton1_Click(object sender, EventArgs e) { EyouSoft.BLL.FinanceStructure.OutRegister regist = new EyouSoft.BLL.FinanceStructure.OutRegister(SiteUserInfo); EyouSoft.Model.FinanceStructure.OutRegisterInfo model = new EyouSoft.Model.FinanceStructure.OutRegisterInfo(); model.BillAmount = Utils.GetDecimal(txt_fukuan.Value); model.BillNo = Utils.GetFormValue("txt_code"); model.CheckerId = 0; model.CompanyId = CurrentUserCompanyID; model.IsBill = Utils.GetInt(Utils.GetFormValue("sel_is")) == 1 ? true : false; model.IsChecked = false; model.IsPay = false; model.IssueTime = DateTime.Now; model.ItemId = Utils.GetQueryStringValue("tourid"); model.OperatorId = SiteUserInfo.ID; model.PaymentAmount = Utils.GetDecimal(txt_fukuan.Value); model.PaymentDate = Utils.GetDateTime(Utils.GetFormValue("txt_payDate")); model.PaymentType = (EyouSoft.Model.EnumType.TourStructure.RefundType)(Utils.GetInt(Utils.GetFormValue(ddlPayType.UniqueID))); //model.ReceiveCompanyId = Utils.GetInt(Utils.GetFormValue("hd_teamId")); model.ReceiveCompanyName = Utils.GetQueryStringValue("com"); model.ReceiveId = Utils.GetQueryStringValue("id"); model.ReceiveType = (EyouSoft.Model.EnumType.FinanceStructure.OutPlanType)Utils.GetInt(Utils.GetQueryStringValue("type")); model.RegisterType = EyouSoft.Model.EnumType.FinanceStructure.OutRegisterType.团队; model.Remark = Utils.GetFormValue("txt_desc"); model.StaffName = Utils.GetFormValue("txt_Lxr"); model.StaffNo = 0; decimal outdecimal = 0; decimal mm = regist.GetExpenseRegisterAmount(null, Utils.GetQueryStringValue("id"), (EyouSoft.Model.EnumType.FinanceStructure.OutPlanType)Utils.GetInt(Utils.GetQueryStringValue("type")), out outdecimal); if (outdecimal < mm + model.PaymentAmount) { EyouSoft.Common.Function.MessageBox.Show(this.Page, "总登记金额已超出应付金额!"); DdlPayTypeInit(""); BindInfo(); return; } int i = regist.AddOutRegister(model); if (i == 1) { //成功 Response.Write("<script>alert('登记成功!');location.href=location.href;</script>"); } else { //成功 Response.Write("<script>alert('登记失败!');</script>"); } }
/// <summary> /// 审批、取消审批、支付、取消支付 /// </summary> /// <returns></returns> private bool SetRegisterStatus() { int requestTypeId = Utils.GetInt(Utils.GetFormValue("requestTypeId")); string registerId = Utils.GetFormValue("registerId"); string planId = Utils.GetFormValue("planId"); string tourId = Utils.GetFormValue("tourId"); bool retCode = false; if (requestTypeId < 1 || string.IsNullOrEmpty(registerId) || string.IsNullOrEmpty(planId) || string.IsNullOrEmpty(tourId)) { return(false); } switch (requestTypeId) { case 1: //取消审批 if (CheckGrant(global::Common.Enum.TravelPermission.财务管理_团款支出_取消审批)) { retCode = new EyouSoft.BLL.FinanceStructure.OutRegister(SiteUserInfo).SetCheckedState(false, SiteUserInfo.ID, registerId) == 1; } break; case 2: //取消支付 if (CheckGrant(global::Common.Enum.TravelPermission.财务管理_团款支出_取消支付)) { retCode = new EyouSoft.BLL.FinanceStructure.OutRegister(SiteUserInfo).SetIsPay(false, registerId) == 1; } break; case 3: //审批 if (CheckGrant(global::Common.Enum.TravelPermission.财务管理_团款支出_付款审批)) { retCode = new EyouSoft.BLL.FinanceStructure.OutRegister(SiteUserInfo).SetCheckedState(true, SiteUserInfo.ID, registerId) == 1; } break; case 4: //支付 if (CheckGrant(global::Common.Enum.TravelPermission.财务管理_团款支出_财务支付)) { retCode = new EyouSoft.BLL.FinanceStructure.OutRegister(SiteUserInfo).SetIsPay(true, registerId) == 1; } break; } return(retCode); }
/// <summary> /// 支付 /// </summary> /// <param name="sender"></param> /// <param name="e"></param> protected void lnkPay_Click(object sender, EventArgs e) { string[] str = Utils.GetFormValues("chk_sel"); if (str.Length > 0) { EyouSoft.BLL.FinanceStructure.OutRegister bll = new EyouSoft.BLL.FinanceStructure.OutRegister(SiteUserInfo); int i = bll.SetIsPay(true, str); if (i == 1) { Response.Write("<script>alert('支付成功');location.href=location.href;</script>"); } else { EyouSoft.Common.Function.MessageBox.Show(this.Page, "支付失败"); } } }
/// <summary> /// 列表项操作 /// </summary> /// <param name="source"></param> /// <param name="e"></param> protected void rpt_list_ItemCommand(object source, RepeaterCommandEventArgs e) { if (e.CommandName == "pay") { if (!CheckGrant(global::Common.Enum.TravelPermission.财务管理_团款支出_财务支付)) { Utils.ResponseNoPermit(global::Common.Enum.TravelPermission.财务管理_团款支出_财务支付, false); } //支付 EyouSoft.Model.FinanceStructure.OutRegisterInfo model = e.Item.DataItem as EyouSoft.Model.FinanceStructure.OutRegisterInfo; EyouSoft.BLL.FinanceStructure.OutRegister bll = new EyouSoft.BLL.FinanceStructure.OutRegister(SiteUserInfo); int i = bll.SetIsPay(true, model.RegisterId); if (i == 1) { BindInfo(); } else { EyouSoft.Common.Function.MessageBox.Show(this.Page, "支付失败"); } } if (e.CommandName == "check") { if (!CheckGrant(global::Common.Enum.TravelPermission.财务管理_团款支出_付款审批)) { Utils.ResponseNoPermit(global::Common.Enum.TravelPermission.财务管理_团款支出_付款审批, false); } //审核 EyouSoft.Model.FinanceStructure.OutRegisterInfo model = e.Item.DataItem as EyouSoft.Model.FinanceStructure.OutRegisterInfo; EyouSoft.BLL.FinanceStructure.OutRegister bll = new EyouSoft.BLL.FinanceStructure.OutRegister(SiteUserInfo); int i = bll.SetCheckedState(true, SiteUserInfo.ID, model.RegisterId); if (i == 1) { BindInfo(); } else { EyouSoft.Common.Function.MessageBox.Show(this.Page, "审核失败"); } } }
protected void Page_Load(object sender, EventArgs e) { #region 权限判断 string type = Utils.GetQueryStringValue("tourType"); if (type != "") { this.hideTourType.Value = type; //团队计划 if (type == "team") { //团队计划:团队结算权限判断 if (CheckGrant(TravelPermission.团队计划_团队计划_栏目)) { if (!CheckGrant(TravelPermission.团队计划_团队计划_团队结算)) { Utils.ResponseNoPermit(TravelPermission.团队计划_团队计划_团队结算, false); return; } } else { Utils.ResponseNoPermit(TravelPermission.团队计划_团队计划_栏目, false); } } //财务管理 if (type == "account") { //财务管理:权限判断 if (!CheckGrant(TravelPermission.财务管理_团队核算_栏目)) { Utils.ResponseNoPermit(TravelPermission.财务管理_团队核算_栏目, false); return; } } //散拼计划 if (type == "san") { //团队计划:团队结算权限判断 if (CheckGrant(TravelPermission.散拼计划_散拼计划_栏目)) { if (!CheckGrant(TravelPermission.散拼计划_散拼计划_团队结算)) { Utils.ResponseNoPermit(TravelPermission.散拼计划_散拼计划_团队结算, false); } } else { Utils.ResponseNoPermit(TravelPermission.散拼计划_散拼计划_栏目, false); } } } #endregion if (!IsPostBack) { if (!CheckGrant(global::Common.Enum.TravelPermission.财务管理_团款支出_付款登记)) { Utils.ResponseNoPermit(global::Common.Enum.TravelPermission.财务管理_团款支出_付款登记, false); } DdlPayTypeInit(""); BindInfo(); } if (Utils.GetQueryStringValue("act") == "update") { Response.Clear(); EyouSoft.BLL.FinanceStructure.OutRegister regist = new EyouSoft.BLL.FinanceStructure.OutRegister(SiteUserInfo); EyouSoft.Model.FinanceStructure.OutRegisterInfo model = regist.GetOutRegisterList(new EyouSoft.Model.FinanceStructure.QueryOutRegisterInfo() { ReceiveId = Utils.GetQueryStringValue("id") }).SingleOrDefault(x => x.RegisterId == Utils.GetFormValue("registid")); model.BillNo = Utils.GetFormValue("billno"); model.IsBill = Utils.GetFormValue("isbill") == "1" ? true : false; model.PaymentAmount = Utils.GetDecimal(Utils.GetFormValue("payMoney")); model.PaymentDate = Utils.GetDateTime(Utils.GetFormValue("payDate")); model.PaymentType = (EyouSoft.Model.EnumType.TourStructure.RefundType)(Utils.GetInt(Utils.GetFormValue("payType"))); model.Remark = Utils.GetFormValue("desc"); model.StaffName = Utils.GetFormValue("staffname"); int j = regist.UpdateOutRegister(model); if (j > 0) { Response.Write("修改成功!"); } else if (j == -1) { Response.Write("计调项目支出所有登记金额不能大于计调项目支出金额!"); } else { Response.Write("修改失败!"); } Response.End(); } }
/// <summary> /// 页面初始化绑定 /// </summary> /// <param name="sender"></param> /// <param name="e"></param> protected void Page_Load(object sender, EventArgs e) { //GetOutRegisterList #region 审核 if (Utils.GetQueryStringValue("act") == "pass") { if (!CheckGrant(global::Common.Enum.TravelPermission.财务管理_团款支出_付款审批)) { Utils.ResponseNoPermit(global::Common.Enum.TravelPermission.财务管理_团款支出_付款审批, false); return; } EyouSoft.Model.FinanceStructure.OutRegisterInfo model = new EyouSoft.Model.FinanceStructure.OutRegisterInfo(); EyouSoft.BLL.FinanceStructure.OutRegister bll = new EyouSoft.BLL.FinanceStructure.OutRegister(SiteUserInfo); int i = bll.SetCheckedState(true, SiteUserInfo.ID, Utils.GetQueryStringValue("id")); if (i == 1) { Response.Write("<script>alert('审核成功');location.href='waitkuan.aspx';</script>"); } else { EyouSoft.Common.Function.MessageBox.Show(this.Page, "审核失败"); } } #endregion #region 批量审核or批量支付 if (Utils.GetQueryStringValue("act") == "Allpass" || Utils.GetQueryStringValue("act") == "Allpay") { string act = Utils.GetQueryStringValue("act"); EyouSoft.BLL.FinanceStructure.BSpendRegister bll = new EyouSoft.BLL.FinanceStructure.BSpendRegister(); IList <string> ls = new List <string>(); string[] ids = Utils.GetFormValue("ids").Split(','); for (int i = 0; i < ids.Length; i++) { ls.Add(ids[i]); } bool res = false; if (act == "Allpass") { res = bll.BatchApprovalExpense(SiteUserInfo.ID, ls) > 0; } else { res = bll.BatchPayExpense(SiteUserInfo.ID, ls) > 0; } Response.Clear(); Response.Write(string.Format("{{\"res\":{0}}}", res ? 1 : -1)); Response.End(); } #endregion #region 支付 if (Utils.GetQueryStringValue("act") == "pay") { if (!CheckGrant(global::Common.Enum.TravelPermission.财务管理_团款支出_财务支付)) { Utils.ResponseNoPermit(global::Common.Enum.TravelPermission.财务管理_团款支出_财务支付, false); return; } EyouSoft.Model.FinanceStructure.OutRegisterInfo model = new EyouSoft.Model.FinanceStructure.OutRegisterInfo(); EyouSoft.BLL.FinanceStructure.OutRegister bll = new EyouSoft.BLL.FinanceStructure.OutRegister(SiteUserInfo); int i = bll.SetIsPay(true, Utils.GetQueryStringValue("id")); if (i == 1) { Response.Write("<script>alert('支付成功');location.href='waitkuan.aspx';</script>"); } else { EyouSoft.Common.Function.MessageBox.Show(this.Page, "支付失败"); } } #endregion #region 绑定 if (!IsPostBack) { if (!CheckGrant(global::Common.Enum.TravelPermission.财务管理_团款支出_栏目)) { Utils.ResponseNoPermit(global::Common.Enum.TravelPermission.财务管理_团款支出_栏目, false); } BindInfo(); } #endregion }