public async Task <IActionResult> EmployeeCountAdd(EmployeeCountModel model) { var empcountObj = _mapper.Map <EmployeeCount>(model); var result = await _transactionReports.InsertEmployeeCount(empcountObj); if (result) { SuccessNotification("The Employee Count data has been saved successfully."); ViewData["lastpage"] = "/Reports/TransactionReports/EmployeeCount"; } else { ModelState.AddModelError("", "Something went wrong while saving record."); } //Redisplay form foreach (var item in (await _transactionReports.GetEmployeeCountShip((int)_workContext.CurrentCustomer.ClientId))) { model.AvailableCostCenter.Add(new SelectListItem { Text = item.SName, Value = item.Sid.ToString() }); } return(View(model)); }
public async Task <IActionResult> EmployeeCountAdd() { var model = new EmployeeCountModel(); foreach (var item in (await _transactionReports.GetEmployeeCountShip((int)_workContext.CurrentCustomer.ClientId))) { model.AvailableCostCenter.Add(new SelectListItem { Text = item.SName, Value = item.Sid.ToString() }); } return(View(model)); }