public IActionResult GetOrderList(string employeeId) { var orderDetailsList = _queries.GetAllOrderDetailsIncludeOrderServiceQuotationWhereEmployeeIdEquals(employeeId); var orderVM = new List <OrderAdminIndexVM>(); for (int i = 0; i < orderDetailsList.Count; i++) { var orderLocal = new OrderAdminIndexVM(); orderLocal.orderId = orderDetailsList[i].Id.ToString(); orderLocal.Concept = orderDetailsList[i].Order.Concepto; orderLocal.Address = orderDetailsList[i].Order.Direccion; orderLocal.Date = orderDetailsList[i].Order.OrderDate.ToString(); orderLocal.StateOfTheOrder = orderDetailsList[i].Status; orderVM.Add(orderLocal); } return(Json(new { data = orderVM })); }
public IActionResult OnGetAsync() { var claimsIdentity = (ClaimsIdentity)User.Identity; var claim = claimsIdentity.FindFirst(ClaimTypes.NameIdentifier); var userId = claim.Value; _employeeIndexVM = new EmployeeIndexVM() { EmployeeLocal = _queries.GetEmployeeIncludeLstEmployedByFirstOrDefaultEmployeeIdEqualsEmployeeId(userId), orderDetailsList = new List <OrderDetails>() }; _employeeIndexVM.EmployeeId = userId; _employeeIndexVM.orderDetailsList = _queries.GetAllOrderDetailsIncludeOrderServiceQuotationWhereEmployeeIdEquals(_employeeIndexVM.EmployeeLocal.Id); //foreach (var quotation in _employeeIndexVM.EmployeeLocal.QuotationLst) //{ // var quotationLocal = _queries.GetQuotationIncludeOrderDetailsOrdersTasksListMaterialPicturesFirstOrDefault(quotation.OrderDetailsId); // _employeeIndexVM.orderDetailsList.Add(quotationLocal.OrderDetailsModel); //} return(Page()); }