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 sids = context.Request.QueryString["sids"]; int pledgeApplyId = 0; if (string.IsNullOrEmpty(context.Request.QueryString["pid"]) || !int.TryParse(context.Request.QueryString["aid"], out pledgeApplyId) || pledgeApplyId <= 0) pledgeApplyId = 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.WareHouse.BLL.PledgeBLL bll = new NFMT.WareHouse.BLL.PledgeBLL(); NFMT.Common.SelectModel select = bll.GetPledgeSelect(pageIndex, pageSize, orderStr, sids, pledgeApplyId); NFMT.Common.IAuthority auth = new NFMT.Authority.StockAuth(); //auth.AuthColumnNames.Add("sto.StockId"); NFMT.Common.ResultModel result = bll.Load(user, select,auth); 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 ProcessRequest(HttpContext context) { NFMT.Common.UserModel user = Utility.UserUtility.CurrentUser; int pageIndex = 1, pageSize = 10; string orderStr = string.Empty, whereStr = string.Empty; string refNo = context.Request.QueryString["r"]; string outContractNO = context.Request.QueryString["outNo"]; 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.Invoice.BLL.SIBLL bll = new NFMT.Invoice.BLL.SIBLL(); NFMT.Common.SelectModel select = bll.GetCanAllotStockSelectModel(pageIndex, pageSize, orderStr, refNo, outContractNO); NFMT.Authority.StockAuth auth = new NFMT.Authority.StockAuth(); NFMT.Common.ResultModel result = bll.Load(user, select,auth); 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 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); }