Beispiel #1
0
        private void guna2Button1_Click_1(object sender, EventArgs e)
        {
            FormDanhSachDatLich f = new FormDanhSachDatLich();

            this.Hide();
            f.ShowDialog();
            this.Show();
        }
Beispiel #2
0
 private void guna2Button2_Click_1(object sender, EventArgs e)
 {
     if (txtBHYT.Text != "" && txtCMND.Text == "")
     {
         using (var context = new YTeDbContext())
         {
             var people = context.TreEms.Where(s => s.MaTheBHYTe == txtBHYT.Text).FirstOrDefault();
             if (people == null)
             {
                 MessageBox.Show("Sai thông tin!", "Thông báo!");
             }
             else
             {
                 this.Hide();
                 FormDanhSachDatLich f = new FormDanhSachDatLich();
                 f.BHYT = people.MaTheBHYTe;
                 f.Show();
                 this.Close();
             }
         }
     }
     if (txtCMND.Text != "" && txtBHYT.Text == "")
     {
         using (var context = new YTeDbContext())
         {
             var people = context.ConNguois.Where(s => s.SoCMND == txtCMND.Text).FirstOrDefault();
             if (people == null)
             {
                 MessageBox.Show("Sai thông tin!", "Thông báo!");
             }
             else
             {
                 this.Hide();
                 FormDanhSachDatLich f = new FormDanhSachDatLich();
                 f.SoCMND = people.SoCMND;
                 f.Show();
             }
         }
     }
 }