public bool AddMenadzer(int hipId, int menId) { Hipermarket hip = _provider.GetById(hipId); List <Menadzer> menadzeri = _providerMen.GetAll().ToList(); foreach (Menadzer men in menadzeri) { if (men.Hipermarkets.FirstOrDefault(x => x.ID == hipId) != null) { return(false); } } _provider.AddMenadzer(hipId, menId); return(true); }
public bool AddMenadzer(int dobId, int menId) { Dobavljac_robe dob = _provider.GetById(dobId); List <Menadzer> menadzeri = _providerMen.GetAll().ToList(); foreach (Menadzer men in menadzeri) { if (men.Dobavljac_robe.FirstOrDefault(x => x.ID == dobId) != null) { return(false); } } _provider.AddMenadzer(dobId, menId); return(true); }
public IQueryable <Menadzer> GetAll(int pageIndex, int pageSize) { return(_provider.GetAll().OrderBy(k => k.Zaposleni.PRZ).Skip((pageIndex - 1) * pageSize).Take(pageSize)); }