Ejemplo n.º 1
0
        public string GetAuthenticateUserRoleAndID(GetAuthRequest argObj)
        {
            string userRole = string.Empty;

            try
            {
                AdminDAL objAdminDAL = new AdminDAL();
                string   arr         = objAdminDAL.GetAuthenticateUserRoleAndID(argObj);
                userRole = arr;
            }
            catch (Exception ex)
            {
            }
            return(userRole);
        }
Ejemplo n.º 2
0
        private bool AuthenticateUser()
        {
            AdminBLL        ws         = new AdminBLL();
            UserInformation _oUserInfo = new UserInformation();
            GetAuthRequest  _req       = new GetAuthRequest();

            try
            {
                _oUserInfo.UserID       = txtUserName.Text;
                _oUserInfo.UserPassword = txtPassword.Text;
                _req.UserInfo           = _oUserInfo;
            }
            catch (Exception ex)
            {
                //Response.Write(ex.Message);
            }
            return(ws.AuthenticateUser(_req));
        }
Ejemplo n.º 3
0
        private string GetAuthenticateUserRoleAndID()
        {
            AdminBLL ws = new AdminBLL();
            UserInformation _oUserInfo = new UserInformation();
            GetAuthRequest _req = new GetAuthRequest();
            try
            {

                _oUserInfo.UserID = username;
                _oUserInfo.UserPassword = password;

                _req.UserInfo = _oUserInfo;
            }
            catch (Exception ex)
            {
                //Response.Write(ex.Message);
            }
            return ws.GetAuthenticateUserRoleAndID(_req);
        }
Ejemplo n.º 4
0
        public DataSet GetMenuItems(GetAuthRequest argObj)
        {
            DataSet  ds          = null;
            AdminDAL objAdminDAL = null;

            try
            {
                objAdminDAL = new AdminDAL();
                ds          = objAdminDAL.GetMenuItems(argObj);
                //Creating relation between menu parent and child.
                ds.DataSetName = "Menus";
            }

            catch (Exception ex)
            {
                throw ex;
            }
            return(ds);
        }
Ejemplo n.º 5
0
        public bool AuthenticateUser(GetAuthRequest argObj)
        {
            bool bAuth = false;

            try
            {
                AdminDAL objAdminDAL = new AdminDAL();

                List <GetAuthResponse> arr = objAdminDAL.AuthenticateUser(argObj);
                if (arr.Count > 0)
                {
                    bAuth = true;
                }
            }
            catch (Exception ex)
            {
            }
            return(bAuth);
        }
Ejemplo n.º 6
0
        public async Task <ActionResult> GetAuth([FromRoute] string type, [FromQuery] GetAuthRequest request)
        {
            var oAuthType   = OAuthType.Parse(type);
            var host        = ApiUtils.GetHost(Request);
            var redirectUrl = request.RedirectUrl;

            if (string.IsNullOrEmpty(redirectUrl))
            {
                redirectUrl = ApiUtils.GetHomeUrl();
            }

            var url = string.Empty;

            if (oAuthType == OAuthType.Weixin)
            {
                var settings = await _loginManager.GetWeixinSettingsAsync();

                var client = new WeixinClient(settings.WeixinAppId, settings.WeixinAppSecret, host, redirectUrl);
                url = client.GetAuthorizationUrl();
            }
            else if (oAuthType == OAuthType.Qq)
            {
                var settings = await _loginManager.GetQqSettingsAsync();

                var client = new QqClient(settings.QqAppId, settings.QqAppKey, host, redirectUrl);
                url = client.GetAuthorizationUrl();
            }
            else if (oAuthType == OAuthType.Weibo)
            {
                var settings = await _loginManager.GetWeiboSettingsAsync();

                var client = new WeiboClient(settings.WeiboAppKey, settings.WeiboAppSecret, host, redirectUrl);
                url = client.GetAuthorizationUrl();
            }

            if (!string.IsNullOrEmpty(url))
            {
                return(Redirect(url));
            }

            return(this.Error("类型不正确"));
        }
Ejemplo n.º 7
0
 private bool AuthenticateUser()
 {
     AdminBLL ws = new AdminBLL();
     UserInformation _oUserInfo = new UserInformation();
     GetAuthRequest _req = new GetAuthRequest();
     try
     {
         /*_oUserInfo.UserID = username;
         _oUserInfo.UserPassword = password;
         _req.UserInfo = _oUserInfo;*/
         Session[SMSAppUtilities.SessionKeys.SESSION_LOGIN_USER] = Session[SMSAppUtilities.SessionKeys.SESSION_LOGIN_USER_ID] = _oUserInfo.UserID = username;
         _oUserInfo.UserPassword = password;
         _req.UserInfo = _oUserInfo;
     }
     catch (Exception ex)
     {
         //Response.Write(ex.Message);
     }
     return ws.AuthenticateUser(_req);
 }
Ejemplo n.º 8
0
        private bool AuthenticateUser()
        {
            log4net.ILog    logger     = log4net.LogManager.GetLogger("File");
            AdminBLL        ws         = new AdminBLL();
            UserInformation _oUserInfo = new UserInformation();
            GetAuthRequest  _req       = new GetAuthRequest();

            try
            {
                try
                {
                    //Session["userid"] = TextBox1.Text;
                    Session[SMSAppUtilities.SessionKeys.SESSION_LOGIN_USER] = Session[SMSAppUtilities.SessionKeys.SESSION_LOGIN_USER_ID] = _oUserInfo.UserID = txtUsername.Text;
                    _oUserInfo.UserPassword = txtPassword.Text;
                    _req.UserInfo           = _oUserInfo;
                }
                catch (Exception ex)
                {
                    logger.Info("Error:" + ex.Message);
                }
            }
            catch (Exception ex) { logger.Info("Error:" + ex.Message); Response.Write(ex.Message); }
            return(ws.AuthenticateUser(_req));
        }