Exemple #1
0
        public ActionResult ActivateDeActivateReviewer(Int32 UserId, string FirstName, string LastName, string Email, string Type)
        {
            Users objUser = new Users();

            objUser.UserId    = UserId;
            objUser.FirstName = FirstName;
            objUser.LastName  = LastName;
            objUser.Email     = Email;
            objUser.UpdatedBy = Session["FirstName"].ToString();

            //Activate Reviewer
            if (!string.IsNullOrEmpty(Type) && Type.ToUpper().Equals("A"))
            {
                objUser.UserActivated       = true;
                objUser.UserActivationValue = Guid.NewGuid().ToString();
                objUser.Password            = CommonHelper.GenerateDynamicPassword();

                EmailHelper.SendWelcomeEmailtoReviewer(objUser);

                _review.ActivateDeActivateReviewer(objUser);

                TempData["ReviewerRegisterHeading"] = "Registration Activated!";
                TempData["ReviewerRegisterMessage"] = string.Format("Reviewer {0} {1} registration is Activated successfully.", FirstName, LastName);
            }
            //DeActivate Reviewer
            else
            {
                objUser.UserActivated       = false;
                objUser.UserActivationValue = null;
                objUser.Password            = "";
                //EmailHelper.SendWelcomeEmailtoReviewer(objUser);

                _review.ActivateDeActivateReviewer(objUser);

                TempData["ReviewerRegisterHeading"] = "Registration De-Activated!";
                TempData["ReviewerRegisterMessage"] = string.Format("Reviewer {0} {1} registration is De-Activated successfully.", FirstName, LastName);
            }

            return(View("CompleteRegister"));
        }