Example #1
0
 private void Edit_Click(object sender, EventArgs e)
 {
     Phong.Tenphong = Tenphong.Text;
     //source.Add(Phong);
     source[DgPhong.CurrentRowIndex] = Phong;
     Phong = new ClsPhong();
     ClearData();
     DgPhong.Refresh();
 }
Example #2
0
 private void Add_Click(object sender, EventArgs e)
 {
     Phong.Maphong  = int.Parse(Maphong.Text.ToString());
     Phong.Tenphong = Tenphong.Text;
     Phong.Sogiuong = int.Parse(Sogiuong.Text.ToString());
     source.Add(Phong);
     Phong = new ClsPhong();
     ClearData();
     DgPhong.Refresh();
 }
Example #3
0
 private void Delete_Click(object sender, EventArgs e)
 {
     try
     {
         ClsPhong currentNhanvien = (ClsPhong)source[DgPhong.CurrentRowIndex];
         source.RemoveAt(DgPhong.CurrentRowIndex);
     }
     catch (Exception ex)
     {
         MessageBox.Show(ex.ToString());
     }
 }