Exemple #1
0
 public DataAccessLayer.Models.Login JsonToEntity()
 {
     DataAccessLayer.Models.Login newLogin = new DataAccessLayer.Models.Login
     {
         Username = this.Username,
         Password = this.Password,
         RoleId   = this.RoleId
     };
     return(newLogin);
 }
Exemple #2
0
        public bool CreateLogin(Login login)
        {
            bool status = false;

            try
            {
                login.RoleId = 1;
                DataAccessLayer.Models.Login newLogin = login.JsonToEntity();
                status = repo.CreateLogin(newLogin);
                if (status)
                {
                    repo.SetUserLogin(login.userId, newLogin.LoginId);
                }
            }
            catch (Exception) { status = false; }
            return(status);
        }