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();
 }
 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 ���˳�ϵͳ���ԣ�");
     }
 }