Exemplo n.º 1
0
        public JsonResult RegisterSys(User user)
        {
            //this method will check the given email is already is existed, if not so register the user with form details
            HomeService service = new HomeService();
            //check mail is already exists
            int id = service.CheckEmailExists(user.Email);

            if (id > 0)
            {
                return(Json(new { Status = false, Message = "Email already exists..." }, JsonRequestBehavior.AllowGet));
            }
            else
            {
                //register the user
                int UserId = service.Register(user);
                if (UserId > 0)
                {
                    return(Json(new { Status = true, Message = "Successfully  registered..." }, JsonRequestBehavior.AllowGet));
                }
                else
                {
                    return(Json(new { Status = false, Message = "Check your network connection..." }, JsonRequestBehavior.AllowGet));
                }
            }
        }