public async Task <IActionResult> List(string orderNumber, string name, string timeFrom, string timeTo, int page = 1, int pageSize = 10) { string where = _comService.GetWhere(); if (!string.IsNullOrEmpty(orderNumber)) { where += $" and billNumber like '%{orderNumber}%'"; } if (!string.IsNullOrEmpty(name)) { where += $" and Name like '%{name}%'"; } if (!string.IsNullOrEmpty(timeFrom)) { where += $" and n.CreationTime>='{timeFrom} 00:00:00'"; } if (!string.IsNullOrEmpty(timeTo)) { where += $" and n.CreationTime<='{timeTo} 23:59:59'"; } int total; DataSet ds = _appService.GetPage(page, pageSize, "n.id desc", out total, where); IPagedList pageList = new PagedList <DataRow>(ds.Tables[0].Select(), page, pageSize, total); ViewBag.PageSize = pageSize; if (Request.Headers.ContainsKey("x-requested-with")) { return(View("_Table", pageList)); } return(View(pageList)); }
public async Task <IActionResult> Index(int pageIndex = 1, int pageSize = 10, long categoryId = 0, string title = "") { string where = _comService.GetWhere(); ViewBag.Title = title; ViewBag.Cat = categoryId; if (!string.IsNullOrEmpty(title)) { where += $" and g.name like '%{title}%' "; } if (categoryId > 0) { where += $" and g.categoryId ={categoryId} "; } int total; string tableSl = $@"select g.id,g.Status,g.Sort,g.Stock,g.Name, s.Name StoreName,cast(g.Price as float) Price , cast(g.RetailPrice as float) RetailPrice from dbo.TGoods g left join dbo.TChainStore s on g.chainstoreid=s.Id"; DataSet ds = _AppService.GetPage(pageIndex, pageSize, "g.sort desc", out total, where, tableSl); IPagedList pageList = new PagedList <DataRow>(ds.Tables[0].Select(), pageIndex, pageSize, total); if (Request.Headers.ContainsKey("x-requested-with")) { return(View("_Table", pageList)); } ViewBag.Cat = categoryId; ViewBag.PayType = ""; ViewBag.Category = (await _catAppService.GetGoodsCategory()).Rows; return(View(pageList)); }
public async Task <IActionResult> Index(int pageIndex = 1, int pageSize = 10, long categoryId = 0, string title = "") { string where = _comService.GetWhere(); ViewBag.Title = title; ViewBag.Cat = categoryId; if (!string.IsNullOrEmpty(title)) { where += $" and g.name like '%{title}%' "; } if (categoryId > 0) { where += $" and g.categoryId ={categoryId} "; } int total; DataSet ds = _AppService.GetPage(pageIndex, pageSize, "g.sort desc,g.id desc", out total, where); IPagedList pageList = new PagedList <DataRow>(ds.Tables[0].Select(), pageIndex, pageSize, total); if (Request.Headers.ContainsKey("x-requested-with")) { return(View("_Table", pageList)); } ViewBag.Cat = categoryId; ViewBag.Category = await _catAppService.GetCategoryDropDownList(0, 1); return(View(pageList)); }
public async Task <IActionResult> List(int page = 1, int pageSize = 10, string Level = "", string Name = "", string Business = "", string Store = "", string RegTimeFrom = "", string RegTimeTo = "") { //System.Diagnostics.Stopwatch stopwatch = new System.Diagnostics.Stopwatch(); //stopwatch.Start(); // 开始监视代码运行时间 // // 需要测试的代码 .... string where = string.Empty; where += _comAppService.GetWhere(); if (!string.IsNullOrEmpty(Level)) { where += $" and c.levelId={Level}"; } if (!string.IsNullOrEmpty(Name)) { where += $" and c.WeChatName like'%{Name}%'"; } if (!string.IsNullOrEmpty(Business)) { where += $" and c.BusinessId={Business}"; } if (!string.IsNullOrEmpty(Store)) { where += $" and c.ChainStoreId={Store}"; } if (!string.IsNullOrEmpty(RegTimeFrom)) { where += $" and c.RegTime>='{RegTimeFrom} 00:00:00'"; } if (!string.IsNullOrEmpty(RegTimeTo)) { where += $" and c.RegTime<='{RegTimeTo} 23:59:59'"; } ViewBag.PageSize = pageSize; int total; DataSet ds = _AppService.GetPage(page, pageSize, "id desc", out total, where); IPagedList pageList = new PagedList <DataRow>(ds.Tables[0].Select(), page, pageSize, total); //stopwatch.Stop(); // 停止监视 //TimeSpan timespan = stopwatch.Elapsed; // 获取当前实例测量得出的总时间 //double milliseconds = timespan.TotalMilliseconds; // 总毫秒数 //Logger.Warn("11111111111111111111111111耗时间:"+ milliseconds.ToString()); if (Request.Headers.ContainsKey("x-requested-with")) { return(View("_Table", pageList)); } //var businessDropDown = (await _businessAppService.GetDropDown()); //ViewData.Add("Business", new SelectList(businessDropDown, "Id", "BusinessName")); var levelDropDown = (await _levelAppService.GetDropDown()); ViewData.Add("Level", new SelectList(levelDropDown, "Id", "Title")); var storeDropDown = (await _storeAppService.GetDropDown()); ViewData.Add("ChainStore", new SelectList(storeDropDown, "Id", "Name")); return(View(pageList)); }
public async Task <IActionResult> List(string orderNumber, string way, string name, string cardid, string timeFrom, string timeTo, int page = 1, int pageSize = 10) { string where = _comService.GetWhere(); if (!string.IsNullOrEmpty(orderNumber)) { where += $" and billNumber like '%{orderNumber}%'"; } if (!string.IsNullOrEmpty(name)) { where += $" and Name like '%{name}%'"; } if (!string.IsNullOrEmpty(cardid)) { where += $" and cardid like '%{cardid}%'"; } if (!string.IsNullOrEmpty(way)) { where += $" and way ={way}"; } if (!string.IsNullOrEmpty(timeFrom)) { where += $" and n.CreationTime>='{timeFrom} 00:00:00'"; } if (!string.IsNullOrEmpty(timeTo)) { where += $" and n.CreationTime<='{timeTo} 23:59:59'"; } int total; DataSet ds = _appService.GetPage(page, pageSize, "n.CreationTime desc", out total, where); IPagedList pageList = new PagedList <DataRow>(ds.Tables[0].Select(), page, pageSize, total); ViewBag.PageSize = pageSize; if (Request.Headers.ContainsKey("x-requested-with")) { return(View("_Table", pageList)); } IList <SelectListItem> listItem = new List <SelectListItem>(); Array values = System.Enum.GetValues(typeof(Entity.ConsumeType)); foreach (int item in values) { listItem.Add(new SelectListItem { Value = item.ToString(), Text = L(System.Enum.GetName(typeof(Entity.ConsumeType), item)) }); } ViewBag.ConsumeType = listItem; return(View(pageList)); }
public async Task <IActionResult> List(int page = 1, int pageSize = 10, string title = "", string timeFrom = "", string timeTo = "") { string where = _comService.GetWhere(); if (!string.IsNullOrEmpty(title)) { where += $" and title like '%{title}%'"; } if (!string.IsNullOrEmpty(timeFrom)) { where += $" and SendTime>='{timeFrom} 00:00:00'"; } if (!string.IsNullOrEmpty(timeTo)) { where += $" and SendTime<='{timeTo} 23:59:59'"; } int total; DataSet ds = _appService.GetPage(page, pageSize, "id desc", out total, where); IPagedList pageList = new PagedList <DataRow>(ds.Tables[0].Select(), page, pageSize, total); ViewBag.PageSize = pageSize; if (Request.Headers.ContainsKey("x-requested-with")) { return(View("_Table", pageList)); } return(View(pageList)); }
public async Task <IActionResult> List(string businessId, string title, string status, int pageIndex = 1, int pageSize = 10) { string where = _comService.GetWhere(); if (!string.IsNullOrEmpty(title)) { where += $" and f.title like '%{title}%' "; } if (!string.IsNullOrEmpty(businessId)) { where += $" and f.BusinessId = {businessId}"; } if (!string.IsNullOrEmpty(status)) { where += $" and f.status = {status}"; } int total; DataSet ds = _AppService.GetPage(pageIndex, pageSize, "f.sort desc", out total, where); IPagedList pageList = new PagedList <DataRow>(ds.Tables[0].Select(), pageIndex, pageSize, total); ViewBag.PageSize = pageSize; if (Request.Headers.ContainsKey("x-requested-with")) { return(View("_Table", pageList)); } List <BusinessDropDownDto> dtoList = (await _businessAppService.GetDropDown()); ViewData.Add("Business", new Microsoft.AspNetCore.Mvc.Rendering.SelectList(dtoList, "Id", "BusinessName")); return(View(pageList)); }
public async Task <IActionResult> List(int page = 1, int pageSize = 10, string storeName = "", string businessId = "") { string where = _commonAppService.GetWhere(); if (!string.IsNullOrEmpty(storeName)) { where = $" and c.Name like '%{storeName}%'"; } if (!string.IsNullOrEmpty(businessId)) { where += $" and c.BusinessId = {businessId}"; } int total; string table = $@"select c.id, c.Name,c.IsSystem, cast(c.OnLineCommission as float) OnLineCommission ,cast(c.OffLineCommission as float) OffLineCommission,cast(c.OffLineDiscount as float) OffLineDiscount from TChainStore c where 1=1"; DataSet ds = _AppService.GetPage(page, pageSize, "c.sort desc, c.id desc", out total, where, table); IPagedList pageList = new PagedList <DataRow>(ds.Tables[0].Select(), page, pageSize, total); ViewBag.PageSize = pageSize; if (Request.Headers.ContainsKey("x-requested-with")) { return(View("_Table", pageList)); } List <BusinessDropDownDto> dtoList = (await _businessAppService.GetDropDown()); ViewData.Add("Business", new Microsoft.AspNetCore.Mvc.Rendering.SelectList(dtoList, "Id", "BusinessName")); return(View(pageList)); }
public async Task <IActionResult> List(string goodsName, string storeId, string categoryId, string brandId, string type, string status, int page = 1, int pageSize = 10) { string where = _comService.GetWhere(); if (!string.IsNullOrEmpty(goodsName)) { where = $" and g.Name like '%{goodsName}%'"; } if (!string.IsNullOrEmpty(categoryId)) { where += $" and g.categoryId = {categoryId}"; } if (!string.IsNullOrEmpty(brandId)) { where += $" and g.brandId = {brandId}"; } if (!string.IsNullOrEmpty(storeId)) { where += $" and g.ChinStoreId = {storeId}"; } if (!string.IsNullOrEmpty(type)) { where += $" and g.type = {type}"; } if (!string.IsNullOrEmpty(status)) { where += $" and g.status = {status}"; } int total; DataSet ds = _AppService.GetPage(page, pageSize, "g.sort desc", out total, where); IPagedList pageList = new PagedList <DataRow>(ds.Tables[0].Select(), page, pageSize, total); ViewBag.PageSize = pageSize; if (Request.Headers.ContainsKey("x-requested-with")) { return(View("_Table", pageList)); } ViewBag.Category = _catAppService.GetCategoryDropDownList(AbpSession.TenantId, 0); ViewBag.Brand = _brandAppService.GetMultiSelect(); ViewBag.Store = (await _storeAppService.GetDropDown()); IList <SelectListItem> listItem = new List <SelectListItem>(); Array values = System.Enum.GetValues(typeof(Entity.GoodsState)); foreach (int item in values) { listItem.Add(new SelectListItem { Value = item.ToString(), Text = L(System.Enum.GetName(typeof(Entity.GoodsState), item)) }); } ViewData.Add("GoodsType", new SelectList(listItem, "Value", "Text")); return(View(pageList)); }
public async Task <IActionResult> List(string timeFrom, string timeTo, string orderNumber, string cardId, string name, string status, int page = 1, int pageSize = 10) { string where = _comService.GetWhere(); if (!string.IsNullOrEmpty(name)) { where += $" and name like '%{name}%' "; } if (!string.IsNullOrEmpty(status)) { where += $" and o.Status={status} "; } if (!string.IsNullOrEmpty(orderNumber)) { where += $" and billNumber = '{orderNumber}' "; } if (!string.IsNullOrEmpty(cardId)) { where += $" and cardId like '%{cardId}%' "; } if (!string.IsNullOrEmpty(timeFrom)) { where += $" and o.CreationTime>='{timeFrom} 00:00:00'"; } if (!string.IsNullOrEmpty(timeTo)) { where += $" and o.CreationTime<='{timeTo} 23:59:59'"; } int total; DataSet ds = _AppService.GetPage(page, pageSize, "id desc", out total, where); IPagedList pageList = new PagedList <DataRow>(ds.Tables[0].Select(), page, pageSize, total); ViewBag.PageSize = pageSize; if (Request.Headers.ContainsKey("x-requested-with")) { return(View("_Table", pageList)); } ViewBag.Category = await _catAppService.GetCategoryDropDownList(0, 1); return(View(pageList)); }
public IActionResult List(int pageIndex = 1, int pageSize = 10, string title = "") { string where = " and type= 0 " + _comService.GetWhere(); if (!string.IsNullOrEmpty(title)) { where += $" and c.title like '%{title}%' "; } int total; DataSet ds = _AppService.GetPage(pageIndex, pageSize, "c.sort desc, c.id desc", out total, where); IPagedList pageList = new PagedList <DataRow>(ds.Tables[0].Select(), pageIndex, pageSize, total); ViewBag.PageSize = pageSize; if (Request.Headers.ContainsKey("x-requested-with")) { return(View("_Table", pageList)); } return(View(pageList)); }
public async Task <IActionResult> List(int page = 1, int pageSize = 10, string title = "") { string where = $" and type={(int)Entity.CommentType.抢购评论}" + _comService.GetWhere(); if (!string.IsNullOrEmpty(title)) { where += $" and a.title like '%{title}%' "; } int total; DataSet ds = _Service.GetPage(page, pageSize, "c.Praise desc,c.id desc", out total, where); IPagedList pageList = new PagedList <DataRow>(ds.Tables[0].Select(), page, pageSize, total); ViewBag.PageSize = pageSize; if (Request.Headers.ContainsKey("x-requested-with")) { return(View("_Table", pageList)); } return(View(pageList)); }
public async Task <IActionResult> List(int page = 1, int pageSize = 10, string businessId = "", string title = "") { string where = " and Type=0 " + _comService.GetWhere(); if (!string.IsNullOrEmpty(title)) { where += $" and c.title like '%{title}%' "; } int total; DataSet ds = _couponService.GetPage(page, pageSize, "id desc", out total, where); IPagedList pageList = new PagedList <DataRow>(ds.Tables[0].Select(), page, pageSize, total); ViewBag.PageSize = pageSize; if (Request.Headers.ContainsKey("x-requested-with")) { return(View("_Table", pageList)); } //List<BusinessDropDownDto> businessdtoList = (await _AppService.GetDropDown()); // ViewData.Add("Business", new Microsoft.AspNetCore.Mvc.Rendering.SelectList(businessdtoList, "Id", "BusinessName")); return(View(pageList)); }
public async Task <IActionResult> Index(long?id) { // ViewBag.Page = new PagedList<DataRow>(null, 1, 1); if (id != null) { ViewBag.CarId = (await _AppService.GetEntity((long)id)).CardID; } var levelDropDown = (await _levelAppService.GetDropDown()); ViewData.Add("Level", new SelectList(levelDropDown, "Id", "Title")); var storeDropDown = (await _storeAppService.GetDropDown()); ViewData.Add("ChainStore", new SelectList(storeDropDown, "Id", "Name")); string where = _comAppService.GetWhere(); int total; string sql = $@"select c.id,c.Title from dbo.TCoupon c where c.id>0"; DataSet ds = _couponService.GetPage(1, int.MaxValue, "id desc", out total, where, sql); ViewBag.CouponTable = ds.Tables[0]; return(View()); }
public async Task <IActionResult> Index() { string comWhere = _comService.GetWhere(); string where = " 1=1 " + comWhere; DataTable dt = await _levelService.GetIndexData(where); string m = string.Empty; foreach (DataRow item in dt.Rows) { m += "{name:'" + item["title"] + "',y:" + item["count"] + "},"; } ViewBag.TotalMember = m; int total; ViewBag.Consume = _consumeService.GetPage(1, 40, "n.id desc", out total, comWhere).Tables[0]; DataTable dtMember = await _memService.IndexMember(where); string M = string.Empty; string W = string.Empty; string date = string.Empty; for (int i = 15; i >= 1; i--) { if (dtMember.Select($" Day='{DateTime.Now.AddDays(-i).ToString("yyyy-MM-dd")}'").Count() <= 0) { M += $"0,"; W += $"0,"; } else { M += $"{dtMember.Select($" Day='{DateTime.Now.AddDays(-i).ToString("yyyy-MM-dd")}'")[0]["M"]},"; W += $"{dtMember.Select($" Day='{DateTime.Now.AddDays(-i).ToString("yyyy-MM-dd")}'")[0]["W"]},"; } date += $"'{DateTime.Now.AddDays(-i).ToString("MM-dd")}',"; } ViewBag.Data = date; ViewBag.M = M; ViewBag.W = W; DataTable dtWhat = _weiService.GetIndexData(comWhere + $" and CreationTime>='{DateTime.Now.AddDays(-10).ToString("yyyy-MM-dd")}'" + $" and CreationTime<='{DateTime.Now.ToString("yyyy-MM-dd")}'"); DataTable dtAli = _aliService.GetIndexData(comWhere + $" and CreationTime>='{DateTime.Now.AddDays(-10).ToString("yyyy-MM-dd")}'" + $" and CreationTime<='{DateTime.Now.ToString("yyyy-MM-dd")}'"); string WeChatLine = string.Empty; string AliLine = string.Empty; string dayStr = string.Empty; for (int i = 10; i >= 1; i--) { if (dtWhat.Select($" Time={DateTime.Now.AddDays(-i).ToString("yyyyMMdd")}").Count() <= 0) { WeChatLine += "0,"; } else { WeChatLine += $"{dtWhat.Select($" Time={DateTime.Now.AddDays(-i).ToString("yyyyMMdd")}")[0]["TotalValue"]},"; } if (dtAli.Select($" Time={DateTime.Now.AddDays(-i).ToString("yyyyMMdd")}").Count() <= 0) { AliLine += "0,"; } else { AliLine += $"{dtAli.Select($" Time={DateTime.Now.AddDays(-i).ToString("yyyyMMdd")}")[0]["TotalValue"]},"; } dayStr += $"'{DateTime.Now.AddDays(-i).ToString("MM-dd")}',"; } ViewBag.ConDay = dayStr; ViewBag.WeChatLine = WeChatLine; ViewBag.AliLine = AliLine; return(View()); }