public List <PRODUCT> Search(PRODUCT Product, int PageSize, int PageIndex, out int TotalRecords, string OrderExp, Util.SortDirection SortDirection) { return(_productDAO.Search(Product, PageSize, PageIndex, out TotalRecords, OrderExp, SortDirection)); }
public List <CUSTOMER> Search(CUSTOMER Entity, int PageSize, int PageIndex, out int TotalRecords, string OrderExp, Util.SortDirection SortDirection) { return(_customerDAO.Search(Entity, PageSize, PageIndex, out TotalRecords, OrderExp, SortDirection)); }
public List <BRAND> GetAll(int PageSize, int PageIndex, out int TotalRecords, string OrderExp, Util.SortDirection SortDirection) { return(_brandDAO.GetAll(PageSize, PageIndex, out TotalRecords, OrderExp, SortDirection)); }
public List <INVITATION> Search(INVITATION Entity, int PageSize, int PageIndex, out int TotalRecords, string OrderExp, Util.SortDirection SortDirection) { return(_invititationDAO.Search(Entity, PageSize, PageIndex, out TotalRecords, OrderExp, SortDirection)); }
public List <SHOPPING_CART> Search(SHOPPING_CART Entity, int PageSize, int PageIndex, out int TotalRecords, string OrderExp, Util.SortDirection SortDirection) { return(_shoppingCartDAO.Search(Entity, PageSize, PageIndex, out TotalRecords, OrderExp, SortDirection)); }
public List <ADDRESSINFO> Search(ADDRESSINFO Entity, int PageSize, int PageIndex, out int TotalRecords, string OrderExp, Util.SortDirection SortDirection) { throw new NotImplementedException(); }
public List <ORDERS> Search(ORDERS Order, int PageSize, int PageIndex, out int TotalRecords, string OrderExp, Util.SortDirection SortDirection) { return(_orderDAO.Search(Order, PageSize, PageIndex, out TotalRecords, OrderExp, SortDirection)); }
public List <CAMPAIGN> GetAll(int PageSize, int PageIndex, out int TotalRecords, string OrderExp, Util.SortDirection SortDirection) { return(_campaignDAO.GetAll(PageSize, PageIndex, out TotalRecords, OrderExp, SortDirection)); }
public List <BONUS> Search(BONUS Bonus, int PageSize, int PageIndex, out int TotalRecords, string OrderExp, Util.SortDirection SortDirection) { var result = Context.BONUS.AsQueryable(); if (Bonus != null) { if (Bonus.ID != 0) { result = result.Where(b => b.ID == Bonus.ID); } if (!String.IsNullOrEmpty(Bonus.Description)) { result = result.Where(b => b.Description.Contains(Bonus.Description)); } if (Bonus.CustomerID.HasValue) { result = result.Where(b => b.CustomerID == Bonus.CustomerID.Value); } if (!String.IsNullOrWhiteSpace(Bonus.CustomerFullName)) { result = result.Where(s => (s.CUSTOMER.Name + " " + s.CUSTOMER.Surname).Contains(Bonus.CustomerFullName)); } // useful for filtering expired bonuses if (Bonus.Validity.HasValue) { result = result.Where(b => b.Validity >= Bonus.Validity); } if (Bonus.CustomerID.HasValue) { result = result.Where(b => b.CustomerID == Bonus.CustomerID); } } TotalRecords = result.Count(); if (!String.IsNullOrEmpty(OrderExp) && OrderExp.Equals("CustomerFullName")) { if (SortDirection == SortDirection.Ascending) { result = result.OrderBy(c => c.CUSTOMER.Name).ThenBy(c => c.CUSTOMER.Surname); } else { result = result.OrderByDescending(c => c.CUSTOMER.Name).ThenBy(c => c.CUSTOMER.Surname); } } else { GenericSorterCaller <BONUS> sorter = new GenericSorterCaller <BONUS>(); result = sorter.Sort(result, string.IsNullOrEmpty(OrderExp) ? DEFAULT_ORDER_EXP : OrderExp, SortDirection); } // pagination return(result.Skip(PageIndex * PageSize).Take(PageSize).ToList()); }
public List <BONUS> GetAll(int PageSize, int PageIndex, out int TotalRecords, string OrderExp, Util.SortDirection SortDirection) { return(Search(null, PageSize, PageIndex, out TotalRecords, OrderExp, SortDirection)); }
public List <EASYPAY_PAYMENT> Search(EASYPAY_PAYMENT Entity, int PageSize, int PageIndex, out int TotalRecords, string OrderExp, Util.SortDirection SortDirection) { throw new NotImplementedException(); }
public List <SHOPPING_CART> Search(SHOPPING_CART Entity, int PageSize, int PageIndex, out int TotalRecords, string OrderExp, Util.SortDirection SortDirection) { var result = Context.SHOPPING_CART.AsQueryable(); if (Entity != null) { if (!String.IsNullOrWhiteSpace(Entity.ProductName)) { result = result.Where(s => s.PRODUCT_ATTRIBUTE.PRODUCT.Name.Contains(Entity.ProductName)); } if (!String.IsNullOrWhiteSpace(Entity.CampaignName)) { result = result.Where(s => s.CAMPAIGN.Name.Contains(Entity.CampaignName)); } if (!String.IsNullOrWhiteSpace(Entity.CustomerName)) { result = result.Where(s => (s.CUSTOMER.Name + " " + s.CUSTOMER.Surname).Contains(Entity.CustomerName)); } if (Entity.SearchStartDate.HasValue) { result = result.Where(s => s.DateAdded >= Entity.SearchStartDate.Value); } if (Entity.CampaignID != 0) { result = result.Where(s => s.CampaignID == Entity.CampaignID); } if (!String.IsNullOrWhiteSpace(Entity.ID)) { result = result.Where(s => s.ID == Entity.ID); } } TotalRecords = result.Count(); if (!String.IsNullOrEmpty(OrderExp) && OrderExp.Equals("ProductName")) { if (SortDirection == SortDirection.Ascending) { result = result.OrderBy(s => s.PRODUCT_ATTRIBUTE.PRODUCT.Name); } else { result = result.OrderByDescending(s => s.PRODUCT_ATTRIBUTE.PRODUCT.Name); } } else if (!String.IsNullOrEmpty(OrderExp) && OrderExp.Equals("CustomerName")) { if (SortDirection == SortDirection.Ascending) { result = result.OrderBy(s => s.CUSTOMER.Name).ThenBy(s => s.CUSTOMER.Surname); } else { result = result.OrderByDescending(s => s.CUSTOMER.Name).ThenBy(s => s.CUSTOMER.Surname); } } else if (!String.IsNullOrEmpty(OrderExp) && OrderExp.Equals("CampaignName")) { if (SortDirection == SortDirection.Ascending) { result = result.OrderBy(s => s.CAMPAIGN.Name); } else { result = result.OrderByDescending(s => s.CAMPAIGN.Name); } } else { GenericSorterCaller <SHOPPING_CART> sorter = new GenericSorterCaller <SHOPPING_CART>(); result = sorter.Sort(result, String.IsNullOrEmpty(OrderExp) ? "ID" : OrderExp, SortDirection); } // pagination return(result.Skip(PageIndex * PageSize).Take(PageSize).ToList()); }
public List <PRODUCT> GetAll(int PageSize, int PageIndex, out int TotalRecords, string OrderExp, Util.SortDirection SortDirection) { return(_productDAO.GetAll(PageSize, PageIndex, out TotalRecords, OrderExp, SortDirection)); }
public List <CUSTOMER> GetAll(int PageSize, int PageIndex, out int TotalRecords, string OrderExp, Util.SortDirection SortDirection) { return(_customerDAO.GetAll(PageSize, PageIndex, out TotalRecords, OrderExp, SortDirection)); }
public List <ORDER_BONUS> SearchOrderBonuses(int BonusID, int PageSize, int PageIndex, out int TotalRecords, string OrderExp, Util.SortDirection SortDirection) { return(_orderDAO.SearchOrderBonuses(BonusID, PageSize, PageIndex, out TotalRecords, OrderExp, SortDirection)); }
public List <CAMPAIGN> Search(CAMPAIGN Campaign, int PageSize, int PageIndex, out int TotalRecords, string OrderExp, Util.SortDirection SortDirection) { return(_campaignDAO.Search(Campaign, PageSize, PageIndex, out TotalRecords, OrderExp, SortDirection)); }
public List <BONUS> Search(BONUS Bonus, int PageSize, int PageIndex, out int TotalRecords, string OrderExp, Util.SortDirection SortDirection) { return(_bonusDAO.Search(Bonus, PageSize, PageIndex, out TotalRecords, OrderExp, SortDirection)); }
public List <RETURN> Search(RETURN Return, int PageSize, int PageIndex, out int TotalRecords, string OrderExp, Util.SortDirection SortDirection) { return(_returnDAO.Search(Return, PageSize, PageIndex, out TotalRecords, OrderExp, SortDirection)); }
public List <CATEGORY> Search(CATEGORY Category, int PageSize, int PageIndex, out int TotalRecords, string OrderExp, Util.SortDirection SortDirection) { return(_categoryDAO.Search(Category, PageSize, PageIndex, out TotalRecords, OrderExp, SortDirection)); }
public List <SHOPPING_CART> GetAll(int PageSize, int PageIndex, out int TotalRecords, string OrderExp, Util.SortDirection SortDirection) { return(_shoppingCartDAO.GetAll(PageSize, PageIndex, out TotalRecords, OrderExp, SortDirection)); }
public List <CATEGORY> GetAll(int PageSize, int PageIndex, out int TotalRecords, string OrderExp, Util.SortDirection SortDirection) { return(_categoryDAO.GetAll(PageSize, PageIndex, out TotalRecords, OrderExp, SortDirection)); }
public List <BRAND> Search(BRAND Brand, int PageSize, int PageIndex, out int TotalRecords, string OrderExp, Util.SortDirection SortDirection) { return(_brandDAO.Search(Brand, PageSize, PageIndex, out TotalRecords, OrderExp, SortDirection)); }
public List <D_ATTRIBUTE> Search(D_ATTRIBUTE Entity, int PageSize, int PageIndex, out int TotalRecords, string OrderExp, Util.SortDirection SortDirection) { return(_attributeDAO.Search(Entity, PageSize, PageIndex, out TotalRecords, OrderExp, SortDirection)); }
public List <CASH_PAYMENT> GetAll(int PageSize, int PageIndex, out int TotalRecords, string OrderExp, Util.SortDirection SortDirection) { throw new NotImplementedException(); }
public List <D_ATTRIBUTE> GetAll(int PageSize, int PageIndex, out int TotalRecords, string OrderExp, Util.SortDirection SortDirection) { return(_attributeDAO.GetAll(PageSize, PageIndex, out TotalRecords, OrderExp, SortDirection)); }
public List <INVITATION> GetAll(int PageSize, int PageIndex, out int TotalRecords, string OrderExp, Util.SortDirection SortDirection) { return(_invititationDAO.GetAll(PageSize, PageIndex, out TotalRecords, OrderExp, SortDirection)); }
public List <INVITATION> Search(INVITATION Entity, int PageSize, int PageIndex, out int TotalRecords, string OrderExp, Util.SortDirection SortDirection) { var result = Context.INVITATION.AsQueryable(); if (Entity != null) { if (Entity.ID != 0) { result = result.Where(b => b.ID == Entity.ID); } if (Entity.CustomerID.HasValue) { result = result.Where(i => i.CustomerID == Entity.CustomerID); } if (!String.IsNullOrEmpty(Entity.InvitedMail)) { result = result.Where(i => i.InvitedMail.Contains(Entity.InvitedMail)); } if (Entity.RegistrationDate != null) { result = result.Where(i => i.RegistrationDate == (Entity.RegistrationDate)); } } TotalRecords = result.Count(); GenericSorterCaller <INVITATION> sorter = new GenericSorterCaller <INVITATION>(); result = sorter.Sort(result, string.IsNullOrEmpty(OrderExp) ? DEFAULT_ORDER_EXP : OrderExp, SortDirection); // pagination return(result.Skip(PageIndex * PageSize).Take(PageSize).ToList()); }