Esempio n. 1
0
 /// <summary>
 /// 退出系统
 /// </summary>
 public void Closed()
 {
     try
     {
         if ("0" == Function.ComForm.DspMsg("Q001", ""))
         {
             // 删除登录信息
             WinMenuPro fr = (WinMenuPro)Application.OpenForms["WinMenuPro"];
             if (fr != null)
             {
                 fr.Close();
             }
             this.Close();
             Application.Exit();
         }
         else
         {
             return;
         }
     }
     catch (Exception ex)
     {
         ComForm.DspMsg("E001", "");
         //MessageBox.Show("系统出现问题,请与管理员联系!");
         return;
     }
 }
Esempio n. 2
0
        private void btn_Login_Click(object sender, EventArgs e)
        {
            //btn_Login.Text = "正在登录...";
            //Application.DoEvents();
            string UserName = Function.ComForm.strUserName = txtUserName.Text.Trim().ToLower().Replace("'", "");

            ComForm.strSymc = UserNameLab.Text.Trim();
            string PassWord = txtPass.Text.Trim().Replace("'", "");

            Function.Const.SYBH = ComForm.strUserName;
            if (UserName == string.Empty)
            {
                ComForm.DspMsg("W001", "");
                this.txtUserName.Focus();
                return;
            }
            if (PassWord == string.Empty)
            {
                ComForm.DspMsg("W005", "");
                this.txtPass.Focus();
                return;
            }
            if (CheckUserPass(UserName, PassWord))
            {
                // 管理员权限登录,打开FirstPage菜单
                WinMenuPro fr = (WinMenuPro)Application.OpenForms["WinMenuPro"];
                if (fr != null)
                {
                    fr.Close();
                    WinMenuPro Main = new WinMenuPro();
                    Main.Show();
                }
                else
                {
                    WinMenuPro Main = new WinMenuPro();
                    Main.Show();
                }
                this.txtUserName.Focus();
                this.Hide();
                //btn_Login.Text = "登  录";
                ClearItems();
            }
            else
            {
                ComForm.DspMsg("W101", "");
                this.txtPass.Focus();
                return;
            }
        }