public async Task <IActionResult> PurchaseOrderCountByShip(POCountShip2Model model) { if (ModelState.IsValid) { model.intClientID = (int)_workContext.CurrentCustomer.ClientId; var pocountlists = await _transactionReports.GetPOShipCounts(model); foreach (var item in pocountlists) { model.PoCountShipList.Add(new POcountShip2 { HshipName = item.HshipName, POCount = item.POCount }); model.TotalCountPO += item.POCount; } } model.AvailableShip.Add(new SelectListItem { Text = "All", Value = "0" }); foreach (var item in (await _transactionReports.GetVendorClients((int)_workContext.CurrentCustomer.ClientId))) { model.AvailableShip.Add(new Microsoft.AspNetCore.Mvc.Rendering.SelectListItem { Text = item.VName, Value = item.VName }); } return(View(model)); }
public async Task <IList <POcountShip2> > GetPOShipCounts(POCountShip2Model model) { SqlParameter[] pr = new SqlParameter[] { new SqlParameter("@DateStart", Convert.ToDateTime(model.DateStart)), new SqlParameter("@DateEnd", Convert.ToDateTime(model.DateEnd)), new SqlParameter("@intClientID", model.intClientID), new SqlParameter("@strShip", model.strShip) }; var results = await _dbContext.Set <POcountShip2>().FromSqlRaw("exec POCountShip2 @DateStart,@DateEnd,@intClientID,@strShip", pr).ToListAsync(); return(results); }
public async Task <IActionResult> PurchaseOrderCountByShip() { var model = new POCountShip2Model(); model.AvailableShip.Add(new SelectListItem { Text = "All", Value = "0" }); foreach (var item in (await _transactionReports.GetVendorClients((int)_workContext.CurrentCustomer.ClientId))) { model.AvailableShip.Add(new Microsoft.AspNetCore.Mvc.Rendering.SelectListItem { Text = item.VName, Value = item.VName }); } return(View(model)); }