예제 #1
0
 private void timer1_Tick(object sender, EventArgs e)
 {
     if (CheckConn()) { return; }
     this.Hide();
     //frmLogin frm = new frmLogin();
     frmMain frm = new frmMain();
     frm.ShowDialog();
     this.Close();
 }
예제 #2
0
        private void timer1_Tick(object sender, EventArgs e)
        {
            if (CheckConn())
            {
                return;
            }
            this.Hide();
            //frmLogin frm = new frmLogin();
            frmMain frm = new frmMain();

            frm.ShowDialog();
            this.Close();
        }
예제 #3
0
 private void btnLogin_Click(object sender, EventArgs e)
 {
     try
     {
         if (txtUserID.Text == "")
         {
             BWS.ERP.BaseControl.Public.SystemInfo("登录名不能够为空!");
             txtUserID.Focus();
             return;
         }
         if (txtPassword.Text == "")
         {
             BWS.ERP.BaseControl.Public.SystemInfo("密码不能够为空!");
             txtPassword.Focus();
             return;
         }
         int iLoginResult = BWS.ERP.Security.SecurityCenter.CheckSystemLogin(txtUserID.Text, txtPassword.Text.Trim());
         if (iLoginResult == 1)
         {
             BWS.ERP.BaseControl.ConnectSetting.SaveAppConfig("LastUserID", txtUserID.Text, true);
             lblProgress.Visible = true;
             this.Refresh();
             DataSet ds  = BWS.ERP.DataAccess.DbHelperSQL.Query(BWS.ERP.Security.SecurityCenter.GetMenuAuthSQL());
             frmMain frm = new frmMain(ds);
             this.Hide();
             //frm.CurrentUser = txtUserID.Text;
             //frm.CurrentDeptName = "系统管理员";
             frm.ShowDialog();
             this.Close();
         }
         else if (iLoginResult == 0)
         {
             BWS.ERP.BaseControl.Public.SystemInfo("用户不存在!");
             txtUserID.Focus();
         }
         else if (iLoginResult == 2)
         {
             BWS.ERP.BaseControl.Public.SystemInfo("密码错误!");
             txtPassword.Focus();
         }
     }
     catch (Exception ex)
     {
         BWS.ERP.BaseControl.Public.SystemInfo("登录错误!" + ex.Message + "\r\n 请退出系统重试!");
     }
 }
예제 #4
0
 private void btnLogin_Click(object sender, EventArgs e)
 {
     try
     {
         if (txtUserID.Text == "")
         {
             BWS.ERP.BaseControl.Public.SystemInfo("��¼�����ܹ�Ϊ�գ�");
             txtUserID.Focus();
             return;
         }
         if (txtPassword.Text == "")
         {
             BWS.ERP.BaseControl.Public.SystemInfo("���벻�ܹ�Ϊ�գ�");
             txtPassword.Focus();
             return;
         }
         int iLoginResult = BWS.ERP.Security.SecurityCenter.CheckSystemLogin(txtUserID.Text, txtPassword.Text.Trim());
         if (iLoginResult == 1)
         {
             BWS.ERP.BaseControl.ConnectSetting.SaveAppConfig("LastUserID", txtUserID.Text, true);
             lblProgress.Visible = true;
             this.Refresh();
             DataSet ds = BWS.ERP.DataAccess.DbHelperSQL.Query(BWS.ERP.Security.SecurityCenter.GetMenuAuthSQL());
             frmMain frm = new frmMain(ds);
             this.Hide();
             //frm.CurrentUser = txtUserID.Text;
             //frm.CurrentDeptName = "ϵͳ����Ա";
             frm.ShowDialog();
             this.Close();
         }
         else if (iLoginResult == 0)
         {
             BWS.ERP.BaseControl.Public.SystemInfo("�û������ڣ�");
             txtUserID.Focus();
         }
         else if (iLoginResult == 2)
         {
             BWS.ERP.BaseControl.Public.SystemInfo("�������");
             txtPassword.Focus();
         }
     }
     catch (Exception ex)
     {
         BWS.ERP.BaseControl.Public.SystemInfo("��¼����" + ex.Message + "\r\n ���˳�ϵͳ���ԣ�");
     }
 }