示例#1
0
        /// <summary>
        /// Pass username and password to web method, redirect user to show message page
        /// Set session value depends on return code
        /// </summary>
        private void OnLogin(string username, string password)
        {
            int loginResult = -99;

            LoginService.RecruitmentSoapClient client =
                new LoginService.RecruitmentSoapClient();

            try
            {
                client.Open();
                loginResult = client.Login(username, password);
            }
            catch (Exception)
            {
                loginResult = -99;
            }
            finally
            {
                if (client != null)
                {
                    client.Close();
                }

                Session.Add("Msg", AppDict[loginResult]);
                Response.Write(Session["Msg"]);
                Response.Redirect("FmShowMsg.aspx", false);
            }
        }
示例#2
0
        public static int Login(string username, string password)
        {
            int loginResult = -99;

            try
            {
                LoginService.RecruitmentSoapClient client =
                    new LoginService.RecruitmentSoapClient();

                client.Open();
                //loginResult = client.Login(username, password);
                loginResult = client.Login("*****@*****.**", "123abc");
                client.Close();
            }
            catch (Exception e) {
                e = null;
            }
            return(loginResult);
        }