public IActionResult GetPromoters(int draw, int companyId, int start, int length) { Models.BaseDataTable dataTable = new Models.BaseDataTable(); var result = _userService.GetPromoters(companyId); dataTable.draw = draw; dataTable.data = result.Select(x => new AddPromotersVM() { PromoterName = x.PromoterName, ContactNumber = x.ContactNumber, EmailAddress = x.EmailAddress, Address = x.Address, PromoterId = x.Id }).ToList().Skip(start).Take(length); dataTable.recordsTotal = result.Count(); dataTable.recordsFiltered = result.Count(); return(Json(dataTable)); }
public IActionResult GetDepartments(int draw, int companyId, int start, int length) { Models.BaseDataTable dataTable = new Models.BaseDataTable(); var result = _userService.GetDepartments(companyId); dataTable.draw = draw; dataTable.data = result.Select(x => new AddDepartmentVM() { DepartmentId = x.Id, DepartmentName = x.DepartmentName, ContactNumber = x.ContactNumber, EmailAddress = x.EmailAddress, OfficerInchargeName = x.OfficerInchargeName, }).ToList().Skip(start).Take(length); dataTable.recordsTotal = result.Count(); dataTable.recordsFiltered = result.Count(); return(Json(dataTable)); }
public IActionResult GetOrders(int draw, int companyId, int start, int length) { Models.BaseDataTable dataTable = new Models.BaseDataTable(); var result = _userService.GetOrders(companyId); dataTable.draw = draw; dataTable.data = result.Select(x => new GetOrdersVM() { OrderId = x.OrderId, OrderStatusType = x.OrderStatusType, CustomerId = x.CustomerId, OrderDate = x.OrderDate, PaymentType = x.PaymentType, CustomerName = x.CustomerName, Total = x.Total }).ToList().Skip(start).Take(length); dataTable.recordsTotal = result.Count(); dataTable.recordsFiltered = result.Count(); return(Json(dataTable)); }
public IActionResult GetProducts(int draw, int companyId, int start, int length) { Models.BaseDataTable dataTable = new Models.BaseDataTable(); var result = _userService.GetProducts(companyId, "", "", 0); dataTable.draw = draw; dataTable.data = result.Select(x => new AddProductVM() { ProductName = x.ProductName, ProductCode = x.ProductCode, Discount = x.Discount.ToString(), Price = x.Price.ToString(), Description = x.Description, UploadPath = "/images/" + x.ImagePath, SubCategoryId = x.SubCategoryId, ProductId = x.Id }).ToList().Skip(start).Take(length); dataTable.recordsTotal = result.Count(); dataTable.recordsFiltered = result.Count(); return(Json(dataTable)); }