public ContentResult UserRegistation(RegistationDo model)//bool IsAuthantication
        {
            string message = string.Empty;

            if (ModelState.IsValid)
            {
                var  Emailtoken = ConfirmAccount(model);
                bool flag       = false;
                RegistationController registationController = new RegistationController();
                flag = registationController.AddUserRedistation(model);

                if (flag == true)
                {
                    return(Content("User Insert SucessFully"));
                }
                else
                {
                    return(Content("Email Id Is Already Exist"));
                }
            }
            return(Content("Error"));
            // }
            //  return View();
            // return Json(new { Resut = "ok", Record = registationDo }, JsonRequestBehavior.AllowGet);
        }
        public ActionResult UpdateUsers(RegistationDo registationDo)
        {
            RegistationController EmpRepo = new RegistationController();

            EmpRepo.UpdateRegistation(registationDo);//.Single(mem => mem.UserId == Id);
            return(RedirectToAction("AllUser", "Account"));
        }
        public ActionResult EditUsers(int Id)
        {
            RegistationController EmpRepo       = new RegistationController();
            RegistationDo         registationDo = EmpRepo.UserbyUserId(Id);

            return(View(registationDo));
        }
 public ActionResult Edit(int Id)
 {
     if (ModelState.IsValid)
     {
         RegistationController RegistationController = new RegistationController();
         RegistationDo         registationDo         = RegistationController.UserbyUserId(Id);
         return(View(registationDo));
     }
     return(View());
 }
        public ActionResult ConfirmAccount(RegistationDo model)
        {
            // var token = WebSecurity.CreateUserAndAccount(model.UserName, model.Password, null, true);
            //return View("ConfirmAccount");
            var confirmationToken = Request["token"];

            if (!String.IsNullOrEmpty(confirmationToken))
            {
                var user = WebSecurity.CurrentUserName;
                WebSecurity.ConfirmAccount(confirmationToken);
                WebSecurity.Login(user, null);
                return(View("Welcome"));
            }

            TempData["message"] = string.Format(
                "Your account was not confirmed, please try again or contact the website adminstrator.");
            return(RedirectToAction("Index", "Home"));
        }
        public ActionResult LogOn(LogOnModel model, string returnUrl)
        {
            RegistationDo user = new RegistationDo();

            Session["LOGGED_User"] = user;
            if (model.UserName != null)
            {
                if (model.Password != null)
                {
                    RegistationController registationController = new RegistationController();
                    // user = RegistationController.UserbyUserId(model.UserName);
                    var LoginType = registationController.UserIdbyPassword(model.UserName, model.Password, model.CompanyName);
                    if (LoginType.Password == model.Password && LoginType.UserName == model.UserName)
                    {
                        //FormsAuthentication.SetAuthCookie(LoginType.UserName,false);
                        Session["LOGGED_USER"]         = LoginType;
                        Session["LOGGED_User_NAME"]    = LoginType.UserName;
                        Session["LOGGED_MEMBER_EMAIL"] = LoginType.Email;
                        Session["LOGGED_UserId"]       = LoginType.Userid;
                        Session["LOGGED_ROLE"]         = LoginType.Role;
                        Session["LOGGED_Company"]      = LoginType.Company;
                        Session["LOGGED_Connectiondb"] = LoginType.Connectiondb;
                        if (LoginType.UserName == "Shivanks")
                        {
                            return(RedirectToAction("DashBoard", "Account"));
                        }
                        //  return RedirectToAction("DashboardWorkFlow", "Dashboard", new { area = "Admin" });
                        //  return Redirect("Dashboard/DashboardWorkFlow");
                        return(RedirectToAction("DashboardWorkFlow", "Dashboard"));
                    }
                    else
                    {
                        ModelState.AddModelError("", "");
                    }
                }
            }
            else
            {
                ModelState.AddModelError("", "");
            }

            return(View());
        }