private void btn_xoa_Click(object sender, EventArgs e) { donthuoc d = new donthuoc(); d.Madon = dg_donthuoc.Rows[dg_donthuoc.CurrentRow.Index].Cells[0].Value.ToString(); donthuoc.delete(d); load_donthuoc(); }
public void delete(donthuoc dt) { openC(); SqlCommand cmd = new SqlCommand("sp_delete_donthuoc", con); cmd.CommandType = CommandType.StoredProcedure; cmd.Parameters.Add(new SqlParameter("@madon", dt.Madon)); cmd.ExecuteNonQuery(); closeC(); }
void themdl() { donthuoc t = new donthuoc(); t.Madon = txt_madon.Text.ToString(); t.Tendon = txt_tendon.Text; t.MaKH = f.dg_khachhang.Rows[f.dg_khachhang.CurrentRow.Index].Cells[0].Value.ToString(); string[] date = DateTime.Now.ToString().Split(' '); t.Ngay = date[0]; t.Ghichu = txt_ghichu.Text; t.Anh = file_img; donthuoc.insert(t); f.load_donthuoc(); this.Close(); }
public void update(donthuoc dt) { openC(); SqlCommand cmd = new SqlCommand("sp_update_donthuoc", con); cmd.CommandType = CommandType.StoredProcedure; cmd.Parameters.Add(new SqlParameter("@madon", dt.Madon)); cmd.Parameters.Add(new SqlParameter("@tendon", dt.Tendon)); cmd.Parameters.Add(new SqlParameter("@ghichu", dt.Ghichu)); cmd.Parameters.Add(new SqlParameter("@anh", dt.Anh)); cmd.Parameters.Add(new SqlParameter("@ngay", dt.Ngay)); cmd.Parameters.Add(new SqlParameter("@maKH", dt.MaKH)); cmd.ExecuteNonQuery(); closeC(); }
public void delete(donthuoc dt) { d.delete(dt); }
public void update(donthuoc dt) { d.update(dt); }
public void insert(donthuoc dt) { d.insert(dt); }