Ejemplo n.º 1
0
        private void btnLogin_Click(object sender, EventArgs e)
        {
            try
            {
                using (TesterRecipe_Service.TesterRecipe_Service ts_rmsService = new TesterRecipe_Service.TesterRecipe_Service())
                {
                    string strDepartment = "";
                    UtilLog.Info("Verify user login :"******"Verify user login Result:" + sVerfiyResult);

                    if (sVerfiyResult.Substring(0, 4) == "True")
                    {
                        if (sVerfiyResult.Length != 8)
                        {
                            strDepartment = sVerfiyResult.Substring(4, 5);
                        }
                        else
                        {
                            strDepartment = "NONE*";
                        }

                        #region Set User Info Data
                        UtilCommonInfo.UserName = txtUserName.Text.Trim();
                        UtilCommonInfo.Password = txtPassword.Text.Trim();
                        UtilCommonInfo.Dept     = strDepartment;
                        #endregion

                        this.DialogResult = DialogResult.OK;
                    }
                    else if (sVerfiyResult.Substring(0, 4) == "miss")
                    {
                        string sMsg = "UserID or PassWord missmatch!用户名或密码不正确!";
                        UtilMessage.ShowError(sMsg);
                        this.DialogResult = DialogResult.None;
                        //return;
                    }
                }
            }
            catch (Exception ex)
            {
                string sMsg = "Remote Host Not Responding!!远端服务器没有响应!";
                UtilMessage.ShowWarn(sMsg);
                UtilLog.Error("LogIn Handle Send Message to Host Error :", ex);
            }
        }