public bool AuthUser(Model.User _user) { var user = context.Users.Where(i => _user.Email == i.Email && _user.Password == i.Password); if (user.Count() > 0) { AuthorizedUser = user.FirstOrDefault(); Officer = context.Officers.Where(i => AuthorizedUser.IdUser == i.IdOfficer).FirstOrDefault(); return(true); } return(false); }
public void AddUserAndOfficer(Model.Officer _officer, Model.User _user) { context.Officers.Add(_officer); context.Users.Add(_user); }