internal List <MENUITEM> GetActives() { using (entity = new klassycafeEntities()) { menuItemRepo = new GenericRepo <MENUITEM>(entity); return(menuItemRepo.Select(mc => mc.STATE_ID == 1).ToList()); } }
internal List <MENUITEM> GetForMenuSlider() { using (entity = new klassycafeEntities()) { menuItemRepo = new GenericRepo <MENUITEM>(entity); return(menuItemRepo.Select(mc => mc.STATE_ID == 1 && (bool)mc.MENUSLIDER_SHOW).ToList()); } }
internal void Add(MENUITEM menuitem) { using (entity = new klassycafeEntities()) { menuItemRepo = new GenericRepo <MENUITEM>(entity); menuItemRepo.Insert(menuitem); menuItemRepo.Save(); } }
internal void Update(CONTACT CONTACT) { using (entity = new klassycafeEntities()) { ContactRepo = new GenericRepo <CONTACT>(entity); ContactRepo.Update(CONTACT); ContactRepo.Save(); } }
internal void Remove(int id) { using (entity = new klassycafeEntities()) { menuItemRepo = new GenericRepo <MENUITEM>(entity); menuItemRepo.Delete(id); menuItemRepo.Save(); } }
internal void Edit(CHEF chef) { using (entity = new klassycafeEntities()) { chefRepo = new GenericRepo <CHEF>(entity); chefRepo.Update(chef); chefRepo.Save(); } }
internal void Remove(int id) { using (entity = new klassycafeEntities()) { chefRepo = new GenericRepo <CHEF>(entity); chefRepo.Delete(id); chefRepo.Save(); } }
internal void Remove(int id) { using (entity = new klassycafeEntities()) { reservationRepo = new GenericRepo <RESERVATION>(entity); reservationRepo.Delete(id); reservationRepo.Save(); } }
internal void Add(CHEF chef) { using (entity = new klassycafeEntities()) { chefRepo = new GenericRepo <CHEF>(entity); chefRepo.Insert(chef); chefRepo.Save(); } }
internal void Edit(RESERVATION reservation) { using (entity = new klassycafeEntities()) { reservationRepo = new GenericRepo <RESERVATION>(entity); reservationRepo.Update(reservation); reservationRepo.Save(); } }
internal void Edit(MENUITEM menuitem) { using (entity = new klassycafeEntities()) { menuItemRepo = new GenericRepo <MENUITEM>(entity); menuItemRepo.Update(menuitem); menuItemRepo.Save(); } }
internal void Add(RESERVATION reservation) { using (entity = new klassycafeEntities()) { reservation.CREATED_DATE = DateTime.Now; reservationRepo = new GenericRepo <RESERVATION>(entity); reservationRepo.Insert(reservation); reservationRepo.Save(); } }
internal bool IsLoginOK(USER user) { bool isLoginOk = false; using (entity = new klassycafeEntities()) { userRepo = new GenericRepo <USER>(entity); USER _user = userRepo.FindByLambda(u => u.EMAIL == user.EMAIL && u.PASSWORD == user.PASSWORD); if (_user != null) { isLoginOk = true; } } return(isLoginOk); }
internal CHEFLIST GetByIdForList(int id) { using (entity = new klassycafeEntities()) { chefRepo = new GenericRepo <CHEF>(entity); stateRepo = new GenericRepo <STATE>(entity); CHEF chef = chefRepo.FindByID(id); return(new CHEFLIST() { chef = chef, stateName = stateRepo.FindByID(chef.STATE_ID).NAME }); } }
internal RESERVATIONLIST GetByIdForList(int id) { using (entity = new klassycafeEntities()) { reservationRepo = new GenericRepo <RESERVATION>(entity); stateRepo = new GenericRepo <RESERVATIONSTATE>(entity); RESERVATION reservation = reservationRepo.FindByID(id); return(new RESERVATIONLIST() { reservation = reservation, reservationStateName = stateRepo.FindByID(reservation.RESERVATIONSTATE_ID).NAME }); } }
internal MENUITEMLIST GetByIdForList(int id) { using (entity = new klassycafeEntities()) { menuItemRepo = new GenericRepo <MENUITEM>(entity); stateRepo = new GenericRepo <STATE>(entity); menuCategoryRepo = new GenericRepo <MENUCATEGORY>(entity); MENUITEM menuitem = menuItemRepo.FindByID(id); STATE state = stateRepo.FindByID(menuitem.STATE_ID); MENUCATEGORY menucategory = menuCategoryRepo.FindByID(menuitem.MENUCATEGORY_ID); return(new MENUITEMLIST() { item = menuitem, stateName = state.NAME, categoryName = menucategory.TITLE }); } }
internal List <RESERVATIONLIST> GetLast(int count) { using (entity = new klassycafeEntities()) { reservationRepo = new GenericRepo <RESERVATION>(entity); stateRepo = new GenericRepo <RESERVATIONSTATE>(entity); List <RESERVATION> rs = reservationRepo.Select().OrderByDescending(r => r.CREATED_DATE).Take(count).ToList(); List <RESERVATIONLIST> rList = new List <RESERVATIONLIST>(); foreach (RESERVATION r in rs) { rList.Add(new RESERVATIONLIST() { reservation = r, reservationStateName = stateRepo.FindByID(r.RESERVATIONSTATE_ID).NAME }); } return(rList); } }
internal List <CHEFLIST> GetAllForList() { using (entity = new klassycafeEntities()) { chefRepo = new GenericRepo <CHEF>(entity); stateRepo = new GenericRepo <STATE>(entity); List <CHEF> cs = chefRepo.Select().ToList(); List <CHEFLIST> cList = new List <CHEFLIST>(); foreach (CHEF c in cs) { cList.Add(new CHEFLIST() { chef = c, stateName = stateRepo.FindByID(c.STATE_ID).NAME }); } return(cList); } }
internal List <RESERVATIONLIST> GetAllForList() { using (entity = new klassycafeEntities()) { reservationRepo = new GenericRepo <RESERVATION>(entity); stateRepo = new GenericRepo <RESERVATIONSTATE>(entity); List <RESERVATION> rs = reservationRepo.Select().ToList(); List <RESERVATIONLIST> rList = new List <RESERVATIONLIST>(); foreach (RESERVATION r in rs) { rList.Add(new RESERVATIONLIST() { reservation = r, reservationStateName = stateRepo.FindByID(r.RESERVATIONSTATE_ID).NAME }); } return(rList); } }
internal List <MENUITEMLIST> GetAllForList() { using (entity = new klassycafeEntities()) { menuItemRepo = new GenericRepo <MENUITEM>(entity); stateRepo = new GenericRepo <STATE>(entity); menuCategoryRepo = new GenericRepo <MENUCATEGORY>(entity); List <MENUITEM> mis = menuItemRepo.Select().ToList(); List <MENUITEMLIST> milist = new List <MENUITEMLIST>(); foreach (MENUITEM mi in mis) { milist.Add(new MENUITEMLIST() { item = mi, stateName = stateRepo.FindByID(mi.STATE_ID).NAME, categoryName = menuCategoryRepo.FindByID(mi.MENUCATEGORY_ID).TITLE }); } return(milist); } }
public GenericRepo(klassycafeEntities context) { _context = context; _dbSet = _context.Set <T>();; }