private void button7_Click(object sender, EventArgs e) { int masv; string malh; double diemgk, diemck; masv = int.Parse(txtmsv1.Text.Trim()); malh = txtmalh1.Text.Trim(); diemgk = double.Parse(txtdiemgk.Text.Trim()); diemck = double.Parse(txtdiemck.Text.Trim()); SV_LH slh = new SV_LH(masv, malh, diemgk, diemck); try { int i = new SV_LHBus().SuaSV_LH(slh); if (i == -2) { throw new Exception(); } } catch (Exception ex) { MessageBox.Show(ex.Message); } dgvSV_LH.DataSource = GetSV_LH(); }
private List <SV_LH> list() { string sql = @"Select * from SV_LH where MaSV='" + txttim.Text + "'"; SV_LHBus sv = new SV_LHBus(); List <SV_LH> list = sv.GetSV_LH(sql); return(list); }
public List <SV_LH> GetSV_LH() { try { string sql = "Select * from SV_LH"; SV_LHBus SV_LH = new SV_LHBus(); return(SV_LH.GetSV_LH(sql)); } catch (Exception ex) { throw ex; } }
private void button8_Click(object sender, EventArgs e) { int masv; string malh; masv = int.Parse(txtmsv1.Text.Trim()); malh = txtmalh1.Text.Trim(); try { int i = new SV_LHBus().XoaSV_LH(masv, malh); } catch (Exception ex) { MessageBox.Show(ex.Message); } dgvSV_LH.DataSource = GetSV_LH(); }