Ejemplo n.º 1
0
        public void register(UserDto user)
        {
            Users newUser = new Users();

            newUser.CreatedDate = DateTime.Now;
            newUser.Role = RoleDAO.getRoleById(CONST.ROLE.NORMALUSER);
            newUser.Status = null;
        }
Ejemplo n.º 2
0
        public ActionResult LoginRequest(String Username, String Password)
        {
            //Check login

            if (UserHandler.AdminLogin(Username, Password) == CONST.ROLE.ADMIN)
            {
                UserDto currentUser = new UserDto();
                currentUser.Username = Username;
                currentUser.Password = Password;
                Session[CONST.SESSION.USER] = currentUser;
                Session[CONST.SESSION.MESSAGE] = MessageHandler.CountMessageUnread();
                return RedirectToAction("Index", "Admin");
            }
            else if (UserHandler.AdminLogin(Username, Password) == CONST.ROLE.MOD)
            {
                UserDto currentUser = new UserDto();
                currentUser.Username = Username;
                currentUser.Password = Password;
                Session[CONST.SESSION.USER] = currentUser;
                Session[CONST.SESSION.MESSAGE] = MessageHandler.CountMessageUnread();
                return RedirectToAction("Index", "Mod");
            }
            return RedirectToAction("Login", "Admin");
        }
Ejemplo n.º 3
0
 public ActionResult Index()
 {
     UserDto newU = new UserDto();
     //newU.addUser();
     return View();
 }