Esempio n. 1
0
 public void XoaBangCap(string maBangCap)
 {
     try
     {
         BangCapDAO BangCap = new BangCapDAO();
         BangCap.XoaBangCap(maBangCap);
     }
     catch (Exception)
     {
         throw;
     }
 }
Esempio n. 2
0
 public void SuaBangCap(string tenBangCap, string maBangCap)
 {
     try
     {
         BangCapDAO BangCap = new BangCapDAO();
         BangCap.SuaBangCap(tenBangCap, maBangCap);
     }
     catch (Exception)
     {
         throw;
     }
 }
Esempio n. 3
0
 public DataTable LayDanhSachBangCap()
 {
     try
     {
         BangCapDAO dsBangCap = new BangCapDAO();
         DataTable  table     = dsBangCap.LayDanhSachBangCap();
         return(table);
     }
     catch (SqlException ex)
     {
         throw ex;
     }
 }
Esempio n. 4
0
 public void ThemBangCap(string tenBangCap)
 {
     try
     {
         BangCapDAO BangCap   = new BangCapDAO();
         DataTable  dsBangCap = BangCap.LayDanhSachBangCap();
         string     maBangCap = "BC" + (int.Parse(dsBangCap.Rows[dsBangCap.Rows.Count - 1][0].ToString().Substring(2, 2)) + 1).ToString("00");
         BangCap.ThemBangCap(tenBangCap, maBangCap);
     }
     catch (Exception)
     {
         throw;
     }
 }
Esempio n. 5
0
 private void btnXoa_Click(object sender, EventArgs e)
 {
     try
     {
         int idbangcap = Convert.ToInt32(grvBangCap.GetFocusedDataRow()["BANGCAPID"].ToString());
         int idnv      = (int)cboBangCap.SelectedValue;
         if (BangCapDAO.DeleteBangCap(idbangcap) == 1)
         {
             MessageBox.Show("thành công");
         }
         else
         {
             MessageBox.Show("thất bại");
         }
         LoadBangCap(idnv);
     }
     catch
     {
         return;
     }
 }
Esempio n. 6
0
 private void btnThem_Click(object sender, EventArgs e)
 {
     try
     {
         int      idnv          = (int)cboBangCap.SelectedValue;
         string   trinhdohocvan = txbTrinhDoHocvan.Text;
         DateTime thoigian      = dtpThoiGian.DateTime;
         string   chitiet       = txbBangCap.Text;
         if (BangCapDAO.InsertBangCap(idnv, trinhdohocvan, thoigian, chitiet) == 1)
         {
             MessageBox.Show("thành công");
         }
         else
         {
             MessageBox.Show("thất bại");
         }
         LoadBangCap(idnv);
     }
     catch
     {
         return;
     }
 }
Esempio n. 7
0
 private void btnSua_Click(object sender, EventArgs e)
 {
     try
     {
         int      idbangcap     = Convert.ToInt32(grvBangCap.GetFocusedDataRow()["BANGCAPID"].ToString());
         int      idnv          = (int)cboBangCap.SelectedValue;
         string   trinhdohocvan = txbTrinhDoHocvan.Text;
         DateTime thoigian      = dtpThoiGian.DateTime;
         string   chitiet       = txbBangCap.Text;
         if (BangCapDAO.UpdateBangCap(idbangcap, idnv, trinhdohocvan, thoigian, chitiet) == 1)
         {
             MessageBox.Show("thành công");
         }
         else
         {
             MessageBox.Show("thất bại");
         }
         LoadBangCap(idnv);
     }
     catch
     {
         return;
     }
 }
Esempio n. 8
0
 void LoadBangCap(int idnv)
 {
     list.DataSource = BangCapDAO.LoadBangCap(idnv);
 }