Пример #1
0
        public ActionResult Register(UsersListModel register)
        {
            if (register.Password != register.ConfirmPassword)
            {
                @TempData["FirstName"]   = register.FirstName;
                @TempData["LastName"]    = register.LastName;
                @TempData["Email"]       = register.Email;
                @TempData["PhoneNumber"] = register.PhoneNumber;
                @TempData["REGISTER"]    = "REGISTER";
                @TempData["message"]     = "Passwords dont match";

                return(RedirectToAction("Register"));
            }
            var mes = UsersSQL.AddUser(register);

            if (mes.Status == "success")
            {
                return(RedirectToAction("../Home/Index"));
            }
            else
            {
                @TempData["FirstName"]   = register.FirstName;
                @TempData["LastName"]    = register.LastName;
                @TempData["Email"]       = register.Email;
                @TempData["PhoneNumber"] = register.PhoneNumber;
                @TempData["REGISTER"]    = "REGISTER";
                @TempData["message"]     = "Failed! Check details and then retry";

                return(RedirectToAction("Register"));
            }
        }
Пример #2
0
 public JsonResult EditUser([FromBody] User user)
 {
     return(Json(UsersSQL.EditUser(user), JsonRequestBehavior.AllowGet));
 }
Пример #3
0
        public JsonResult AssignGroup([FromBody] UserGroup user)
        {
            string AddedBy = Constant.GetUserID();

            return(Json(UsersSQL.AssignGroup(user, AddedBy), JsonRequestBehavior.AllowGet));
        }
Пример #4
0
 public JsonResult GetNewUsers()
 {
     return(Json(UsersSQL.GetNewUsers()));
 }
Пример #5
0
 public JsonResult GetUsers()
 {
     return(Json(UsersSQL.GetUsers(), JsonRequestBehavior.AllowGet));
 }