private object GetData(PagerQuery <PagerInfo, CriteriaNuclearButton, IEnumerable <NuclearButtonListModel> > pagerQuery = null) { var pageInfo = new PagerInfo(this.HttpContext); if (pagerQuery == null) { pagerQuery = new PagerQuery <PagerInfo, CriteriaNuclearButton, IEnumerable <NuclearButtonListModel> >(pageInfo, new CriteriaNuclearButton(), null); pagerQuery.Search.WayOutStartTime = DateTime.Now.AddDays(-6).ToString("yyyy-MM-dd"); pagerQuery.Search.WayOutEndTime = DateTime.Now.ToString("yyyy-MM-dd"); } else { int recordCount = 0; int TotalPages = 0; var resultMsg = string.Empty; if (string.IsNullOrWhiteSpace(pagerQuery.Search.CustomerName) && this.CurrentUser.Userid != "0505") { pagerQuery.Search.CustomerName = this.CurrentUser.Userid; } if (!string.IsNullOrWhiteSpace(pagerQuery.Search.WayOutStartTime)) { pagerQuery.Search.WayOutStartTime += " 00:00:00"; } if (!string.IsNullOrWhiteSpace(pagerQuery.Search.WayOutEndTime)) { pagerQuery.Search.WayOutEndTime += " 23:59:59"; } if (!string.IsNullOrWhiteSpace(pagerQuery.Search.CargoType)) { pagerQuery.Search.CargoTypeTest = Universal.GetStatusName(_Dictionary.CargoType, pagerQuery.Search.CargoType); } if (!string.IsNullOrWhiteSpace(pagerQuery.Search.ApprovalStatus)) { decimal status = Convert.ToDecimal(pagerQuery.Search.ApprovalStatus); pagerQuery.Search.ApprovalStatus = ((int)status).ToString(); } var data = this.facadeVHk.QueryV_HKListPager(out resultMsg, out recordCount, out TotalPages, pagerQuery.Search, pageInfo.PageSize, pageInfo.CurrentPageIndex).ToList <NuclearButtonListModel>(); pageInfo.RecordCount = recordCount; pagerQuery.Pager = pageInfo; pagerQuery.Pager.TotalPages = TotalPages; pagerQuery.DataList = data; } pagerQuery.Search.CargoTypeList = DropDownListFor.GetCargoTypeSelect(null, true); pagerQuery.Search.CustomerNameList = DropDownListFor.GetCustomerNameSelect(this.CurrentUser.Userid, pagerQuery.Search.CargoType, null, true); pagerQuery.Search.WayOutList = DropDownListFor.GetWayOutSelect(null, true); pagerQuery.Search.LockStatusList = DropDownListFor.GetLockingStatusSelect(null, false); pagerQuery.Search.ApprovalStatusList = DropDownListFor.GetApprovalStatusSelect(null, true); return(pagerQuery); }
public ActionResult Details(string id) { NuclearGrowthEditModel model = new NuclearGrowthEditModel(); List <NuclearGrowthEditInfoModel> list = new List <NuclearGrowthEditInfoModel>(); model.infoModel = new List <NuclearGrowthEditInfoModel>(); try { //权限验证 //this.HasActionPower(); if (!string.IsNullOrWhiteSpace(id)) { DataTable in_head = new DataTable(); DataTable in_list = new DataTable(); this.facadeVHz.GetDetailsData(id, out in_head, out in_list); if (in_head != null && in_head.Rows.Count > 0) { model = in_head.ToList <NuclearGrowthEditModel>().First(); if (in_list != null && in_list.Rows.Count > 0) { foreach (DataRow row in in_list.Rows) { NuclearGrowthEditInfoModel infoModel = new NuclearGrowthEditInfoModel(); infoModel.code_t = row["code_t"].ToString(); infoModel.mg_name = row["mg_name"].ToString(); infoModel.mg_spec = row["mg_spec"].ToString(); infoModel.g_qty = Convert.ToDecimal(row["g_qty"]); infoModel.g_unit = Universal.GetStatusName(_Dictionary.CreatStoreUnit, row["g_unit"].ToString()); infoModel.curr_code = Universal.GetStatusName(_Dictionary.ParaExchrate, row["curr_code"].ToString()); infoModel.unit_price = Convert.ToDecimal(row["unit_price"]); infoModel.trade_ttl = Convert.ToDecimal(row["trade_ttl"]); infoModel.orign_coun = Universal.GetCcodesDisplayName(_Pccode.SourceDestination, row["orign_coun"].ToString()); infoModel.zm_code = Universal.GetCcodesDisplayName(_Pccode.ExemptWay, row["zm_code"].ToString()); infoModel.baxh = row["baxh"].ToString(); infoModel.code_s = row["code_s"].ToString(); infoModel.rate = Convert.ToDecimal(row["rate"]); infoModel.rate_id = row["rate_id"].ToString(); infoModel.pkgs = Convert.ToDecimal(row["pkgs"]); infoModel.gross = Convert.ToDecimal(row["gross"]); infoModel.net = Convert.ToDecimal(row["net"]); infoModel.qty_1 = Convert.ToDecimal(row["qty_1"]); infoModel.unit_code1 = Universal.GetStatusName(_Dictionary.CreatStoreUnit, row["unit_code1"].ToString()); infoModel.usd_unit_price = Convert.ToDecimal(row["usd_unit_price"]); infoModel.usd_trade_ttl = Convert.ToDecimal(row["usd_trade_ttl"]); infoModel.version_num = row["version_num"].ToString(); infoModel.qty_2 = Convert.ToDecimal(row["qty_2"]); infoModel.unit_code2 = Universal.GetStatusName(_Dictionary.CreatStoreUnit, row["unit_code2"].ToString()); infoModel.mass_no = Convert.ToDecimal(row["mass_no"]); infoModel.pcs = row["pcs"].ToString(); list.Add(infoModel); } model.infoModel = list; JavaScriptSerializer json = new JavaScriptSerializer(); model.jsonList = json.Serialize(list); } } } } catch (Exception ex) { var msgT = Server.UrlEncode("系统出现错误,请联系客服或管理员处理!"); var msgD = Server.UrlEncode(ex.Message); UrlHelper url = new UrlHelper(this.Request.RequestContext); this.Response.Redirect(url.Action("Index", "Error", new { msgTitle = msgT, msgDetail = msgD })); } return(View(model)); }