Exemple #1
0
 private void btnXoa_Click(object sender, EventArgs e)
 {
     if (IDmember != null)
     {
         if (IDmember == "HSDEL")
         {
             MessageBox.Show("Không thể xóa", "Thông báo", MessageBoxButtons.OK, MessageBoxIcon.Information);
             return;
         }
         if (MessageBox.Show("Bạn có muốn xóa dữ liệu đã chọn", "Thông báo", MessageBoxButtons.YesNo, MessageBoxIcon.Warning) == DialogResult.Yes)
         {
             if (HocSinhController.XoaHS(IDmember))
             {
                 MessageBox.Show("Xóa thành công", "Thông báo", MessageBoxButtons.OK, MessageBoxIcon.Information); Hienthi();
                 IDmember = null;
             }
             else
             {
                 MessageBox.Show("Xóa Không thành công", "Lỗi", MessageBoxButtons.OK, MessageBoxIcon.Error);
             }
         }
     }
     else
     {
         MessageBox.Show("Vui lòng chọn 1 Bản ghi", "Thông báo", MessageBoxButtons.OK, MessageBoxIcon.Error);
     }
 }
Exemple #2
0
        private void Action(char c)
        {
            switch (c)
            {
            case '1':
                ErrHelper.Log(hs.ThemHS(new HocSinh(InputType.Insert)));
                break;

            case '2':
                ErrHelper.Log(hs.SuaTTHS(new HocSinh(InputType.Update)));
                break;

            case '3':
                ErrHelper.Log(hs.XoaHS(new HocSinh(InputType.Delete)));
                break;

            case '4':
                ErrHelper.Log(hs.ChuyenLopChoHS(new HocSinh(InputType.Update)));
                break;
            }
            Console.ReadKey();
            Menu();
        }