public List <PETiano> GetPETianos(PETianoFilter petianoFilter = null) { if (petianoFilter == null) { petianoFilter = new PETianoFilter(); } return(_Context.PETianos .ToList()); }
public PETiano GetPETiano(PETianoFilter petianoFilter = null) { if (petianoFilter == null) { petianoFilter = new PETianoFilter(); } return(_Context.PETianos .Where(y => petianoFilter.Login == null || y.Login.Equals(petianoFilter.Login)) .FirstOrDefault()); }
private bool _IsValid(string login, string password) { PETianoFilter petianoFilter = new PETianoFilter() { Login = login }; PETiano user = _PETianoService.GetPETiano(petianoFilter); if (user != null && Crypto.VerifyHashedPassword(user.Password, password)) { return(true); } else { return(false); } }
public ActionResult Delete(int id) { PETianoFilter petianoFilter = new PETianoFilter() { Id = id }; PETiano petiano = _PETianoService.GetPETiano(petianoFilter); if (petiano != null) { return(View(petiano)); } else { return(View()); } }
public ActionResult Edit(int id) { PETianoFilter petianoFilter = new PETianoFilter() { Id = id }; PETiano petiano = _PETianoService.GetPETiano(petianoFilter); petiano.Password = Crypto.Hash(petiano.Password); if (petiano == null) { return(View()); } return(View(petiano)); }
public List <PETiano> GetPETianos(PETianoFilter petianoFilter = null) { using (IDataProvider provider = base.CreateDataProvider()) using (IPETianoRepository repository = provider.CreatePETianoRepository()) return(repository.GetPETianos(petianoFilter)); }
public List <PETiano> GetPETianos(PETianoFilter petianoFilter = null) { using (IBusinessProvider provider = base.CreateBusinessProvider()) using (IPETianoBusinessProvider prov = provider.CreatePETianoBusinessProvider()) return(prov.GetPETianos(petianoFilter)); }