// GET: CustomerViews/Details/5 public PartialViewResult GetCustomers(string searchString, int sortType) { PersonSort sort = TempData["sort"] as PersonSort; TempData.Keep(); if (searchString != "`") { sort.SearchString = searchString; } sort.GetSort(sortType); TempData["sort"] = sort; TempData.Keep(); List <CustomerView> customers = new List <CustomerView>(); if (!String.IsNullOrEmpty(sort.SearchString)) { foreach (var c in serviceCustomers.Sort(serviceCustomers.CustomerSearch(sort.SearchString), sort.Sort, sort.GetOrder())) { customers.Add(new CustomerView(c)); } } else { foreach (var c in serviceCustomers.Sort(serviceCustomers.GetCustomers(), sort.Sort, sort.GetOrder())) { customers.Add(new CustomerView(c)); } } return(PartialView(customers)); }
// GET: Customers public async Task <IActionResult> Index(int page = 1, int itemsPerPage = 10) { DistributionPerPage distributionPerPage = new DistributionPerPage(); distributionPerPage.recordCount = await _serviceCustomers.GetCount(); distributionPerPage.itemsPerPage = itemsPerPage; distributionPerPage.page = page; distributionPerPage.CalculateDistribution(); ViewData["PagesCount"] = int.Parse(distributionPerPage.pageCount.ToString()); ViewData["page"] = distributionPerPage.page; ViewData["PageStart"] = distributionPerPage.PageStart; ViewData["PagingItems"] = distributionPerPage.itemsPerPage; ViewData["ControllerName"] = "Customers"; var _results = await _serviceCustomers.GetCustomers(page, itemsPerPage); return(View(_results)); }
// GET: SaleViews/Create public ActionResult Create() { SaleEdit saleEdit = new SaleEdit(serviceProducts.GetProducts(), serviceCustomers.GetCustomers()); return(View(saleEdit)); }