Пример #1
0
        public static MainWin GetForm(Form form, string str, int flag)
        {
            if (f1 == null || f1.IsDisposed)
            {
                f1 = new MainWin(form, str, flag);
            }

            return(f1);
        }
Пример #2
0
 private void button1_Click_1(object sender, EventArgs e)
 {
     if (tabControl1.SelectedTab.Name == "tabPage2")
     {
         Login_stra l = new Login_stra();
         // 返回的s是该登录用户的密码
         string s = l.Login(1, textBox3.Text);
         if (textBox4.Text == s)
         {
             DataSet  ds    = new DataSet();
             SFact    sFact = new SFact();
             SOperate s1    = sFact.Select();
             ds = s1._Select("sta_name", "staff", "sta_num", textBox3.Text);
             Form f = new MainWin(this, ds.Tables[0].Rows[0][0].ToString().Trim(), 0);
             this.Hide();
             f.Show();
         }
         else
         {
             MessageBox.Show("用户名不存在或密码错误...");
         }
     }
     else if (tabControl1.SelectedTab.Name == "tabPage1")//vip
     {
         Login_stra l = new Login_stra();
         string     s = l.Login(0, textBox1.Text);
         if (textBox2.Text == s)
         {
             DataSet  ds    = new DataSet();
             SFact    sFact = new SFact();
             SOperate s1    = sFact.Select();
             ds = s1._Select("sys_name", "system", "sys_num", textBox1.Text);
             Form f = new MainWin(this, ds.Tables[0].Rows[0][0].ToString().Trim(), 1);
             this.Hide();
             f.Show();
         }
         else
         {
             MessageBox.Show("用户名不存在或密码错误...");
         }
     }
 }