public void SelectJson(NFMT.Invoice.Model.BusinessInvoice businessInvoice, NFMT.Contract.Model.ContractSub sub) { int pageIndex = 1, pageSize = 100; string orderStr = string.Empty, whereStr = string.Empty; NFMT.Common.UserModel user = Utility.UserUtility.CurrentUser; NFMT.Common.SelectModel select = new NFMT.Common.SelectModel(); NFMT.Invoice.BLL.BusinessInvoiceBLL bll = new NFMT.Invoice.BLL.BusinessInvoiceBLL(); if(sub.PriceMode == (int)NFMT.Contract.PriceModeEnum.定价) select = bll.GetDirectFinalStocksSelect(pageIndex, pageSize, orderStr, businessInvoice.SubContractId, businessInvoice.BusinessInvoiceId, false, false); else select = bll.GetDirectStocksModel(pageIndex, pageSize, orderStr, sub.SubId, false, businessInvoice.BusinessInvoiceId); NFMT.Common.ResultModel result = bll.Load(user, select, NFMT.Common.DefaultValue.ClearAuth); System.Data.DataTable dt = result.ReturnValue as System.Data.DataTable; this.SubJson = Newtonsoft.Json.JsonConvert.SerializeObject(dt, new Newtonsoft.Json.Converters.DataTableConverter()); if (sub.PriceMode == (int)NFMT.Contract.PriceModeEnum.定价) select = bll.GetDirectFinalStocksSelect(pageIndex, pageSize, orderStr, businessInvoice.SubContractId, businessInvoice.BusinessInvoiceId, false, true); else select = bll.GetDirectStocksModel(pageIndex, pageSize, orderStr, sub.SubId, true, businessInvoice.BusinessInvoiceId); result = bll.Load(user, select, NFMT.Common.DefaultValue.ClearAuth); dt = result.ReturnValue as System.Data.DataTable; this.InvJson = Newtonsoft.Json.JsonConvert.SerializeObject(dt, new Newtonsoft.Json.Converters.DataTableConverter()); }
public void SelectJson(int provisionalInvoiceId, NFMT.Contract.Model.ContractSub sub) { int pageIndex = 1, pageSize = 100; string orderStr = string.Empty, whereStr = string.Empty; NFMT.Common.UserModel user = Utility.UserUtility.CurrentUser; NFMT.Common.SelectModel select = new NFMT.Common.SelectModel(); NFMT.Invoice.BLL.BusinessInvoiceBLL bll = new NFMT.Invoice.BLL.BusinessInvoiceBLL(); select = bll.GetReplaceFinalStocksSelect(pageIndex, pageSize, orderStr, provisionalInvoiceId); NFMT.Common.ResultModel result = bll.Load(user, select, NFMT.Common.DefaultValue.ClearAuth); System.Data.DataTable dt = result.ReturnValue as System.Data.DataTable; decimal sumBala = dt.Select().Sum(temp => Convert.ToDecimal(temp["Bala"])); decimal sumNetAmount = dt.Select().Sum(temp => Convert.ToDecimal(temp["NetAmount"])); if (sumNetAmount == 0) this.WarmAlert("未确认价格,禁止开终票", "InvoiceReplaceFinalList.aspx"); this.netAmount = sumNetAmount; this.invoiceBala = Math.Round(sumBala, 2, MidpointRounding.AwayFromZero); this.AvgPrice = Math.Round(this.invoiceBala / sumNetAmount, 4, MidpointRounding.AwayFromZero); this.SelectedJson = Newtonsoft.Json.JsonConvert.SerializeObject(dt, new Newtonsoft.Json.Converters.DataTableConverter()); }
public void ProcessRequest(HttpContext context) { NFMT.Common.UserModel user = Utility.UserUtility.CurrentUser; int pageIndex = 1, pageSize = 10; string orderStr = string.Empty, whereStr = string.Empty; string rids = context.Request.QueryString["rids"]; string corpName = context.Request.QueryString["corpId"]; string dids = context.Request.QueryString["dids"]; int curId = 0; if (string.IsNullOrEmpty(context.Request.QueryString["curId"]) || !int.TryParse(context.Request.QueryString["curId"], out curId) || curId <= 0) curId = 0; int allotId = 0; if (string.IsNullOrEmpty(context.Request.QueryString["aid"]) || !int.TryParse(context.Request.QueryString["aid"], out allotId) || allotId <= 0) allotId = 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"])) orderStr = string.Format("{0} {1}", context.Request.QueryString["sortdatafield"].Trim(), context.Request.QueryString["sortorder"].Trim()); NFMT.Funds.BLL.ReceivableAllotBLL bll = new NFMT.Funds.BLL.ReceivableAllotBLL(); NFMT.Common.SelectModel select = new NFMT.Common.SelectModel(); select = bll.GetReceivableForCorpSelectModel(pageIndex, pageSize, orderStr, rids, corpName, curId, dids ,allotId); NFMT.Common.ResultModel result = bll.Load(user, select); context.Response.ContentType = "application/json; charset=utf-8"; if (result.ResultStatus != 0) { context.Response.Write(result.Message); context.Response.End(); } System.Data.DataTable dt = result.ReturnValue as System.Data.DataTable; System.Collections.Generic.Dictionary<string, object> dic = new System.Collections.Generic.Dictionary<string, object>(); dic.Add("count", result.AffectCount); dic.Add("data", dt); string postData = Newtonsoft.Json.JsonConvert.SerializeObject(dic); context.Response.Write(postData); }
public void SelectJson(NFMT.Invoice.Model.BusinessInvoice businessInvoice, NFMT.Invoice.InvoiceDirectionEnum direction) { int pageIndex = 1, pageSize = 100; string orderStr = string.Empty, whereStr = string.Empty; NFMT.Common.UserModel user = Utility.UserUtility.CurrentUser; NFMT.Common.SelectModel select = new NFMT.Common.SelectModel(); NFMT.Invoice.BLL.BusinessInvoiceBLL bll = new NFMT.Invoice.BLL.BusinessInvoiceBLL(); select = bll.GetDirectFinalContractStockListSelect(pageIndex, pageSize, orderStr, businessInvoice.SubContractId, businessInvoice.BusinessInvoiceId,true,true); NFMT.Common.ResultModel result = bll.Load(user, select,NFMT.Common.DefaultValue.ClearAuth); System.Data.DataTable dt = result.ReturnValue as System.Data.DataTable; this.SelectedJson = Newtonsoft.Json.JsonConvert.SerializeObject(dt, new Newtonsoft.Json.Converters.DataTableConverter()); }
public void SelectJson(int finalInvoiceId) { int pageIndex = 1, pageSize = 100; string orderStr = string.Empty, whereStr = string.Empty; NFMT.Common.UserModel user = Utility.UserUtility.CurrentUser; NFMT.Common.SelectModel select = new NFMT.Common.SelectModel(); NFMT.Invoice.BLL.BusinessInvoiceBLL bll = new NFMT.Invoice.BLL.BusinessInvoiceBLL(); select = bll.GetSuppleFinalByFinalStockListSelect(pageIndex, pageSize, orderStr, finalInvoiceId,0); NFMT.Common.ResultModel result = bll.Load(user, select,NFMT.Common.DefaultValue.ClearAuth); System.Data.DataTable dt = result.ReturnValue as System.Data.DataTable; this.SelectedJson = Newtonsoft.Json.JsonConvert.SerializeObject(dt, new Newtonsoft.Json.Converters.DataTableConverter()); }
public void SelectJson(int subId) { int pageIndex = 1, pageSize = 100; string orderStr = "i.InterestId desc", whereStr = string.Empty; NFMT.Common.UserModel user = Utility.UserUtility.CurrentUser; NFMT.Common.SelectModel select = new NFMT.Common.SelectModel(); NFMT.DoPrice.BLL.PriceConfirmBLL bll = new NFMT.DoPrice.BLL.PriceConfirmBLL(); select = bll.GetPriceConfirmStockListSelectForCreate(pageIndex, pageSize, orderStr, subId); NFMT.Common.ResultModel result = bll.Load(user, select, NFMT.Common.DefaultValue.ClearAuth); System.Data.DataTable dt = result.ReturnValue as System.Data.DataTable; this.SelectedJson = Newtonsoft.Json.JsonConvert.SerializeObject(dt, new Newtonsoft.Json.Converters.DataTableConverter()); }
public void SelectJson(int subId, NFMT.Invoice.InvoiceDirectionEnum direction) { int pageIndex = 1, pageSize = 100; string orderStr = string.Empty, whereStr = string.Empty; NFMT.Common.UserModel user = Utility.UserUtility.CurrentUser; NFMT.Common.SelectModel select = new NFMT.Common.SelectModel(); NFMT.Invoice.BLL.BusinessInvoiceBLL bll = new NFMT.Invoice.BLL.BusinessInvoiceBLL(); select = bll.GetProvisionalContractStockListSelect(pageIndex, pageSize, orderStr, subId); NFMT.Common.ResultModel result = bll.Load(user, select); 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()); }
public void SelectJson(int subId) { int pageIndex = 1, pageSize = 100; string orderStr = string.Empty, whereStr = string.Empty; NFMT.Common.UserModel user = Utility.UserUtility.CurrentUser; NFMT.Common.SelectModel select = new NFMT.Common.SelectModel(); NFMT.DoPrice.BLL.InterestBLL bll = new NFMT.DoPrice.BLL.InterestBLL(); select = bll.GetInterestStocksSelect(pageIndex, pageSize, orderStr, subId); NFMT.Common.ResultModel result = bll.Load(user, select, NFMT.Common.DefaultValue.ClearAuth); System.Data.DataTable dt = result.ReturnValue as System.Data.DataTable; //新增差额行 System.Data.DataRow dr = dt.NewRow(); dt.Rows.Add(dr); dr["StockLogId"] = 0; dr["StockId"] = 0; dr["RefNo"] = "本金余额"; dr["LogDate"] = DateTime.Now; dr["AssetId"] = 0; dr["AssetName"] = "--"; dr["CardNo"] = "--"; dr["BrandId"] = 0; dr["BrandName"] = "--"; dr["DeliverPlaceId"] = 0; dr["DPName"] = "--"; dr["MUId"] = 0; dr["MUName"] = "--"; dr["NetAmount"] = 0; dr["InterestAmount"] = 0; dr["LastAmount"] = 0; dr["StockBala"] = 0; dr["InterestStartDate"] = DateTime.Now; dr["InterestEndDate"] = DateTime.Now; dr["InterestDay"] = 0; dr["InterestUnit"] = 0; dr["InterestBala"] = 0; dr["InterestType"] = (int)NFMT.DoPrice.InterestTypeEnum.差额计息; this.SelectedJson = Newtonsoft.Json.JsonConvert.SerializeObject(dt, new Newtonsoft.Json.Converters.DataTableConverter()); }
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 "CashInDate": sortDataField = "ci.CashInDate"; break; case "InCorp": sortDataField = "inCorp.CorpName"; break; case "OutCorp": sortDataField = "outCorp.CorpName"; break; case "CashInBankName": sortDataField = "ban.BankName"; break; case "CashInBala": sortDataField = "ci.CashInBala"; break; case "LastBala": sortDataField = "ci.CashInBala - ISNULL(ref.SumBala,0)"; break; } orderStr = string.Format("{0} {1}", sortDataField, sortOrder); } NFMT.Common.UserModel user = Utility.UserUtility.CurrentUser; string detailIds = context.Request.QueryString["detailIds"]; string cashInIds = context.Request.QueryString["cashInIds"]; NFMT.Funds.BLL.CashInCorpBLL bll = new NFMT.Funds.BLL.CashInCorpBLL(); NFMT.Common.SelectModel select = new NFMT.Common.SelectModel();// bll.GetCorpAllotLastSelect(pageIndex, pageSize, orderStr, outCorpIds, detailIds, cashInIds); 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) { string redirectUrl = "InvoiceDirectFinalList.aspx"; if (!IsPostBack) { Utility.VerificationUtility ver = new Utility.VerificationUtility(); ver.JudgeOperate(this.Page, 116, new List<NFMT.Common.OperateEnum>() { NFMT.Common.OperateEnum.录入 }); NFMT.Common.UserModel user = Utility.UserUtility.CurrentUser; NFMT.Common.ResultModel result = new NFMT.Common.ResultModel(); //获取合约与子合约 int subId = 0; if (string.IsNullOrEmpty(Request.QueryString["id"]) || !int.TryParse(Request.QueryString["id"], out subId)) Response.Redirect(redirectUrl); NFMT.Contract.BLL.ContractSubBLL subBLL = new NFMT.Contract.BLL.ContractSubBLL(); result = subBLL.Get(user, subId); if (result.ResultStatus != 0) Response.Redirect(redirectUrl); NFMT.Contract.Model.ContractSub sub = result.ReturnValue as NFMT.Contract.Model.ContractSub; if (sub == null || sub.SubId <= 0) Response.Redirect(redirectUrl); this.curContractSub = sub; NFMT.Data.Model.Currency currency = NFMT.Data.BasicDataProvider.Currencies.FirstOrDefault(temp => temp.CurrencyId == sub.SettleCurrency); if (currency != null && currency.CurrencyId > 0) this.currencyName = currency.CurrencyName; NFMT.Contract.BLL.ContractBLL conBLL = new NFMT.Contract.BLL.ContractBLL(); result = conBLL.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.curContract = contract; if (contract.TradeDirection == (int)NFMT.Contract.TradeDirectionEnum.Buy) invoiceDirection = NFMT.Invoice.InvoiceDirectionEnum.收取; int pageIndex = 1, pageSize = 100; string orderStr = string.Empty, whereStr = string.Empty; NFMT.Common.SelectModel select = new NFMT.Common.SelectModel(); NFMT.Invoice.BLL.BusinessInvoiceBLL bll = new NFMT.Invoice.BLL.BusinessInvoiceBLL(); if (sub.PriceMode == (int)NFMT.Contract.PriceModeEnum.定价) { //定价合约 //获取子合约价格明细 NFMT.Contract.BLL.SubPriceBLL subPriceBLL = new NFMT.Contract.BLL.SubPriceBLL(); result = subPriceBLL.GetPriceBySubId(user, sub.SubId); if (result.ResultStatus != 0) Response.Redirect(redirectUrl); NFMT.Contract.Model.SubPrice subPrice = result.ReturnValue as NFMT.Contract.Model.SubPrice; if (subPrice == null || subPrice.SubPriceId <= 0) Response.Redirect(redirectUrl); this.AvgPrice = subPrice.FixedPrice; select = bll.GetDirectFinalStocksSelect(pageIndex, pageSize, orderStr, subId, 0, false, false); } else { select = bll.GetDirectStocksModel(pageIndex, pageSize, orderStr, subId, false, 0); } result = bll.Load(user, select, NFMT.Common.DefaultValue.ClearAuth); System.Data.DataTable dt = result.ReturnValue as System.Data.DataTable; this.SelectedJson = Newtonsoft.Json.JsonConvert.SerializeObject(dt, new Newtonsoft.Json.Converters.DataTableConverter()); //if (sub.PriceMode == (int)NFMT.Contract.PriceModeEnum.点价) //{ decimal sumBala = dt.Select().Sum(temp => Convert.ToDecimal(temp["Bala"])); decimal sumNetAmount = dt.Select().Sum(temp => Convert.ToDecimal(temp["NetAmount"])); if (sumNetAmount == 0) this.WarmAlert("未确认价格,禁止开终票", redirectUrl); if (sumNetAmount > 0) { this.netAmount = sumNetAmount; this.invoiceBala = Math.Round(sumBala, 2, MidpointRounding.AwayFromZero); this.AvgPrice = Math.Round(this.invoiceBala/sumNetAmount, 4, MidpointRounding.AwayFromZero); } //} NFMT.Data.Model.MeasureUnit muContract = NFMT.Data.BasicDataProvider.MeasureUnits.Single(temp => temp.MUId == contract.UnitId); NFMT.Data.Model.MeasureUnit muSub = NFMT.Data.BasicDataProvider.MeasureUnits.Single(temp => temp.MUId == sub.UnitId); this.navigation1.Routes.Add("直接终票列表", redirectUrl); this.navigation1.Routes.Add(string.Format("直接终票新增", invoiceDirection), string.Empty); this.contractExpander1.CurContract = this.curContract; this.contractExpander1.CurContractSub = this.curContractSub; this.contractExpander1.RedirectUrl = redirectUrl; } }
protected void Page_Load(object sender, EventArgs e) { if (!IsPostBack) { Utility.VerificationUtility ver = new Utility.VerificationUtility(); ver.JudgeOperate(this.Page, 120, new List<NFMT.Common.OperateEnum>() { NFMT.Common.OperateEnum.修改 }); NFMT.Common.UserModel user = Utility.UserUtility.CurrentUser; NFMT.Common.ResultModel result = new NFMT.Common.ResultModel(); string redirectUrl = "InterestList.aspx"; this.navigation1.Routes.Add("利息结算列表", redirectUrl); this.navigation1.Routes.Add("利息结算明细", string.Empty); int interestId = 0; if (string.IsNullOrEmpty(Request.QueryString["id"]) || !int.TryParse(Request.QueryString["id"], out interestId) || interestId <= 0) this.Page.WarmAlert("参数错误", redirectUrl); //获取当前结息 NFMT.DoPrice.BLL.InterestBLL interestBLL = new NFMT.DoPrice.BLL.InterestBLL(); result = interestBLL.Get(user, interestId); if (result.ResultStatus != 0) this.WarmAlert(result.Message, redirectUrl); NFMT.DoPrice.Model.Interest interest = result.ReturnValue as NFMT.DoPrice.Model.Interest; if (interest == null || interest.Id <= 0) this.WarmAlert("利息结算不存在", redirectUrl); this.curInterest = interest; //获取币种 NFMT.Data.Model.Currency currency = NFMT.Data.BasicDataProvider.Currencies.FirstOrDefault(temp => temp.CurrencyId == interest.CurrencyId); if (currency == null || currency.CurrencyId <= 0) this.WarmAlert("币种不存在", redirectUrl); this.curCurrency = currency; //获取重量单位 NFMT.Data.Model.MeasureUnit measureUnit = NFMT.Data.BasicDataProvider.MeasureUnits.FirstOrDefault(temp => temp.MUId == interest.Unit); if (measureUnit == null || measureUnit.MUId <= 0) this.WarmAlert("重量单位不存在", redirectUrl); this.curMeasureUnit = measureUnit; //获取子合约 NFMT.Contract.BLL.ContractSubBLL subBLL = new NFMT.Contract.BLL.ContractSubBLL(); result = subBLL.Get(user, interest.SubContractId); if (result.ResultStatus != 0) this.WarmAlert("子合约不存在", redirectUrl); NFMT.Contract.Model.ContractSub sub = result.ReturnValue as NFMT.Contract.Model.ContractSub; if (sub == null || sub.SubId <= 0) this.WarmAlert("子合约不存在", redirectUrl); this.curSub = sub; //品种 NFMT.Data.Model.Asset asset = NFMT.Data.BasicDataProvider.Assets.FirstOrDefault(temp => temp.AssetId == sub.AssetId); if (asset == null || asset.AssetId <= 0) this.WarmAlert("品种获取失败", redirectUrl); this.curAsset = asset; NFMT.Contract.TradeDirectionEnum tradeDirection = (NFMT.Contract.TradeDirectionEnum)sub.TradeDirection; this.curTradeDirection = tradeDirection; NFMT.Contract.BLL.SubCorporationDetailBLL corpBLL = new NFMT.Contract.BLL.SubCorporationDetailBLL(); //我方公司 result = corpBLL.Load(user, sub.SubId, true); if (result.ResultStatus != 0) this.WarmAlert("我方公司获取失败", redirectUrl); List<NFMT.Contract.Model.SubCorporationDetail> inCorps = result.ReturnValue as List<NFMT.Contract.Model.SubCorporationDetail>; if (inCorps == null || inCorps.Count == 0) this.WarmAlert("我方公司获取失败", redirectUrl); NFMT.Contract.Model.SubCorporationDetail inCorp = inCorps.FirstOrDefault(temp => temp.IsDefaultCorp); if (inCorp == null || inCorp.CorpId <= 0) this.WarmAlert("我方公司获取失败", redirectUrl); this.curInCorp = inCorp; //对方公司 result = corpBLL.Load(user, sub.SubId, false); if (result.ResultStatus != 0) this.WarmAlert("对方公司获取失败", redirectUrl); List<NFMT.Contract.Model.SubCorporationDetail> outCorps = result.ReturnValue as List<NFMT.Contract.Model.SubCorporationDetail>; if (outCorps == null || outCorps.Count == 0) this.WarmAlert("对方公司获取失败", redirectUrl); NFMT.Contract.Model.SubCorporationDetail outCorp = outCorps.FirstOrDefault(temp => temp.IsDefaultCorp); if (outCorp == null || outCorp.CorpId <= 0) this.WarmAlert("对方公司获取失败", redirectUrl); this.curOutCorp = outCorp; //json int pageIndex = 1, pageSize = 100; string orderStr = string.Empty, whereStr = string.Empty; NFMT.Common.SelectModel select = new NFMT.Common.SelectModel(); select = interestBLL.GetCurDetailsSelect(pageIndex, pageSize, orderStr, sub.SubId, interest.InterestId); result = interestBLL.Load(user, select, NFMT.Common.DefaultValue.ClearAuth); System.Data.DataTable dt = result.ReturnValue as System.Data.DataTable; this.curJson = 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(interest); this.hidModel.Value = json; } }