public ActionResult Register(RegistrationModel register)
        {
            using (BusinessLogicLayer.ContextBLL ctx = new BusinessLogicLayer.ContextBLL())
            {
                BusinessLogicLayer.UserBLL user = ctx.UserFindByEMail(register.Email);
                if (user != null)
                {
                    register.Message = $"The Email address '{register.Email}' has already been registered.";
                    return(View(register));
                }
                user          = new UserBLL();
                user.UserName = register.UserName;
                user.Name     = register.Name;
                user.Address  = register.Address;
                user.Email    = register.Email;
                user.Salt     = System.Web.Helpers.Crypto.GenerateSalt(MuhConstants.SaltSize);
                user.Hash     = System.Web.Helpers.Crypto.HashPassword(register.Password + user.Salt);
                user.RoleID   = 3;

                ctx.UserCreate(user);
                Session["AUTHUserName"] = user.Email;
                Session["AUTHRoles"]    = user.RoleID;
                Session["AUTHTYPE"]     = "HASHED";
                return(RedirectToAction("Index"));
            }
        }
        public ActionResult Create(UserBLL user)
        {
            try
            {
                // TODO: Add insert logic here
                using (BusinessLogicLayer.ContextBLL ctx = new BusinessLogicLayer.ContextBLL())
                {
                    ctx.UserCreate(user.UserName, user.Name, user.Address, user.Email, user.Hash, user.Salt, user.RoleID);
                }

                return(RedirectToAction("Index"));
            }
            catch (Exception ex)
            {
                Logger.Logger.Log(ex);
                return(View("Error"));
            }
        }