示例#1
0
        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);
        }
示例#2
0
 public void AddUserAndOfficer(Model.Officer _officer, Model.User _user)
 {
     context.Officers.Add(_officer);
     context.Users.Add(_user);
 }