public ActionResult ChargeOrders(OrderSearchModel searchModel) { OrderManagement orderMgt = new OrderManagement(User.Identity.GetUserId<int>()); agentAdminMgt = new AgentAdminMenagement(orderMgt.CurrentLoginUser); resourceMgt = new ResourceManagement(orderMgt.CurrentLoginUser); if (!orderMgt.CurrentLoginUser.Permission.CHARGE_HISTORY) { ViewBag.Message = "没有权限查看流量充值记录"; return View("Error"); } int pageSize = 40; DateTime sDate = DateTime.MinValue; DateTime eDate = DateTime.MinValue; if(!string.IsNullOrEmpty(searchModel.StartTime)) { DateTime.TryParse(searchModel.StartTime, out sDate); } if (!string.IsNullOrEmpty(searchModel.EndTime)) { DateTime.TryParse(searchModel.EndTime, out eDate); } long sintDate = sDate!=DateTime.MinValue?DateTimeUtil.ConvertDateTimeToInt(sDate):0; long eintDate= eDate != DateTime.MinValue ? DateTimeUtil.ConvertDateTimeToInt(eDate) : 0; int page = 1; if(Request["page"]!=null) { int.TryParse(Request["page"],out page); } searchModel.Page = page; List<BOrder> orders = orderMgt.FindOrders(searchModel.OrderId!=null?(int)searchModel.OrderId:0, searchModel.AgencyId!=null?(int)searchModel.AgencyId:0, searchModel.ResourceId!=null?(int)searchModel.ResourceId:0, searchModel.ResourceTaocanId!=null?(int)searchModel.ResourceTaocanId:0, searchModel.RuoteId!=null?(int)searchModel.RuoteId:0, searchModel.SPName, searchModel.MobileNumber, searchModel.Status, sintDate, eintDate, out total, pageSize, searchModel.Page, true); PageItemsResult<BOrder> result = new PageItemsResult<BOrder>() { CurrentPage = searchModel.Page, Items = orders, PageSize = pageSize, TotalRecords = total,EnablePaging=true }; KMBit.Grids.KMGrid<BOrder> grid = new Grids.KMGrid<BOrder>(result); BigOrderSearchModel model = new BigOrderSearchModel() { SearchModel = searchModel, OrderGrid = grid }; List<KMBit.Beans.BUser> agencies = agentAdminMgt.FindAgencies(0, null, null, 0, 0, out total, 0, 0, false,null); List<BResource> resources = new List<BResource>(); if(searchModel.AgencyId!=null) { resources = agentAdminMgt.FindAgentResources((int)searchModel.AgencyId); }else { resources = resourceMgt.FindResources(0,null,0,out total); } ViewBag.Agencies = new SelectList((from a in agencies select a.User).ToList<Users>(),"Id","Name"); ViewBag.Resources = new SelectList((from r in resources select r.Resource).ToList<Resource>(), "Id", "Name"); List<BResourceTaocan> taocans = new List<BResourceTaocan>(); if(searchModel.ResourceId!=null) { if(searchModel.AgencyId==null) { taocans = resourceMgt.FindResourceTaocans((int)searchModel.ResourceId, 0, false); } else { taocans = agentAdminMgt.FindAgencyResourceTaocans((int)searchModel.AgencyId, (int)searchModel.ResourceId); } } ViewBag.Taocans = new SelectList((from t in taocans select new { Id=t.Taocan.Id,Name=t.Taocan2.Name}), "Id", "Name"); ViewBag.StatusList = new SelectList((from s in StaticDictionary.GetChargeStatusList() select new { Id=s.Id,Name=s.Value}),"Id","Name"); return View(model); }
public ActionResult AccountChargeHistory(PaymentHistoryModel searchModel) { PaymentManagement paymentMgt = new PaymentManagement(User.Identity.GetUserId<int>()); agentAdminMgt = new AgentAdminMenagement(paymentMgt.CurrentLoginUser); int pageSize = 30; int page = 1; if (Request["page"] != null) { int.TryParse(Request["page"], out page); } searchModel.Page = page; List<BPaymentHistory> records = paymentMgt.FindAgentPayments(0, searchModel.AgentId!=null?(int)searchModel.AgentId:0, 0, searchModel.PayType, searchModel.TranfserType!=null?(int)searchModel.TranfserType:0, searchModel.OprUser, searchModel.Status, out total, true,pageSize,page); PageItemsResult<BPaymentHistory> result = new PageItemsResult<BPaymentHistory>() { CurrentPage = page, Items = records, PageSize = pageSize, TotalRecords = total, EnablePaging = true }; KMBit.Grids.KMGrid<BPaymentHistory> grid = new Grids.KMGrid<BPaymentHistory>(result); BigPaymentSearchModel bidModel = new BigPaymentSearchModel() { SearchModel = searchModel, Grid = grid }; List<KMBit.Beans.BUser> agencies = agentAdminMgt.FindAgencies(0, null, null, 0, 0, out total, 0, 0, false, null); ViewBag.Agencies = new SelectList((from a in agencies select a.User).ToList<Users>(), "Id", "Name"); ViewBag.PayTypes = new SelectList((from s in StaticDictionary.GetPaymentTypeList2() select new { Id = s.Id, Name = s.Value }), "Id", "Name"); ViewBag.StatusList = new SelectList((from s in StaticDictionary.GetPaymentStatusList() select new { Id = s.Id, Name = s.Value }), "Id", "Name"); ViewBag.TranfserTypes = new SelectList((from s in StaticDictionary.GetTranfserTypeList() select new { Id = s.Id, Name = s.Value }), "Id", "Name"); return View(bidModel); }