public void SelectJson(int payApplyId) { int pageIndex = 1, pageSize = 100; string orderStr = string.Empty, whereStr = string.Empty; NFMT.Common.UserModel user = Utility.UserUtility.CurrentUser; NFMT.Funds.BLL.PayApplyBLL bll = new NFMT.Funds.BLL.PayApplyBLL(); NFMT.Common.SelectModel select = bll.GetSelectedSelect(pageIndex, pageSize, orderStr, payApplyId); NFMT.Common.IAuthority auth = new NFMT.Common.BasicAuth(); NFMT.Common.ResultModel result = bll.Load(user, select,auth); int totalRows = result.AffectCount; System.Data.DataTable dt = result.ReturnValue as System.Data.DataTable; if (dt != null) { foreach (System.Data.DataRow dr in dt.Rows) { if (dt.Rows.IndexOf(dr) > 0) { this.Sids += ","; } if (dr["StockId"] != DBNull.Value) { int stockId = Convert.ToInt32(dr["StockId"]); this.Sids += stockId.ToString(); } } } this.SelectedJson = Newtonsoft.Json.JsonConvert.SerializeObject(dt, new Newtonsoft.Json.Converters.DataTableConverter()); }
public void ProcessRequest(HttpContext context) { NFMT.Common.ResultModel result = new NFMT.Common.ResultModel(); Dictionary<string, string> dic = new Dictionary<string, string>(); if (string.IsNullOrEmpty(context.Request.Form["source"])) { result.Message = "数据源为空"; result.ResultStatus = -1; context.Response.Write(serializer.Serialize(result)); context.Response.End(); } try { string jsonData = context.Request.Form["source"]; var obj = serializer.Deserialize<NFMT.WorkFlow.Model.DataSource>(jsonData); NFMT.Funds.BLL.PayApplyBLL bll = new NFMT.Funds.BLL.PayApplyBLL(); result = bll.GetCondition(user, obj.RowId); //NFMT.Common.Operate operate = NFMT.Common.Operate.CreateOperate(obj.DalName, obj.AssName); //result = operate.Get(user, obj.BaseName, obj.TableCode, obj.RowId); if (result.ResultStatus == 0) { System.Data.DataTable dt = result.ReturnValue as System.Data.DataTable; if (dt != null && dt.Rows.Count > 0) { System.Data.DataRow dr = dt.Rows[0]; foreach (System.Data.DataColumn column in dt.Columns) { string columnName = column.ColumnName; object val = dr[columnName]; string valStr = string.Empty; if (val != null) valStr = val.ToString(); //condition.ConditionCollection.Add(columnName, valStr); dic.Add(columnName, valStr); } result.ReturnValue = dic; } } } catch (Exception ex) { result.Message = ex.Message; result.ResultStatus = -1; } context.Response.ContentType = "text/plain"; context.Response.Write(serializer.Serialize(result)); }
public void ProcessRequest(HttpContext context) { context.Response.ContentType = "text/plain"; NFMT.Common.UserModel user = Utility.UserUtility.CurrentUser; NFMT.Common.ResultModel result = new NFMT.Common.ResultModel(); string payApplyStr = context.Request.Form["PayApply"]; if (string.IsNullOrEmpty(payApplyStr)) { result.Message = "付款申请不能为空"; context.Response.Write(Newtonsoft.Json.JsonConvert.SerializeObject(result)); context.Response.End(); } string memo = context.Request.Form["memo"]; int deptId = 0; int corpId = 0; if (string.IsNullOrEmpty(context.Request.Form["deptId"]) || !int.TryParse(context.Request.Form["deptId"], out deptId)) { result.Message = "未选择申请部门"; context.Response.Write(Newtonsoft.Json.JsonConvert.SerializeObject(result)); context.Response.End(); } if (string.IsNullOrEmpty(context.Request.Form["corpId"]) || !int.TryParse(context.Request.Form["corpId"], out corpId)) { result.Message = "未选择申请公司"; context.Response.Write(Newtonsoft.Json.JsonConvert.SerializeObject(result)); context.Response.End(); } try { System.Web.Script.Serialization.JavaScriptSerializer serializer = new System.Web.Script.Serialization.JavaScriptSerializer(); NFMT.Funds.Model.PayApply payApply = serializer.Deserialize<NFMT.Funds.Model.PayApply>(payApplyStr); NFMT.Funds.BLL.PayApplyBLL bll = new NFMT.Funds.BLL.PayApplyBLL(); result = bll.PayApplyContractUpdate(user, payApply, memo, deptId, corpId); if (result.ResultStatus == 0) { result.Message = "付款申请修改成功"; } } catch (Exception ex) { result.ResultStatus = -1; result.Message = ex.Message; } context.Response.Write(Newtonsoft.Json.JsonConvert.SerializeObject(result)); }
protected void Page_Load(object sender, EventArgs e) { if (!IsPostBack) { Utility.VerificationUtility ver = new Utility.VerificationUtility(); ver.JudgeOperate(this.Page, 52, new List<NFMT.Common.OperateEnum>() { NFMT.Common.OperateEnum.修改 }); string redirectUrl = "PayApplyList.aspx"; this.navigation1.Routes.Add("付款申请列表", redirectUrl); this.navigation1.Routes.Add("付款申请新增--关联发票", string.Empty); this.PayMatterStyle = (int)NFMT.Data.StyleEnum.付款事项; this.PayModeStyle = (int)NFMT.Data.StyleEnum.PayMode; NFMT.Common.UserModel user = Utility.UserUtility.CurrentUser; int payApplyId = 0; if (string.IsNullOrEmpty(Request.QueryString["id"]) || !int.TryParse(Request.QueryString["id"], out payApplyId)) Response.Redirect(redirectUrl); //获取付款申请 NFMT.Funds.BLL.PayApplyBLL payApplyBLL = new NFMT.Funds.BLL.PayApplyBLL(); NFMT.Common.ResultModel result = payApplyBLL.Get(user, payApplyId); if (result.ResultStatus != 0) Response.Redirect(redirectUrl); this.curPayApply = result.ReturnValue as NFMT.Funds.Model.PayApply; if (this.curPayApply == null || this.curPayApply.PayApplyId <= 0) Response.Redirect(redirectUrl); //获取主申请 NFMT.Operate.BLL.ApplyBLL applyBLL = new NFMT.Operate.BLL.ApplyBLL(); result = applyBLL.Get(user, this.curPayApply.ApplyId); if (result.ResultStatus != 0) Response.Redirect(redirectUrl); this.curApply = result.ReturnValue as NFMT.Operate.Model.Apply; if (this.curApply == null || this.curApply.ApplyId <= 0) Response.Redirect(redirectUrl); NFMT.Authority.CorpAuth auth = new NFMT.Authority.CorpAuth(); auth.AuthColumnNames.Add("inv.InCorpId"); NFMT.Common.SelectModel select = payApplyBLL.GetInvoiceListByApplySelect(1, 100, "si.SIId desc", this.curPayApply.PayApplyId); result = payApplyBLL.Load(user, select, auth); int totalRows = result.AffectCount; System.Data.DataTable dt = result.ReturnValue as System.Data.DataTable; this.JsonStr = Newtonsoft.Json.JsonConvert.SerializeObject(dt, new Newtonsoft.Json.Converters.DataTableConverter()); } }
public void ProcessRequest(HttpContext context) { context.Response.ContentType = "text/plain"; NFMT.Common.UserModel user = Utility.UserUtility.CurrentUser; NFMT.Common.ResultModel result = new NFMT.Common.ResultModel(); string payApplyStr = context.Request.Form["PayApply"]; string detailStr = context.Request.Form["Details"]; string applyStr = context.Request.Form["Apply"]; if (string.IsNullOrEmpty(applyStr)) { result.Message = "申请不能为空"; context.Response.Write(Newtonsoft.Json.JsonConvert.SerializeObject(result)); context.Response.End(); } if (string.IsNullOrEmpty(payApplyStr)) { result.Message = "付款申请不能为空"; context.Response.Write(Newtonsoft.Json.JsonConvert.SerializeObject(result)); context.Response.End(); } try { System.Web.Script.Serialization.JavaScriptSerializer serializer = new System.Web.Script.Serialization.JavaScriptSerializer(); NFMT.Operate.Model.Apply apply = serializer.Deserialize<NFMT.Operate.Model.Apply>(applyStr); NFMT.Funds.Model.PayApply payApply = serializer.Deserialize<NFMT.Funds.Model.PayApply>(payApplyStr); List<NFMT.Funds.Model.InvoicePayApply> details = new List<NFMT.Funds.Model.InvoicePayApply>(); details = serializer.Deserialize<List<NFMT.Funds.Model.InvoicePayApply>>(detailStr); NFMT.Funds.BLL.PayApplyBLL bll = new NFMT.Funds.BLL.PayApplyBLL(); result = bll.PayApplyInvoiceUpdate(user,apply, payApply, details); if (result.ResultStatus == 0) result.Message = "付款申请修改成功"; } catch (Exception ex) { result.ResultStatus = -1; result.Message = ex.Message; } context.Response.Write(Newtonsoft.Json.JsonConvert.SerializeObject(result)); }
public void ProcessRequest(HttpContext context) { context.Response.ContentType = "text/plain"; int payApplyId = 0; int operateId = 0; if (!int.TryParse(context.Request.Form["pi"], out payApplyId) || payApplyId <= 0) { context.Response.Write("付款申请序号错误"); context.Response.End(); } if (!int.TryParse(context.Request.Form["oi"], out operateId) || operateId <= 0) { context.Response.Write("操作错误"); context.Response.End(); } NFMT.Common.UserModel user = Utility.UserUtility.CurrentUser; NFMT.Common.OperateEnum operateEnum = (NFMT.Common.OperateEnum)operateId; NFMT.Common.ResultModel result = new NFMT.Common.ResultModel(); NFMT.Funds.BLL.PayApplyBLL bll = new NFMT.Funds.BLL.PayApplyBLL(); switch (operateEnum) { case NFMT.Common.OperateEnum.撤返: result = bll.Goback(user, payApplyId); break; case NFMT.Common.OperateEnum.作废: result = bll.Invalid(user, payApplyId); break; case NFMT.Common.OperateEnum.确认完成: result = bll.Confirm(user, payApplyId); break; case NFMT.Common.OperateEnum.确认完成撤销: result = bll.ConfirmCancel(user, payApplyId); break; case NFMT.Common.OperateEnum.关闭: result = bll.Close(user, payApplyId); break; } if (result.ResultStatus == 0) result.Message = string.Format("{0}成功",operateEnum.ToString()); context.Response.Write(result.Message); }
public void SelectJson(int payApplyId, int paymentId) { int pageIndex = 1, pageSize = 100; string orderStr = string.Empty, whereStr = string.Empty; NFMT.Common.UserModel user = Utility.UserUtility.CurrentUser; NFMT.Funds.BLL.PayApplyBLL bll = new NFMT.Funds.BLL.PayApplyBLL(); NFMT.Common.SelectModel select = bll.GetPaymentStockCreateSelect(pageIndex, pageSize, orderStr, payApplyId, paymentId); NFMT.Common.ResultModel result = bll.Load(user, select,new NFMT.Common.BasicAuth()); int totalRows = result.AffectCount; System.Data.DataTable dt = result.ReturnValue as System.Data.DataTable; this.SelectedJson = Newtonsoft.Json.JsonConvert.SerializeObject(dt, new Newtonsoft.Json.Converters.DataTableConverter()); }
protected void Page_Load(object sender, EventArgs e) { if (!IsPostBack) { Utility.VerificationUtility ver = new Utility.VerificationUtility(); ver.JudgeOperate(this.Page, 52, new List<NFMT.Common.OperateEnum>() { NFMT.Common.OperateEnum.修改 }); this.navigation1.Routes.Add("付款申请列表", "PayApplyList.aspx"); this.navigation1.Routes.Add("付款申请修改--关联库存", string.Empty); this.PayMatterStyle = (int)NFMT.Data.StyleEnum.付款事项; this.PayModeStyle = (int)NFMT.Data.StyleEnum.PayMode; int payApplyId = 0; if (string.IsNullOrEmpty(Request.QueryString["id"]) || !int.TryParse(Request.QueryString["id"], out payApplyId)) Response.Redirect("PayApplyList.aspx"); //验证付款申请是否存在 NFMT.Common.UserModel user = Utility.UserUtility.CurrentUser; NFMT.Funds.BLL.PayApplyBLL bll = new NFMT.Funds.BLL.PayApplyBLL(); NFMT.Common.ResultModel result = bll.Get(user, payApplyId); if (result.ResultStatus != 0) Response.Redirect("PayApplyList.aspx"); NFMT.Funds.Model.PayApply payApply = result.ReturnValue as NFMT.Funds.Model.PayApply; if (payApply == null || payApply.PayApplyId <= 0) Response.Redirect("PayApplyList.aspx"); this.curPayApply = payApply; //获取主申请 NFMT.Operate.BLL.ApplyBLL applyBLL = new NFMT.Operate.BLL.ApplyBLL(); result = applyBLL.Get(user, payApply.ApplyId); if (result.ResultStatus != 0) Response.Redirect("PayApplyList.aspx"); NFMT.Operate.Model.Apply apply = result.ReturnValue as NFMT.Operate.Model.Apply; if (apply == null || apply.ApplyId <= 0) Response.Redirect("PayApplyList.aspx"); this.curApply = apply; this.SelectJson(payApplyId); } }
public void ProcessRequest(HttpContext context) { context.Response.ContentType = "text/plain"; NFMT.Common.UserModel user = Utility.UserUtility.CurrentUser; NFMT.Common.ResultModel result = new NFMT.Common.ResultModel(); string applyStr = context.Request.Form["Apply"]; if (string.IsNullOrEmpty(applyStr)) { result.Message = "申请不能为空"; context.Response.Write(Newtonsoft.Json.JsonConvert.SerializeObject(result)); context.Response.End(); } string payApplyStr = context.Request.Form["PayApply"]; if (string.IsNullOrEmpty(payApplyStr)) { result.Message = "付款申请不能为空"; context.Response.Write(Newtonsoft.Json.JsonConvert.SerializeObject(result)); context.Response.End(); } int subId = 0; if (string.IsNullOrEmpty(context.Request.Form["SubId"]) || !int.TryParse(context.Request.Form["SubId"], out subId)) { result.Message = "子合约序号出错"; context.Response.Write(Newtonsoft.Json.JsonConvert.SerializeObject(result)); context.Response.End(); } string stockAppsStr = context.Request.Form["StockApps"]; string bankName = context.Request.Form["RecBank"]; bool isAudit = false; if (string.IsNullOrEmpty(context.Request.Form["isAudit"]) || !bool.TryParse(context.Request.Form["isAudit"], out isAudit)) { result.Message = "参数错误"; context.Response.Write(Newtonsoft.Json.JsonConvert.SerializeObject(result)); context.Response.End(); } try { System.Web.Script.Serialization.JavaScriptSerializer serializer = new System.Web.Script.Serialization.JavaScriptSerializer(); NFMT.Operate.Model.Apply apply = serializer.Deserialize<NFMT.Operate.Model.Apply>(applyStr); NFMT.Funds.Model.PayApply payApply = serializer.Deserialize<NFMT.Funds.Model.PayApply>(payApplyStr); List<NFMT.Funds.Model.StockPayApply> stockDetails = new List<NFMT.Funds.Model.StockPayApply>(); if(!string.IsNullOrEmpty(stockAppsStr)) stockDetails = serializer.Deserialize<List<NFMT.Funds.Model.StockPayApply>>(stockAppsStr); #region 付款申请单:收款人银行和账号可以手输,并且做保留以便下次可以选择 20150702 MKZC int bankId = 0, bankAccountId = 0; NFMT.Data.BLL.BankAccountBLL bankAccountBLL = new NFMT.Data.BLL.BankAccountBLL(); result = bankAccountBLL.InsertOrUpdateBankAccountInfo(user, bankName, payApply.RecBankAccount, payApply.RecCorpId); if (result.ResultStatus != 0) { context.Response.Write(Newtonsoft.Json.JsonConvert.SerializeObject(result)); context.Response.End(); } string bankInfo = result.ReturnValue.ToString(); if (string.IsNullOrEmpty(bankInfo)) { result.Message = "银行信息获取出错"; context.Response.Write(Newtonsoft.Json.JsonConvert.SerializeObject(result)); context.Response.End(); } bankId = Convert.ToInt32(bankInfo.Split(',')[0]); bankAccountId = Convert.ToInt32(bankInfo.Split(',')[1]); payApply.RecBankId = bankId; payApply.RecBankAccountId = bankAccountId; #endregion NFMT.Funds.BLL.PayApplyBLL bll = new NFMT.Funds.BLL.PayApplyBLL(); result = bll.PayApplyCreate(user, apply, payApply, stockDetails, subId, isAudit); if (result.ResultStatus == 0) { result.Message = "付款申请添加成功"; } } catch (Exception ex) { result.ResultStatus = -1; result.Message = ex.Message; } context.Response.Write(Newtonsoft.Json.JsonConvert.SerializeObject(result)); }
protected void Page_Load(object sender, EventArgs e) { if (!IsPostBack) { Utility.VerificationUtility ver = new Utility.VerificationUtility(); ver.JudgeOperate(this.Page, 52, new List<NFMT.Common.OperateEnum>() { NFMT.Common.OperateEnum.提交审核, NFMT.Common.OperateEnum.作废, NFMT.Common.OperateEnum.撤返, NFMT.Common.OperateEnum.确认完成, NFMT.Common.OperateEnum.确认完成撤销, NFMT.Common.OperateEnum.关闭 }); this.navigation1.Routes.Add("付款申请列表", "PayApplyList.aspx"); this.navigation1.Routes.Add("付款申请查看--关联库存", string.Empty); this.PayMatterStyle = (int)NFMT.Data.StyleEnum.付款事项; this.PayModeStyle = (int)NFMT.Data.StyleEnum.PayMode; int applyId = 0; if (string.IsNullOrEmpty(Request.QueryString["aid"]) || !int.TryParse(Request.QueryString["aid"], out applyId)) applyId = 0; int payApplyId = 0; if (applyId == 0 && (string.IsNullOrEmpty(Request.QueryString["id"]) || !int.TryParse(Request.QueryString["id"], out payApplyId))) Response.Redirect("PayApplyList.aspx"); //验证付款申请是否存在 NFMT.Common.UserModel user = Utility.UserUtility.CurrentUser; NFMT.Funds.BLL.PayApplyBLL bll = new NFMT.Funds.BLL.PayApplyBLL(); NFMT.Common.ResultModel result = new NFMT.Common.ResultModel(); if (applyId > 0) result = bll.GetByApplyId(user, applyId); else result = bll.Get(user, payApplyId); NFMT.Funds.Model.PayApply payApply = result.ReturnValue as NFMT.Funds.Model.PayApply; if (payApply == null || payApply.PayApplyId <= 0) Response.Redirect("PayApplyList.aspx"); this.curPayApply = payApply; //获取主申请 NFMT.Operate.BLL.ApplyBLL applyBLL = new NFMT.Operate.BLL.ApplyBLL(); result = applyBLL.Get(user, payApply.ApplyId); if (result.ResultStatus != 0) Response.Redirect("PayApplyList.aspx"); NFMT.Operate.Model.Apply apply = result.ReturnValue as NFMT.Operate.Model.Apply; if (apply == null || apply.ApplyId <= 0) Response.Redirect("PayApplyList.aspx"); this.curApply = apply; this.SelectJson(payApply.PayApplyId); //审核 System.Web.Script.Serialization.JavaScriptSerializer serializer = new System.Web.Script.Serialization.JavaScriptSerializer(); string json = serializer.Serialize(apply); this.hidModel.Value = json; result = bll.GetAuditInfo(user, payApply.ApplyId, NFMT.Funds.FundsStyleEnum.库存付款申请); if (result.ResultStatus != 0) Response.Redirect("PayApplyList.aspx"); this.txbAuditInfo.InnerHtml = result.ReturnValue.ToString(); } }
public void ProcessRequest(HttpContext context) { int pageIndex = 1, pageSize = 10; string orderStr = string.Empty, whereStr = string.Empty; DateTime fromDate = NFMT.Common.DefaultValue.DefaultTime; DateTime toDate = NFMT.Common.DefaultValue.DefaultTime; int status = 0; if (!string.IsNullOrEmpty(context.Request["s"])) int.TryParse(context.Request["s"], out status); if (!string.IsNullOrEmpty(context.Request.QueryString["fd"])) { if (!DateTime.TryParse(context.Request.QueryString["fd"], out fromDate)) fromDate = NFMT.Common.DefaultValue.DefaultTime; } if (!string.IsNullOrEmpty(context.Request.QueryString["td"])) { toDate = !DateTime.TryParse(context.Request.QueryString["td"], out toDate) ? NFMT.Common.DefaultValue.DefaultTime : toDate.AddDays(1); } int recCorpId = 0; int applyDeptId = 0; if (string.IsNullOrEmpty(context.Request.QueryString["ad"]) || !int.TryParse(context.Request.QueryString["ad"].Trim(), out applyDeptId)) { applyDeptId = 0; } if (string.IsNullOrEmpty(context.Request.QueryString["rc"]) || !int.TryParse(context.Request.QueryString["rc"].Trim(), out recCorpId)) { recCorpId = 0; } if (!string.IsNullOrEmpty(context.Request.QueryString["pagenum"])) int.TryParse(context.Request.QueryString["pagenum"], out pageIndex); pageIndex++; if (!string.IsNullOrEmpty(context.Request.QueryString["pagesize"])) int.TryParse(context.Request.QueryString["pagesize"], out pageSize); if (!string.IsNullOrEmpty(context.Request.QueryString["sortdatafield"]) && !string.IsNullOrEmpty(context.Request.QueryString["sortorder"])) { string sortDataField = context.Request.QueryString["sortdatafield"].Trim(); string sortOrder = context.Request.QueryString["sortorder"].Trim(); switch (sortDataField) { case "ApplyTime": sortDataField = "app.ApplyTime"; break; case "ApplyNo": sortDataField = "app.ApplyNo"; break; case "PayMatterName": sortDataField = "pa.PayMatter"; break; case "PayModeName": sortDataField = "pa.PayMode"; break; case "RecCorpName": sortDataField = "recCor.CorpName "; break; case "ApplyBala": sortDataField = "pa.ApplyBala"; break; case "Name": sortDataField = "emp.Name"; break; case "DeptName": sortDataField = "dep.DeptName"; break; case "StatusName": sortDataField = "app.ApplyStatus"; break; } orderStr = string.Format("{0} {1}", sortDataField, sortOrder); } NFMT.Common.UserModel user = Utility.UserUtility.CurrentUser; NFMT.Funds.BLL.PayApplyBLL bll = new NFMT.Funds.BLL.PayApplyBLL(); NFMT.Common.SelectModel select = bll.GetSelectModel(pageIndex, pageSize, orderStr, fromDate, toDate, status, applyDeptId, recCorpId); NFMT.Authority.CorpAuth auth = new NFMT.Authority.CorpAuth(); auth.AuthColumnNames.Add("app.ApplyCorp"); NFMT.Common.ResultModel result = bll.Load(user, select,auth); context.Response.ContentType = "text/plain"; if (result.ResultStatus != 0) { context.Response.Write(result.Message); context.Response.End(); } int totalRows = result.AffectCount; System.Data.DataTable dt = result.ReturnValue as System.Data.DataTable; Dictionary<string, object> dic = new Dictionary<string, object>(); dic.Add("count", totalRows); dic.Add("data", dt); string postData = Newtonsoft.Json.JsonConvert.SerializeObject(dic, new Newtonsoft.Json.Converters.DataTableConverter()); context.Response.Write(postData); }
public void ProcessRequest(HttpContext context) { NFMT.Common.UserModel user = Utility.UserUtility.CurrentUser; context.Response.ContentType = "text/plain"; int id = 0; int operateId = 0; if (!int.TryParse(context.Request.Form["id"], out id) || id <= 0) { context.Response.Write("序号错误"); context.Response.End(); } if (!int.TryParse(context.Request.Form["oi"], out operateId) || operateId <= 0) { context.Response.Write("操作错误"); context.Response.End(); } NFMT.Contract.BLL.ContractSubBLL subBLL = new NFMT.Contract.BLL.ContractSubBLL(); NFMT.Common.OperateEnum operateEnum = (NFMT.Common.OperateEnum)operateId; NFMT.Common.ResultModel result = new NFMT.Common.ResultModel(); switch (operateEnum) { case NFMT.Common.OperateEnum.作废: result = subBLL.Invalid(user, id); break; case NFMT.Common.OperateEnum.撤返: result = subBLL.GoBack(user, id); break; case NFMT.Common.OperateEnum.执行完成: //1:验证付款申请是否全部完成 NFMT.Funds.BLL.PayApplyBLL payApplyBLL = new NFMT.Funds.BLL.PayApplyBLL(); result = payApplyBLL.CheckContractSubPayApplyConfirm(user, id); if (result.ResultStatus != 0) break; //2:验证收款登记是否全部完成 NFMT.Funds.BLL.CashInBLL cashInBLL = new NFMT.Funds.BLL.CashInBLL(); result = cashInBLL.CheckContractSubCashInConfirm(user, id); if (result.ResultStatus != 0) break; //3:验证入库登记是否全部完成 NFMT.WareHouse.BLL.StockInBLL stockInBLL = new NFMT.WareHouse.BLL.StockInBLL(); result = stockInBLL.CheckContractSubStockInConfirm(user, id); if (result.ResultStatus != 0) break; //4:验证出库申请是否全部完成 NFMT.WareHouse.BLL.StockOutApplyBLL stockOutApplyBLL = new NFMT.WareHouse.BLL.StockOutApplyBLL(); result = stockOutApplyBLL.CheckContractSubStockOutApplyConfirm(user, id); if (result.ResultStatus != 0) break; //5:验证临票是否全部完成 //6:验证直接终票是否全部完成 //7:验证补零终票是否全部完成 NFMT.Invoice.BLL.BusinessInvoiceBLL businessInvoiceBLL = new NFMT.Invoice.BLL.BusinessInvoiceBLL(); result = businessInvoiceBLL.CheckContractSubBusinessInvoiceApplyConfirm(user, id); if (result.ResultStatus != 0) break; //8:点价合约验证点价是否全部完成 NFMT.DoPrice.BLL.PricingApplyBLL pricingApplyBLL = new NFMT.DoPrice.BLL.PricingApplyBLL(); result = pricingApplyBLL.CheckContractSubPricingApplyConfirm(user, id); if (result.ResultStatus != 0) break; result = subBLL.Complete(user, id); break; case NFMT.Common.OperateEnum.执行完成撤销: result = subBLL.CompleteCancel(user, id); break; } if (result.ResultStatus == 0) result.Message = string.Format("{0}成功", operateEnum.ToString()); context.Response.Write(result.Message); }
protected void Page_Load(object sender, EventArgs e) { if (!IsPostBack) { Utility.VerificationUtility ver = new Utility.VerificationUtility(); ver.JudgeOperate(this.Page, 52, new List<NFMT.Common.OperateEnum>() { NFMT.Common.OperateEnum.提交审核, NFMT.Common.OperateEnum.作废, NFMT.Common.OperateEnum.撤返, NFMT.Common.OperateEnum.确认完成, NFMT.Common.OperateEnum.确认完成撤销,NFMT.Common.OperateEnum.关闭 }); string redirectUrl = "PayApplyList.aspx"; this.navigation1.Routes.Add("付款申请列表", redirectUrl); this.navigation1.Routes.Add("付款申请明细--关联发票", string.Empty); this.PayMatterStyle = (int)NFMT.Data.StyleEnum.付款事项; this.PayModeStyle = (int)NFMT.Data.StyleEnum.PayMode; NFMT.Common.UserModel user = Utility.UserUtility.CurrentUser; int applyId = 0; if (string.IsNullOrEmpty(Request.QueryString["aid"]) || !int.TryParse(Request.QueryString["aid"], out applyId)) applyId = 0; int payApplyId = 0; if (applyId == 0 && (string.IsNullOrEmpty(Request.QueryString["id"]) || !int.TryParse(Request.QueryString["id"], out payApplyId))) Response.Redirect(redirectUrl); //获取付款申请 NFMT.Funds.BLL.PayApplyBLL payApplyBLL = new NFMT.Funds.BLL.PayApplyBLL(); NFMT.Common.ResultModel result = new NFMT.Common.ResultModel(); if (applyId > 0) result = payApplyBLL.GetByApplyId(user, applyId); else result = payApplyBLL.Get(user, payApplyId); if (result.ResultStatus != 0) Response.Redirect(redirectUrl); this.curPayApply = result.ReturnValue as NFMT.Funds.Model.PayApply; if (this.curPayApply == null || this.curPayApply.PayApplyId <= 0) Response.Redirect(redirectUrl); //获取主申请 NFMT.Operate.BLL.ApplyBLL applyBLL = new NFMT.Operate.BLL.ApplyBLL(); result = applyBLL.Get(user, this.curPayApply.ApplyId); if (result.ResultStatus != 0) Response.Redirect(redirectUrl); this.curApply = result.ReturnValue as NFMT.Operate.Model.Apply; if (this.curApply == null || this.curApply.ApplyId <= 0) Response.Redirect(redirectUrl); NFMT.Common.SelectModel select = payApplyBLL.GetInvoiceListByApplySelect(1, 100, "si.SIId desc", this.curPayApply.PayApplyId); result = payApplyBLL.Load(user, select,new NFMT.Common.BasicAuth()); int totalRows = result.AffectCount; System.Data.DataTable dt = result.ReturnValue as System.Data.DataTable; this.JsonStr = Newtonsoft.Json.JsonConvert.SerializeObject(dt, new Newtonsoft.Json.Converters.DataTableConverter()); //审核 System.Web.Script.Serialization.JavaScriptSerializer serializer = new System.Web.Script.Serialization.JavaScriptSerializer(); string json = serializer.Serialize(this.curApply); this.hidModel.Value = json; } }
public void ProcessRequest(HttpContext context) { int pageIndex = 1, pageSize = 10; string orderStr = string.Empty, whereStr = string.Empty; if (!string.IsNullOrEmpty(context.Request.QueryString["pagenum"])) int.TryParse(context.Request.QueryString["pagenum"], out pageIndex); pageIndex++; if (!string.IsNullOrEmpty(context.Request.QueryString["pagesize"])) int.TryParse(context.Request.QueryString["pagesize"], out pageSize); if (!string.IsNullOrEmpty(context.Request.QueryString["sortdatafield"]) && !string.IsNullOrEmpty(context.Request.QueryString["sortorder"])) { string sortDataField = context.Request.QueryString["sortdatafield"].Trim(); string sortOrder = context.Request.QueryString["sortorder"].Trim(); switch (sortDataField) { case "InvoiceId": sortDataField = "inv.InvoiceId"; break; case "SIId": sortDataField = "si.SIId"; break; case "InvoiceDate": sortDataField = "inv.InvoiceDate"; break; case "InvoiceNo": sortDataField = "inv.InvoiceNo"; break; case "OutCorpName": sortDataField = "inv.OutCorpName "; break; case "InCorpName": sortDataField = "inv.InCorpName"; break; case "InvoiceBala": sortDataField = "inv.InvoiceBala"; break; case "CurrencyName": sortDataField = "cur.CurrencyName"; break; case "LastBala": sortDataField = "ISNULL(inv.InvoiceBala,0) - ISNULL(ipar.SumBala,0)"; break; case "DeptName": sortDataField = "dept.DeptName"; break; } orderStr = string.Format("{0} {1}", sortDataField, sortOrder); } string ids = context.Request.QueryString["ids"]; string refIds = context.Request.QueryString["refIds"]; NFMT.Common.UserModel user = Utility.UserUtility.CurrentUser; NFMT.Funds.BLL.PayApplyBLL bll = new NFMT.Funds.BLL.PayApplyBLL(); NFMT.Common.SelectModel select = bll.GetInvoiceListSelect(pageIndex, pageSize, orderStr,ids,refIds); NFMT.Authority.CorpAuth auth = new NFMT.Authority.CorpAuth(); auth.AuthColumnNames.Add("inv.InCorpId"); NFMT.Common.ResultModel result = bll.Load(user, select,auth); context.Response.ContentType = "text/plain"; if (result.ResultStatus != 0) { context.Response.Write(result.Message); context.Response.End(); } int totalRows = result.AffectCount; System.Data.DataTable dt = result.ReturnValue as System.Data.DataTable; Dictionary<string, object> dic = new Dictionary<string, object>(); dic.Add("count", totalRows); dic.Add("data", dt); string postData = Newtonsoft.Json.JsonConvert.SerializeObject(dic, new Newtonsoft.Json.Converters.DataTableConverter()); context.Response.Write(postData); }
protected void Page_Load(object sender, EventArgs e) { if (!IsPostBack) { Utility.VerificationUtility ver = new Utility.VerificationUtility(); ver.JudgeOperate(this.Page, 53, new List<NFMT.Common.OperateEnum>() { NFMT.Common.OperateEnum.录入 }); this.navigation1.Routes.Add("财务付款列表", "PaymentList.aspx"); this.navigation1.Routes.Add("付款申请列表", "PaymentPayApplyList.aspx"); this.navigation1.Routes.Add("财务付款新增--合约关联", string.Empty); NFMT.Common.UserModel user = Utility.UserUtility.CurrentUser; string redirectUrl = "PaymentList.aspx"; //获取付款申请 int payApplyId = 0; if (string.IsNullOrEmpty(Request.QueryString["id"]) || !int.TryParse(Request.QueryString["id"], out payApplyId)) Response.Redirect(redirectUrl); NFMT.Funds.BLL.PayApplyBLL payApplyBLL = new NFMT.Funds.BLL.PayApplyBLL(); NFMT.Common.ResultModel result = payApplyBLL.Get(user, payApplyId); if (result.ResultStatus != 0) Response.Redirect(redirectUrl); NFMT.Funds.Model.PayApply payApply = result.ReturnValue as NFMT.Funds.Model.PayApply; if (payApply == null || payApply.PayApplyId <= 0) Response.Redirect(redirectUrl); this.curPayApply = payApply; //获取合约关联付款申请信息 NFMT.Funds.BLL.ContractPayApplyBLL contractPayApplyBLL = new NFMT.Funds.BLL.ContractPayApplyBLL(); result = contractPayApplyBLL.GetByPayApplyId(user, payApply.PayApplyId); if (result.ResultStatus != 0) Response.Redirect(redirectUrl); NFMT.Funds.Model.ContractPayApply contractPayApply = result.ReturnValue as NFMT.Funds.Model.ContractPayApply; if (contractPayApply == null || contractPayApply.RefId <= 0) Response.Redirect(redirectUrl); this.curContractPayApply = contractPayApply; //获取主申请 NFMT.Operate.BLL.ApplyBLL applyBLL = new NFMT.Operate.BLL.ApplyBLL(); result = applyBLL.Get(user, payApply.ApplyId); if (result.ResultStatus != 0) Response.Redirect(redirectUrl); NFMT.Operate.Model.Apply apply = result.ReturnValue as NFMT.Operate.Model.Apply; if (apply == null || apply.ApplyId <= 0) Response.Redirect(redirectUrl); this.curApply = apply; //子合约 NFMT.Contract.BLL.ContractSubBLL subBll = new NFMT.Contract.BLL.ContractSubBLL(); result = subBll.Get(user, contractPayApply.ContractSubId); if (result.ResultStatus != 0) Response.Redirect(redirectUrl); NFMT.Contract.Model.ContractSub sub = result.ReturnValue as NFMT.Contract.Model.ContractSub; if (sub == null || sub.ContractId == 0) Response.Redirect(redirectUrl); //合约 NFMT.Contract.BLL.ContractBLL bll = new NFMT.Contract.BLL.ContractBLL(); result = bll.Get(user, sub.ContractId); if (result.ResultStatus != 0) Response.Redirect(redirectUrl); NFMT.Contract.Model.Contract contract = result.ReturnValue as NFMT.Contract.Model.Contract; if (contract == null || contract.ContractId == 0) Response.Redirect(redirectUrl); this.contractExpander1.CurContract = contract; this.contractExpander1.CurContractSub = sub; this.contractExpander1.RedirectUrl = redirectUrl; //付款申请信息 this.spnApplyDate.InnerHtml = apply.ApplyTime.ToShortDateString(); NFMT.User.Model.Department applyDept = NFMT.User.UserProvider.Departments.SingleOrDefault(temp => temp.DeptId == apply.ApplyDept); if (applyDept != null && applyDept.DeptId > 0) this.spnApplyDept.InnerHtml = applyDept.DeptName; NFMT.User.Model.Corporation recCorp = NFMT.User.UserProvider.Corporations.SingleOrDefault(temp => temp.CorpId == payApply.RecCorpId); if (recCorp != null && recCorp.CorpId > 0) { this.spnRecCorp.InnerHtml = recCorp.CorpName; this.spnRecCorpFullName.InnerHtml = recCorp.CorpFullName; } NFMT.Data.Model.Bank recBank = NFMT.Data.BasicDataProvider.Banks.SingleOrDefault(temp => temp.BankId == payApply.RecBankId); if (recBank != null && recBank.BankId > 0) this.spnBank.InnerHtml = recBank.BankName; this.spnBankAccount.InnerHtml = payApply.RecBankAccount; this.spnApplyBala.InnerHtml = payApply.ApplyBala.ToString(); NFMT.Data.Model.Currency cur = NFMT.Data.BasicDataProvider.Currencies.SingleOrDefault(temp => temp.CurrencyId == payApply.CurrencyId); if (cur != null && cur.CurrencyId > 0) this.spnCurrency.InnerHtml = cur.CurrencyName; this.spnPayDeadline.InnerHtml = payApply.PayDeadline.ToShortDateString(); NFMT.Data.Model.BDStyleDetail payMatter = NFMT.Data.DetailProvider.Details(NFMT.Data.StyleEnum.付款事项)[payApply.PayMatter]; if (payMatter != null && payMatter.StyleDetailId > 0) this.spnPayMatter.InnerHtml = payMatter.DetailName; NFMT.Data.Model.BDStyleDetail payMode = NFMT.Data.DetailProvider.Details(NFMT.Data.StyleEnum.付款方式)[payApply.PayMode]; if (payMode != null && payMode.StyleDetailId > 0) this.spnPayMode.InnerHtml = payMode.DetailName; this.spnMemo.InnerHtml = apply.ApplyDesc; this.spnSpecialDesc.InnerHtml = payApply.SpecialDesc; this.PayMatterStyle = (int)NFMT.Data.StyleEnum.付款事项; this.PayModeStyle = (int)NFMT.Data.StyleEnum.PayMode; } }
protected void Page_Load(object sender, EventArgs e) { if (!IsPostBack) { Utility.VerificationUtility ver = new Utility.VerificationUtility(); ver.JudgeOperate(this.Page, 123, new List<NFMT.Common.OperateEnum>() { NFMT.Common.OperateEnum.修改 }); string redirectUrl = "PayContractAllotToStockList.aspx"; this.navigation1.Routes.Add("合约付款分配至库存列表", redirectUrl); this.navigation1.Routes.Add("合约付款分配至库存修改", string.Empty); NFMT.Common.ResultModel result = new NFMT.Common.ResultModel(); NFMT.Common.UserModel user = Utility.UserUtility.CurrentUser; int detailId = 0; if (string.IsNullOrEmpty(Request.QueryString["id"]) || !int.TryParse(Request.QueryString["id"], out detailId) || detailId <= 0) this.Page.WarmAlert("参数错误", redirectUrl); //获取合约付款分配至库存 NFMT.Funds.BLL.PaymentStockDetailBLL paymentStockDetailBLL = new NFMT.Funds.BLL.PaymentStockDetailBLL(); result = paymentStockDetailBLL.Get(user, detailId); if (result.ResultStatus != 0) this.Page.WarmAlert(result.Message, redirectUrl); paymentStockDetail = result.ReturnValue as NFMT.Funds.Model.PaymentStockDetail; if (paymentStockDetail == null) this.Page.WarmAlert("获取合约付款分配至库存失败", redirectUrl); //获取库存 NFMT.WareHouse.BLL.StockBLL stockBLL = new NFMT.WareHouse.BLL.StockBLL(); result = stockBLL.Get(user, paymentStockDetail.StockId); if (result.ResultStatus != 0) this.Page.WarmAlert(result.Message, redirectUrl); NFMT.WareHouse.Model.Stock stock = result.ReturnValue as NFMT.WareHouse.Model.Stock; if (stock == null) this.Page.WarmAlert("获取库存失败", redirectUrl); //获取业务单号 NFMT.WareHouse.BLL.StockNameBLL stockNameBLL = new NFMT.WareHouse.BLL.StockNameBLL(); result = stockNameBLL.Get(user, stock.StockNameId); if (result.ResultStatus != 0) this.Page.WarmAlert(result.Message, redirectUrl); stockName = result.ReturnValue as NFMT.WareHouse.Model.StockName; if (stockName == null) this.Page.WarmAlert("获取业务单号失败", redirectUrl); //获取付款 int paymentId = paymentStockDetail.PaymentId; NFMT.Funds.BLL.PaymentBLL paymentBLL = new NFMT.Funds.BLL.PaymentBLL(); result = paymentBLL.Get(user, paymentId); if (result.ResultStatus != 0) this.Page.WarmAlert(result.Message, redirectUrl); curPayment = result.ReturnValue as NFMT.Funds.Model.Payment; if (curPayment == null) this.Page.WarmAlert("获取付款失败", redirectUrl); //获取虚拟付款 if (curPayment.VirtualBala > 0) { NFMT.Funds.BLL.PaymentVirtualBLL paymentVirtualBLL = new NFMT.Funds.BLL.PaymentVirtualBLL(); result = paymentVirtualBLL.GetByPaymentId(user, curPayment.PaymentId); if (result.ResultStatus != 0) Response.Redirect(redirectUrl); NFMT.Funds.Model.PaymentVirtual paymentVirtual = result.ReturnValue as NFMT.Funds.Model.PaymentVirtual; if (paymentVirtual == null) Response.Redirect(redirectUrl); this.curPaymentVirtual = paymentVirtual; } //获取付款申请 NFMT.Funds.BLL.PayApplyBLL payApplyBLL = new NFMT.Funds.BLL.PayApplyBLL(); result = payApplyBLL.Get(user, curPayment.PayApplyId); if (result.ResultStatus != 0) this.Page.WarmAlert(result.Message, redirectUrl); curPayApply = result.ReturnValue as NFMT.Funds.Model.PayApply; if (curPayApply == null) this.Page.WarmAlert("获取付款申请失败", redirectUrl); //获取合约款 NFMT.Funds.BLL.PaymentContractDetailBLL paymentContractDetailBLL = new NFMT.Funds.BLL.PaymentContractDetailBLL(); result = paymentContractDetailBLL.GetByPaymentId(user, paymentId); if (result.ResultStatus != 0) this.Page.WarmAlert(result.Message, redirectUrl); paymentContractDetail = result.ReturnValue as NFMT.Funds.Model.PaymentContractDetail; if (paymentContractDetail == null) this.Page.WarmAlert("获取合约款失败", redirectUrl); //获取子合约 NFMT.Contract.BLL.ContractSubBLL contractSubBLL = new NFMT.Contract.BLL.ContractSubBLL(); result = contractSubBLL.Get(user, paymentContractDetail.ContractSubId); if (result.ResultStatus != 0) this.Page.WarmAlert(result.Message, redirectUrl); curSub = result.ReturnValue as NFMT.Contract.Model.ContractSub; if (curSub == null) this.Page.WarmAlert("获取子合约失败", redirectUrl); //合约 NFMT.Contract.BLL.ContractBLL bll = new NFMT.Contract.BLL.ContractBLL(); result = bll.Get(user, curSub.ContractId); if (result.ResultStatus != 0) this.Page.WarmAlert(result.Message, redirectUrl); NFMT.Contract.Model.Contract contract = result.ReturnValue as NFMT.Contract.Model.Contract; if (contract == null || contract.ContractId == 0) this.Page.WarmAlert("获取合约失败", redirectUrl); //获取可分配款 result = paymentStockDetailBLL.LoadByPaymentId(user, paymentId); if (result.ResultStatus != 0) this.Page.WarmAlert(result.Message, redirectUrl); List<NFMT.Funds.Model.PaymentStockDetail> paymentStockDetails = result.ReturnValue as List<NFMT.Funds.Model.PaymentStockDetail>; if (paymentStockDetails == null || !paymentStockDetails.Any()) this.Page.WarmAlert("获取库存财务付款明细失败", redirectUrl); canAllotBala = curPayment.PayBala - paymentStockDetails.Sum(a => a.PayBala) + paymentStockDetail.PayBala; this.contractExpander1.CurContract = contract; this.contractExpander1.CurContractSub = curSub; this.contractExpander1.RedirectUrl = redirectUrl; this.PayMatterStyle = (int)NFMT.Data.StyleEnum.付款事项; this.PayModeStyle = (int)NFMT.Data.StyleEnum.PayMode; } }
public void ProcessRequest(HttpContext context) { context.Response.ContentType = "text/plain"; NFMT.Common.UserModel user = Utility.UserUtility.CurrentUser; NFMT.Common.ResultModel result = new NFMT.Common.ResultModel(); string payApplyStr = context.Request.Form["PayApply"]; if (string.IsNullOrEmpty(payApplyStr)) { result.Message = "付款申请不能为空"; context.Response.Write(Newtonsoft.Json.JsonConvert.SerializeObject(result)); context.Response.End(); } string memo = context.Request.Form["memo"]; int deptId = 0; int corpId = 0; if (string.IsNullOrEmpty(context.Request.Form["deptId"]) || !int.TryParse(context.Request.Form["deptId"], out deptId)) { result.Message = "未选择申请部门"; context.Response.Write(Newtonsoft.Json.JsonConvert.SerializeObject(result)); context.Response.End(); } if (string.IsNullOrEmpty(context.Request.Form["corpId"]) || !int.TryParse(context.Request.Form["corpId"], out corpId)) { result.Message = "未选择申请公司"; context.Response.Write(Newtonsoft.Json.JsonConvert.SerializeObject(result)); context.Response.End(); } string stockStr = context.Request.Form["Stocks"]; try { System.Web.Script.Serialization.JavaScriptSerializer serializer = new System.Web.Script.Serialization.JavaScriptSerializer(); NFMT.Funds.Model.PayApply payApply = serializer.Deserialize<NFMT.Funds.Model.PayApply>(payApplyStr); char[] splitStr = new char[1]; splitStr[0] = '|'; List<NFMT.Funds.Model.StockPayApply> stockPayApplies = new List<NFMT.Funds.Model.StockPayApply>(); string[] strs = stockStr.Split(splitStr, StringSplitOptions.RemoveEmptyEntries); foreach (string s in strs) { var obj = serializer.Deserialize<NFMT.Funds.Model.StockPayApply>(s); obj.PayApplyId = payApply.PayApplyId; stockPayApplies.Add(obj); } decimal sumBala = stockPayApplies.Sum(temp => temp.ApplyBala); if (sumBala != payApply.ApplyBala) { result.Message = "付款申请总计与分项合计金额不相等"; context.Response.Write(Newtonsoft.Json.JsonConvert.SerializeObject(result)); context.Response.End(); } NFMT.Funds.BLL.PayApplyBLL bll = new NFMT.Funds.BLL.PayApplyBLL(); result = bll.PayApplyStockUpdate(user, payApply, stockPayApplies, memo, deptId,corpId); if (result.ResultStatus == 0) { result.Message = "付款申请修改成功"; } } catch (Exception ex) { result.ResultStatus = -1; result.Message = ex.Message; } context.Response.Write(Newtonsoft.Json.JsonConvert.SerializeObject(result)); }
protected void Page_Load(object sender, EventArgs e) { Utility.VerificationUtility ver = new Utility.VerificationUtility(); ver.JudgeOperate(this.Page, 52, new List<NFMT.Common.OperateEnum>() { NFMT.Common.OperateEnum.修改 }); if (!IsPostBack) { NFMT.Common.UserModel user = Utility.UserUtility.CurrentUser; this.curUser = user; this.PayMatterStyle = (int)NFMT.Data.StyleEnum.付款事项; this.PayModeStyle = (int)NFMT.Data.StyleEnum.PayMode; string redirectUrl = "PayApplyList.aspx"; this.navigation1.Routes.Add("付款申请列表", redirectUrl); this.navigation1.Routes.Add("付款申请修改", string.Empty); int applyId = 0 , payApplyId = 0; if (string.IsNullOrEmpty(Request.QueryString["aid"])) int.TryParse(Request.QueryString["aid"], out applyId); if (applyId<=0 && (string.IsNullOrEmpty(Request.QueryString["id"]) || !int.TryParse(Request.QueryString["id"], out payApplyId))) Response.Redirect(redirectUrl); NFMT.Common.ResultModel result = new NFMT.Common.ResultModel(); //获取出库申请 NFMT.Funds.BLL.PayApplyBLL payApplyBLL = new NFMT.Funds.BLL.PayApplyBLL(); if (applyId > 0) result = payApplyBLL.GetByApplyId(user, applyId); else result = payApplyBLL.Get(user, payApplyId); if(result.ResultStatus!=0) Response.Redirect(redirectUrl); NFMT.Funds.Model.PayApply payApply = result.ReturnValue as NFMT.Funds.Model.PayApply; if (payApply == null || payApply.PayApplyId <= 0) Response.Redirect(redirectUrl); this.curPayApply = payApply; //获取主申请 NFMT.Operate.BLL.ApplyBLL applyBLL = new NFMT.Operate.BLL.ApplyBLL(); result = applyBLL.Get(user, payApply.ApplyId); if(result.ResultStatus!=0) Response.Redirect(redirectUrl); NFMT.Operate.Model.Apply apply = result.ReturnValue as NFMT.Operate.Model.Apply; if(apply == null || apply.ApplyId<=0) Response.Redirect(redirectUrl); this.curApply = apply; //获取合约付款申请 NFMT.Funds.BLL.ContractPayApplyBLL contractPayApplyBLL = new NFMT.Funds.BLL.ContractPayApplyBLL(); result = contractPayApplyBLL.GetByPayApplyId(user, payApply.PayApplyId); if(result.ResultStatus!=0) Response.Redirect(redirectUrl); NFMT.Funds.Model.ContractPayApply contractPayApply = result.ReturnValue as NFMT.Funds.Model.ContractPayApply; if(contractPayApply == null || contractPayApply.RefId<=0) Response.Redirect(redirectUrl); //获取子合约 NFMT.Contract.BLL.ContractSubBLL subBll = new NFMT.Contract.BLL.ContractSubBLL(); result = subBll.Get(user, contractPayApply.ContractSubId); if (result.ResultStatus != 0) Response.Redirect(redirectUrl); NFMT.Contract.Model.ContractSub sub = result.ReturnValue as NFMT.Contract.Model.ContractSub; if (sub == null || sub.ContractId == 0) Response.Redirect(redirectUrl); this.curSub = sub; //合约 NFMT.Contract.BLL.ContractBLL bll = new NFMT.Contract.BLL.ContractBLL(); result = bll.Get(user, sub.ContractId); if (result.ResultStatus != 0) Response.Redirect(redirectUrl); NFMT.Contract.Model.Contract contract = result.ReturnValue as NFMT.Contract.Model.Contract; if (contract == null || contract.ContractId == 0) Response.Redirect(redirectUrl); this.contractExpander1.CurContract = contract; this.contractExpander1.CurContractSub = sub; this.contractExpander1.RedirectUrl = redirectUrl; NFMT.Common.SelectModel select = payApplyBLL.GetPayApplyStocksSelect(1, 100, "spa.RefId desc", payApply.PayApplyId); result = payApplyBLL.Load(user, select,new NFMT.Common.BasicAuth()); if (result.ResultStatus != 0) Response.Redirect(redirectUrl); System.Data.DataTable dt = result.ReturnValue as System.Data.DataTable; if (dt == null) Response.Redirect(redirectUrl); this.StockDetailsJson = Newtonsoft.Json.JsonConvert.SerializeObject(dt, new Newtonsoft.Json.Converters.DataTableConverter()); result = payApplyBLL.GetContractBalancePayment(user, sub.SubId, 0); if (result.ResultStatus != 0) Response.Redirect(redirectUrl); BalancePaymentValue = (decimal)result.ReturnValue; } }
public void ProcessRequest(HttpContext context) { int pageIndex = 1, pageSize = 10; string orderStr = string.Empty, whereStr = string.Empty; string subNo = context.Request.QueryString["sn"]; DateTime fromDate = NFMT.Common.DefaultValue.DefaultTime; DateTime toDate = NFMT.Common.DefaultValue.DefaultTime; int outCorpId = 0; if (!string.IsNullOrEmpty(context.Request.QueryString["oci"])) { if (!int.TryParse(context.Request.QueryString["oci"], out outCorpId)) outCorpId = 0; } if (!string.IsNullOrEmpty(context.Request.QueryString["fd"])) { if (!DateTime.TryParse(context.Request.QueryString["fd"], out fromDate)) fromDate = NFMT.Common.DefaultValue.DefaultTime; } if (!string.IsNullOrEmpty(context.Request.QueryString["td"])) { if (!DateTime.TryParse(context.Request.QueryString["td"], out toDate)) toDate = NFMT.Common.DefaultValue.DefaultTime; } if (!string.IsNullOrEmpty(context.Request.QueryString["pagenum"])) int.TryParse(context.Request.QueryString["pagenum"], out pageIndex); pageIndex++; if (!string.IsNullOrEmpty(context.Request.QueryString["pagesize"])) int.TryParse(context.Request.QueryString["pagesize"], out pageSize); if (!string.IsNullOrEmpty(context.Request.QueryString["sortdatafield"]) && !string.IsNullOrEmpty(context.Request.QueryString["sortorder"])) { string sortDataField = context.Request.QueryString["sortdatafield"].Trim(); string sortOrder = context.Request.QueryString["sortorder"].Trim(); switch (sortDataField) { case "ContractDate": sortDataField = string.Format("cs.{0}", sortDataField); break; case "ContractNo": sortDataField = string.Format("c.{0}", sortDataField); break; case "SubNo": sortDataField = "cs.SubNo"; break; case "InCorpName": sortDataField = "inccd.CorpName"; break; case "OutCorpName": sortDataField = "outccd.CorpName"; break; case "AssetName": sortDataField = "a.AssetName"; break; case "CurrencyName": sortDataField = "cur.CurrencyName"; break; case "ApplyBala": sortDataField = "pa.ApplyBala"; break; case "AllotWeigth": sortDataField = "soad.SumWeight"; break; case "LaveWeight": sortDataField = "(cs.SignAmount -isnull(soad.SumWeight,0))"; break; case "StatusName": sortDataField = "sd.StatusName"; break; } orderStr = string.Format("{0} {1}", sortDataField, sortOrder); } NFMT.Common.UserModel user = Utility.UserUtility.CurrentUser; NFMT.Funds.BLL.PayApplyBLL bll = new NFMT.Funds.BLL.PayApplyBLL(); NFMT.Common.SelectModel select = bll.GetContractListSelect(pageIndex, pageSize, orderStr, subNo, outCorpId, fromDate, toDate); NFMT.Common.ResultModel result = bll.Load(user, select); context.Response.ContentType = "text/plain"; if (result.ResultStatus != 0) { context.Response.Write(result.Message); context.Response.End(); } int totalRows = result.AffectCount; System.Data.DataTable dt = result.ReturnValue as System.Data.DataTable; Dictionary<string, object> dic = new Dictionary<string, object>(); dic.Add("count", totalRows); dic.Add("data", dt); string postData = Newtonsoft.Json.JsonConvert.SerializeObject(dic, new Newtonsoft.Json.Converters.DataTableConverter()); context.Response.Write(postData); }
protected void Page_Load(object sender, EventArgs e) { if (!IsPostBack) { Utility.VerificationUtility ver = new Utility.VerificationUtility(); ver.JudgeOperate(this.Page, 53, new List<NFMT.Common.OperateEnum>() { NFMT.Common.OperateEnum.提交审核, NFMT.Common.OperateEnum.作废, NFMT.Common.OperateEnum.撤返, NFMT.Common.OperateEnum.执行完成, NFMT.Common.OperateEnum.执行完成撤销 }); this.navigation1.Routes.Add("财务付款列表", "PaymentList.aspx"); this.navigation1.Routes.Add("财务付款修改--库存关联", string.Empty); NFMT.Common.UserModel user = Utility.UserUtility.CurrentUser; NFMT.Common.ResultModel result = new NFMT.Common.ResultModel(); //获取财务付款 int paymentId = 0; if (string.IsNullOrEmpty(Request.QueryString["id"]) || !int.TryParse(Request.QueryString["id"], out paymentId)) Response.Redirect("PaymentList.aspx"); NFMT.Funds.BLL.PaymentBLL paymentBLL = new NFMT.Funds.BLL.PaymentBLL(); result = paymentBLL.Get(user, paymentId); if (result.ResultStatus != 0) Response.Redirect("PaymentList.aspx"); NFMT.Funds.Model.Payment payment = result.ReturnValue as NFMT.Funds.Model.Payment; if (payment == null || payment.PaymentId <= 0) Response.Redirect("PaymentList.aspx"); this.curPayment = payment; //获取虚拟付款 if (payment.VirtualBala > 0) { NFMT.Funds.BLL.PaymentVirtualBLL paymentVirtualBLL = new NFMT.Funds.BLL.PaymentVirtualBLL(); result = paymentVirtualBLL.GetByPaymentId(user, payment.PaymentId); if (result.ResultStatus != 0) Response.Redirect("PaymentList.aspx"); NFMT.Funds.Model.PaymentVirtual paymentVirtual = result.ReturnValue as NFMT.Funds.Model.PaymentVirtual; if (paymentVirtual == null) Response.Redirect("PaymentList.aspx"); this.curPaymentVirtual = paymentVirtual; } //获取付款申请 NFMT.Funds.BLL.PayApplyBLL payApplyBLL = new NFMT.Funds.BLL.PayApplyBLL(); result = payApplyBLL.Get(user, payment.PayApplyId); if (result.ResultStatus != 0) Response.Redirect("PaymentList.aspx"); NFMT.Funds.Model.PayApply payApply = result.ReturnValue as NFMT.Funds.Model.PayApply; if (payApply == null || payApply.PayApplyId <= 0) Response.Redirect("PaymentList.aspx"); this.curPayApply = payApply; //获取主申请 NFMT.Operate.BLL.ApplyBLL applyBLL = new NFMT.Operate.BLL.ApplyBLL(); result = applyBLL.Get(user, payApply.ApplyId); if (result.ResultStatus != 0) Response.Redirect("PaymentList.aspx"); NFMT.Operate.Model.Apply apply = result.ReturnValue as NFMT.Operate.Model.Apply; if (apply == null || apply.ApplyId <= 0) Response.Redirect("PaymentList.aspx"); this.curApply = apply; this.SelectJson(payApply.PayApplyId, payment.PaymentId); //付款申请信息 this.spnApplyDate.InnerHtml = apply.ApplyTime.ToShortDateString(); NFMT.User.Model.Department applyDept = NFMT.User.UserProvider.Departments.SingleOrDefault(temp => temp.DeptId == apply.ApplyDept); if (applyDept != null && applyDept.DeptId > 0) this.spnApplyDept.InnerHtml = applyDept.DeptName; NFMT.User.Model.Corporation recCorp = NFMT.User.UserProvider.Corporations.SingleOrDefault(temp => temp.CorpId == payApply.RecCorpId); if (recCorp != null && recCorp.CorpId > 0) { this.spnRecCorp.InnerHtml = recCorp.CorpName; this.spnRecCorpFullName.InnerHtml = recCorp.CorpFullName; } NFMT.Data.Model.Bank recBank = NFMT.Data.BasicDataProvider.Banks.SingleOrDefault(temp => temp.BankId == payApply.RecBankId); if (recBank != null && recBank.BankId > 0) this.spnBank.InnerHtml = recBank.BankName; this.spnBankAccount.InnerHtml = payApply.RecBankAccount; this.spnApplyBala.InnerHtml = payApply.ApplyBala.ToString(); NFMT.Data.Model.Currency cur = NFMT.Data.BasicDataProvider.Currencies.SingleOrDefault(temp => temp.CurrencyId == payApply.CurrencyId); if (cur != null && cur.CurrencyId > 0) this.spnCurrency.InnerHtml = cur.CurrencyName; this.spnPayDeadline.InnerHtml = payApply.PayDeadline.ToShortDateString(); NFMT.Data.Model.BDStyleDetail payMatter = NFMT.Data.DetailProvider.Details(NFMT.Data.StyleEnum.付款事项)[payApply.PayMatter]; if (payMatter != null && payMatter.StyleDetailId > 0) this.spnPayMatter.InnerHtml = payMatter.DetailName; NFMT.Data.Model.BDStyleDetail payMode = NFMT.Data.DetailProvider.Details(NFMT.Data.StyleEnum.付款方式)[payApply.PayMode]; if (payMode != null && payMode.StyleDetailId > 0) this.spnPayMode.InnerHtml = payMode.DetailName; this.spnMemo.InnerHtml = apply.ApplyDesc; this.spnSpecialDesc.InnerHtml = payApply.SpecialDesc; this.PayMatterStyle = (int)NFMT.Data.StyleEnum.付款事项; this.PayModeStyle = (int)NFMT.Data.StyleEnum.PayMode; //审核 System.Web.Script.Serialization.JavaScriptSerializer serializer = new System.Web.Script.Serialization.JavaScriptSerializer(); string json = serializer.Serialize(payment); this.hidModel.Value = json; } }
public void ProcessRequest(HttpContext context) { int pageIndex = 1, pageSize = 10; string orderStr = string.Empty, whereStr = string.Empty; if (!string.IsNullOrEmpty(context.Request.QueryString["pagenum"])) int.TryParse(context.Request.QueryString["pagenum"], out pageIndex); pageIndex++; if (!string.IsNullOrEmpty(context.Request.QueryString["pagesize"])) int.TryParse(context.Request.QueryString["pagesize"], out pageSize); if (!string.IsNullOrEmpty(context.Request.QueryString["sortdatafield"]) && !string.IsNullOrEmpty(context.Request.QueryString["sortorder"])) { string sortDataField = context.Request.QueryString["sortdatafield"].Trim(); string sortOrder = context.Request.QueryString["sortorder"].Trim(); switch (sortDataField) { case "StockDate": sortDataField = "sto.StockDate"; break; case "RefNo": sortDataField = "sn.RefNo"; break; case "StockWeight": sortDataField = "sto.GrossAmount"; break; case "CorpName": sortDataField = "cor.CorpName"; break; case "AssetName": sortDataField = "ass.AssetName "; break; case "BrandName": sortDataField = "bra.BrandName"; break; case "StockStatusName": sortDataField = "sto.StockStatus"; break; } orderStr = string.Format("{0} {1}", sortDataField, sortOrder); } string sids = context.Request.QueryString["sids"]; NFMT.Common.UserModel user = Utility.UserUtility.CurrentUser; NFMT.Funds.BLL.PayApplyBLL bll = new NFMT.Funds.BLL.PayApplyBLL(); NFMT.Common.SelectModel select = bll.GetStockListSelect(pageIndex, pageSize, orderStr,sids); NFMT.Authority.StockAuth auth= new NFMT.Authority.StockAuth(); NFMT.Common.ResultModel result = bll.Load(user, select,auth); context.Response.ContentType = "text/plain"; if (result.ResultStatus != 0) { context.Response.Write(result.Message); context.Response.End(); } int totalRows = result.AffectCount; System.Data.DataTable dt = result.ReturnValue as System.Data.DataTable; Dictionary<string, object> dic = new Dictionary<string, object>(); dic.Add("count", totalRows); dic.Add("data", dt); string postData = Newtonsoft.Json.JsonConvert.SerializeObject(dic, new Newtonsoft.Json.Converters.DataTableConverter()); context.Response.Write(postData); }
protected void Page_Load(object sender, EventArgs e) { if (!IsPostBack) { Utility.VerificationUtility ver = new Utility.VerificationUtility(); ver.JudgeOperate(this.Page, 52, new List<NFMT.Common.OperateEnum>() { NFMT.Common.OperateEnum.修改 }); this.navigation1.Routes.Add("付款申请列表", "PayApplyList.aspx"); this.navigation1.Routes.Add("付款申请修改--合约关联", string.Empty); if (string.IsNullOrEmpty(Request.QueryString["id"]) || !int.TryParse(Request.QueryString["id"], out this.PayApplyId)) Response.Redirect("PayApplyList.aspx"); NFMT.Common.UserModel user = Utility.UserUtility.CurrentUser; //获取付款申请 NFMT.Funds.BLL.PayApplyBLL payApplyBLL = new NFMT.Funds.BLL.PayApplyBLL(); NFMT.Common.ResultModel result = payApplyBLL.Get(user, this.PayApplyId); if(result.ResultStatus!=0) Response.Redirect("PayApplyList.aspx"); NFMT.Funds.Model.PayApply payApply = result.ReturnValue as NFMT.Funds.Model.PayApply; if(payApply==null || payApply.PayApplyId<=0) Response.Redirect("PayApplyList.aspx"); this.curPayApply = payApply; //获取合约关联付款申请信息 NFMT.Funds.BLL.ContractPayApplyBLL contractPayApplyBLL = new NFMT.Funds.BLL.ContractPayApplyBLL(); result = contractPayApplyBLL.GetByPayApplyId(user, payApply.PayApplyId); if(result.ResultStatus!=0) Response.Redirect("PayApplyList.aspx"); NFMT.Funds.Model.ContractPayApply contractPayApply = result.ReturnValue as NFMT.Funds.Model.ContractPayApply; if(contractPayApply == null || contractPayApply.RefId<=0) Response.Redirect("PayApplyList.aspx"); //获取主申请 NFMT.Operate.BLL.ApplyBLL applyBLL = new NFMT.Operate.BLL.ApplyBLL(); result = applyBLL.Get(user, payApply.ApplyId); if(result.ResultStatus!=0) Response.Redirect("PayApplyList.aspx"); NFMT.Operate.Model.Apply apply = result.ReturnValue as NFMT.Operate.Model.Apply; if(apply==null || apply.ApplyId<=0) Response.Redirect("PayApplyList.aspx"); this.curApply = apply; //子合约序号赋值 this.SubContractId = contractPayApply.ContractSubId; //子合约 NFMT.Contract.BLL.ContractSubBLL subBll = new NFMT.Contract.BLL.ContractSubBLL(); result = subBll.Get(user, this.SubContractId); if (result.ResultStatus != 0) Response.Redirect("PayApplyList.aspx"); NFMT.Contract.Model.ContractSub sub = result.ReturnValue as NFMT.Contract.Model.ContractSub; if (sub == null || sub.ContractId == 0) Response.Redirect("PayApplyList.aspx"); //合约 NFMT.Contract.BLL.ContractBLL bll = new NFMT.Contract.BLL.ContractBLL(); result = bll.Get(user, sub.ContractId); if (result.ResultStatus != 0) Response.Redirect("PayApplyList.aspx"); NFMT.Contract.Model.Contract con = result.ReturnValue as NFMT.Contract.Model.Contract; if (con == null || con.ContractId == 0) Response.Redirect("PayApplyList.aspx"); //合约信息 this.spnContractNo.InnerHtml = con.ContractNo; this.spnAsset.InnerHtml = NFMT.Data.BasicDataProvider.Assets.First(temp => temp.AssetId == con.AssetId).AssetName; NFMT.Data.Model.MeasureUnit muContract = NFMT.Data.BasicDataProvider.MeasureUnits.Single(temp => temp.MUId == con.UnitId); this.spnSignAmount.InnerHtml = string.Format("{0}{1}", con.SignAmount.ToString(), muContract.MUName); //合约抬头 NFMT.Contract.BLL.ContractCorporationDetailBLL ccdBll = new NFMT.Contract.BLL.ContractCorporationDetailBLL(); //内部公司 result = ccdBll.LoadCorpListByContractId(user, sub.ContractId, true); List<NFMT.Contract.Model.ContractCorporationDetail> innerCorps = result.ReturnValue as List<NFMT.Contract.Model.ContractCorporationDetail>; foreach (NFMT.Contract.Model.ContractCorporationDetail innerCorp in innerCorps) { this.spnInCorpNames.InnerHtml += string.Format("[{0}] ", innerCorp.CorpName); } //外部公司 result = ccdBll.LoadCorpListByContractId(user, sub.ContractId, false); List<NFMT.Contract.Model.ContractCorporationDetail> outCorps = result.ReturnValue as List<NFMT.Contract.Model.ContractCorporationDetail>; foreach (NFMT.Contract.Model.ContractCorporationDetail outCorp in outCorps) { this.spnOutCorpNames.InnerHtml += string.Format("[{0}] ", outCorp.CorpName); } //子合约信息 this.spnSubNo.InnerHtml = sub.SubNo; NFMT.Data.Model.MeasureUnit muSub = NFMT.Data.BasicDataProvider.MeasureUnits.Single(temp => temp.MUId == sub.UnitId); this.spnSubSignAmount.InnerHtml = string.Format("{0}{1}", sub.SignAmount.ToString(), muSub.MUName); this.spnPeriodE.InnerHtml = sub.ContractPeriodE.ToShortDateString(); //局域变量赋值 this.PayMatterStyle = (int)NFMT.Data.StyleEnum.付款事项; this.PayModeStyle = (int)NFMT.Data.StyleEnum.PayMode; } }
public void ProcessRequest(HttpContext context) { int pageIndex = 1, pageSize = 10; string orderStr = string.Empty, whereStr = string.Empty; DateTime startDate = NFMT.Common.DefaultValue.DefaultTime; DateTime endDate = NFMT.Common.DefaultValue.DefaultTime; if (string.IsNullOrEmpty(context.Request["s"]) || !DateTime.TryParse(context.Request["s"], out startDate)) startDate = NFMT.Common.DefaultValue.DefaultTime; if (string.IsNullOrEmpty(context.Request["e"]) || !DateTime.TryParse(context.Request["e"], out endDate)) endDate = NFMT.Common.DefaultValue.DefaultTime; else endDate = endDate.AddDays(1); int applyCorp = 0; if (string.IsNullOrEmpty(context.Request.QueryString["corp"]) || !int.TryParse(context.Request.QueryString["corp"], out applyCorp)) applyCorp = 0; int applyDept = 0; if (string.IsNullOrEmpty(context.Request.QueryString["dept"]) || !int.TryParse(context.Request.QueryString["dept"], out applyDept)) applyDept = 0; int currency = 0; if (string.IsNullOrEmpty(context.Request.QueryString["cur"]) || !int.TryParse(context.Request.QueryString["cur"], out currency)) currency = 0; if (!string.IsNullOrEmpty(context.Request.QueryString["pagenum"])) int.TryParse(context.Request.QueryString["pagenum"], out pageIndex); pageIndex++; if (!string.IsNullOrEmpty(context.Request.QueryString["pagesize"])) int.TryParse(context.Request.QueryString["pagesize"], out pageSize); if (!string.IsNullOrEmpty(context.Request.QueryString["sortdatafield"]) && !string.IsNullOrEmpty(context.Request.QueryString["sortorder"])) { string sortDataField = context.Request.QueryString["sortdatafield"].Trim(); string sortOrder = context.Request.QueryString["sortorder"].Trim(); switch (sortDataField) { case "PayApplyId": sortDataField = "pa.PayApplyId"; break; case "ApplyTime": sortDataField = "a.ApplyTime"; break; case "ApplyNo": sortDataField = "a.ApplyNo"; break; case "ApplyBala": sortDataField = "pa.ApplyBala"; break; case "CurrencyName": sortDataField = "cur.CurrencyName"; break; case "ApplyCorpName": sortDataField = "corp.CorpName"; break; case "DeptName": sortDataField = "dept.DeptName"; break; case "RecCorpName": sortDataField = "recCorp.CorpName"; break; case "BankName": sortDataField = "bank.BankName"; break; case "RecBankAccount": sortDataField = "pa.RecBankAccount"; break; case "DetailName": sortDataField = "bdPayMode.DetailName"; break; } orderStr = string.Format("{0} {1}", sortDataField, sortOrder); } NFMT.Funds.BLL.PayApplyBLL bll = new NFMT.Funds.BLL.PayApplyBLL(); NFMT.Common.UserModel user = Utility.UserUtility.CurrentUser; NFMT.Common.SelectModel select = bll.GetPayApplyReportSelect(pageIndex, pageSize, orderStr, applyCorp, applyDept, currency, startDate, endDate); NFMT.Common.ResultModel result = bll.Load(user, select, new NFMT.Common.BasicAuth()); context.Response.ContentType = "text/plain"; if (result.ResultStatus != 0) { context.Response.Write(result.Message); context.Response.End(); } int totalRows = result.AffectCount; System.Data.DataTable dt = result.ReturnValue as System.Data.DataTable; Dictionary<string, object> dic = new Dictionary<string, object>(); dic.Add("count", totalRows); dic.Add("data", dt); string postData = Newtonsoft.Json.JsonConvert.SerializeObject(dic, new Newtonsoft.Json.Converters.DataTableConverter()); context.Response.Write(postData); }