Пример #1
0
 public UserDTO ValidateUser(UserDTO user)
 {
     UserManager MU = new UserManager();
     //UserDTO uesrDetail = MU.ValidateUser(user);
     //return uesrDetail;
     return null;
 }
Пример #2
0
        public ActionResult UserLogin(UserModel userModel)
        {
            UserManager userMgr = new UserManager();
            userModel = userMgr.ValidateUser(userModel.UserName, userModel.Password);

            if (userModel.Id > 0)
            {
                SetLoginSession(userModel);
                return RedirectToAction("CheckOut", new RouteValueDictionary(new { controller = "Shop", action = "CheckOut" }));
            }
            return RedirectToAction("Login", "Home");
        }
Пример #3
0
 public bool CreateUser(UserDTO user)
 {
     bool status = false;
     UserManager MU = new UserManager();
     try
     {
         status = MU.CreateUser(user);
     }
     catch (Exception ex)
     {
         throw ex;
     }
     return status;
 }
Пример #4
0
        public static bool CreateUser(UserModel user)
        {
            UserManager userMgr = new UserManager();
            bool status = false;

            UserDTO toReturn = new UserDTO();
            //toReturn.MLoginID = user.MLoginID;
            //toReturn.MLoginFirstName = user.MLoginFirstName;
            //toReturn.MLoginLastName = user.MLoginLastName;
            //toReturn.MLoginAddress = user.MLoginAddress;
            //toReturn.MLoginState = user.MLoginState;
            //toReturn.MLoginCountry = user.MLoginCountry;
            //toReturn.MLoginCity = user.MLoginCity;
            //toReturn.MLoginZip = user.MLoginZip;

            status = userMgr.CreateUser(toReturn);
            return status;
        }
Пример #5
0
        public static UserModel GetUserDetails(int userId)
        {
            UserDTO user = new UserDTO();
            UserManager userMgr = new UserManager();

            //user = userMgr.GetUserDetails(userId);
            UserModel toReturn = new UserModel();

            if (user != null)
            {
                //toReturn.MLoginID = user.MLoginID;
                //toReturn.MLoginFirstName = user.MLoginFirstName;
                //toReturn.MLoginLastName = user.MLoginLastName;
                //toReturn.MLoginAddress = user.MLoginAddress;
                //toReturn.MLoginState = user.MLoginState;
                //toReturn.MLoginCountry = user.MLoginCountry;
                //toReturn.MLoginCity = user.MLoginCity;
                //toReturn.MLoginZip = user.MLoginZip;
            }

            return toReturn;
        }
Пример #6
0
 public static bool ValidateUser(UserModel user, out List<DataError> dataError)
 {
     bool IsValidate = false;
     dataError = null;
     UserDTO userDetail = new UserDTO();
     if (user.Validate(UseralidationType.LoginUser, out dataError))
     {
         UserManager userMgr = new UserManager();
         //userDetail = userMgr.ValidateUser(new UserDTO { MLoginRightsUserID = user.MLoginRightsUserID, MLoginRightsPassword = user.MLoginRightsPassword });
         userDetail = null;
         //if (userDetail != null)
         //{
         //    user.MLoginID = userDetail.MLoginID;
         //    IsValidate = true;
         //}
         //else
         //{
         //    IsValidate = false;
         //    dataError.Add(new DataError() { PropertyName = "Message", ErrorDescription = ErrorMessages.User.InValidCredential });
         //}
         return IsValidate;
     }
     return IsValidate;
 }
Пример #7
0
 public UserDTO GetUserDetails(int userId)
 {
     UserManager MU = new UserManager();
     //UserDTO uesrDetail = MU.GetUserDetails(userId);
     return null; //uesrDetail;
 }
Пример #8
0
 public ActionResult CheckOut()
 {
     UserManager userMgr = new UserManager();
     UserModel userModel = userMgr.GetUserDetails(GetLoggedInUserId());
     return View(userModel);
 }