public static int xoa_tb(Thietbi a) { SqlParameter[] para = new SqlParameter[] { new SqlParameter("@matb", a.Matb), }; return(DataProvider.ExecuteNonQuery("xoa_tb", para)); }
public static int sua_tb(Thietbi a) { SqlParameter[] para = new SqlParameter[] { new SqlParameter("@matb", a.Matb), new SqlParameter("@tentb", a.Tentb), new SqlParameter("@loaitb", a.Loaitb), new SqlParameter("@soluong", a.Soluong), new SqlParameter("@namsx", a.Namsx), new SqlParameter("@hangsx", a.Hangsx), new SqlParameter("@giatb", a.Giatb), new SqlParameter("@manql", a.Manql) }; return(DataProvider.ExecuteNonQuery("sua_tb", para)); }
private void btnXoa_Click(object sender, EventArgs e) { Thietbi a = new Thietbi(); a.Matb = txt_matb.Text.Trim(); a.Tentb = txt_tentb.Text.Trim(); a.Giatb = int.Parse(txt_giatb.Text.Trim()); a.Loaitb = txt_loaitb.Text.Trim(); a.Soluong = int.Parse(txt_sl.Text.Trim()); a.Hangsx = txt_hangsx.Text.Trim(); a.Namsx = int.Parse(txt_namsx.Text.Trim()); a.Manql = int.Parse(txt_manql.Text.Trim()); if (a.Matb == null) { MessageBox.Show("Không được để trống mã thiết bị!", "Thông báo", MessageBoxButtons.OK, MessageBoxIcon.Warning); } if (BUS.BUS.xoa_tb(a) == 1) { MessageBox.Show("Xóa thành công"); txt_matb.Enabled = false; } xuat(); }
public static int xoa_tb(Thietbi a) { return(DAO.xoa_tb(a)); }
public static int sua_tb(Thietbi a) { return(DAO.sua_tb(a)); }
public static int them_tb(Thietbi a) { return(DAO.them_tb(a)); }