Пример #1
0
 private void btnLuu_Click(object sender, EventArgs e)
 {
     GanData(kh);
     if (flagLuu == 0)
     {
         // them
         if (khCtr.Add(kh))
         {
             MessageBox.Show("Thêm thành công", "Thông báo", MessageBoxButtons.OK, MessageBoxIcon.Information);
         }
         else
         {
             MessageBox.Show("Chưa thành công", "Thông báo", MessageBoxButtons.OK, MessageBoxIcon.Error);
         }
     }
     else
     {
         // sua
         if (khCtr.Update(kh))
         {
             MessageBox.Show("Sửa thành công", "Thông báo", MessageBoxButtons.OK, MessageBoxIcon.Information);
         }
         else
         {
             MessageBox.Show("Chưa thành công", "Thông báo", MessageBoxButtons.OK, MessageBoxIcon.Error);
         }
     }
     frmKhachHang_Load(sender, e);
 }
Пример #2
0
        private void UpdateCommand()
        {
            var kh = (CAT_KhachHang)gridView.GetFocusedRow();
            int rs = KhachHangCtrl.Update(kh);

            if (rs == 0)
            {
                NotifyHelper.ShowUpdateError();
                gridControl_Load();
            }
        }