Example #1
0
        private void frm_InputData_FormClosed(object sender, FormClosedEventArgs e)
        {
            this.Hide();
            frm_Main frm_main = new frm_Main();

            frm_main.ShowDialog();
        }
Example #2
0
 private void btnLogin_Click(object sender, EventArgs e)
 {
     if (cbRemember.Checked)
     {
         CreateInfo();
     }
     else
     {
         tool.Write(pathfile, "Infor", "User", "");
         tool.Write(pathfile, "Infor", "Remember", "false");
         tool.Write(pathfile, "Infor", "Language", "-1");
     }
     if (txtUser.Text == "")
     {
         lbwarning1.Visible = true;
         txtUser.Focus();
     }
     else
     {
         if (txtPassword.Text == "")
         {
             lbwarning2.Visible = true;
             txtPassword.Focus();
         }
         else
         {
             if (cbbLanguage.Text == "")
             {
                 lbwarning3.Visible = true;
                 cbbLanguage.Focus();
             }
             else
             {
                 string sql = "select * from tb_User where Password='******' and UserCode='" + txtUser.Text + "'";
                 MessageBox.Show("sql =" + sql);
                 DataTable dt = conn.GetDataTable(sql);
                 if (dt.Rows.Count == 1)
                 {
                     tool.Write(pathfile, "Infor", "Language", cbbLanguage.SelectedIndex.ToString());
                     this.Hide();
                     AssyLineSystem.frm_Main frm = new AssyLineSystem.frm_Main();
                     frm.user__ = txtUser.Text;
                     frm.ShowDialog();
                     this.Close();
                 }
                 else
                 {
                     frm_MessageWarning warning = new frm_MessageWarning();
                     warning.index = 3;
                     warning.ShowDialog();
                 }
             }
         }
     }
 }