public async Task <IList <OrderForBy> > GetOrderForBy(OrderForByModel model) { SqlParameter[] pr = new SqlParameter[] { new SqlParameter("@DateStart", model.DateStart), new SqlParameter("@DateEnd", model.DateEnd), new SqlParameter("@intClientID", (int)_workContext.CurrentCustomer.ClientId), new SqlParameter("@strHPO", string.IsNullOrEmpty(model.Hpo)?DBNull.Value.ToString():model.Hpo), new SqlParameter("@intUserType", (int)_workContext.CurrentCustomer.UserType), new SqlParameter("@intLogonID", (int)_workContext.CurrentCustomer.LogonId) }; var result = await _dbContext.Set <OrderForBy>().FromSqlRaw("exec OrderForBy @DateStart,@DateEnd,@intClientID,@strHPO,@intUserType,@intLogonID", pr).ToListAsync(); return(result); }
public async Task <IActionResult> OrderedFor(OrderForByModel model) { if (ModelState.IsValid) { var orderForList = await _transactionReports.GetOrderForBy(model); foreach (var item in orderForList) { model.OrderForByList.Add(new OrderForBy { Day = item.Day, Month = item.Month, Year = item.Year, HPO = item.HPO, HOrderedby = item.HOrderedby, HOitem = item.HOitem, HDescription = item.HDescription, HOrderedFor = item.HOrderedFor }); } } return(View(model)); }
public IActionResult OrderedFor() { var model = new OrderForByModel(); return(View(model)); }