Exemple #1
0
        public ResponseModel LoginUser(LoginUserModel user)
        {
            ResponseModel result = new ResponseModel();

            try
            {
                var db_user = _userM.GetUserByEmailAndPassword(user.UserName, user.Password);

                result.IsSuccess = false;

                if (db_user != null && db_user.IsActive && db_user.IsApproved)
                {
                    var currentUserModel = _userM.GetCurrentUserModel(db_user);
                    SessionVariables.SetUser(currentUserModel);
                    var do_user_log = UserBrowserHelper.getUserRequestInfo();



                    DoLogLoginUser(do_user_log);
                    result.IsSuccess = true;
                }
                else
                {
                    result.Message = "Kullanıcı adı yada şifreniz yanlış!";
                }
            }
            catch (Exception ex)
            {
                result.Message = ex.Message;
                throw;
            }

            return(result);
        }
Exemple #2
0
        public ResponseModel LoginUser(int user_id)
        {
            ResponseModel result           = new ResponseModel();
            var           db_user          = _userM.GetUserByID(user_id);
            var           currentUserModel = _userM.GetCurrentUserModel(db_user);

            SessionVariables.SetUser(currentUserModel);
            var do_user_log = UserBrowserHelper.getUserRequestInfo();

            DoLogLoginUser(do_user_log);
            result.IsSuccess = true;
            return(result);
        }