public static bool CapNhatThietBi(Product tb) { string sql = string.Format("update Product set id_cate = '{0}', name_pro = N'{1}', qty = {2}, price = {3} where id = '{4}'", tb.Id_cate, tb.Name_pro, tb.Qty, tb.Price, tb.Id); bool kq = SqlDataAccessHelper.ExecuteNonQuery(sql); return(kq); }
public static bool XoaThietBiTheoMaTB(string maTB) { string sql = string.Format("delete Product where id ='{0}'", maTB); bool kq = SqlDataAccessHelper.ExecuteNonQuery(sql); return(kq); }
public static bool ThemThietBi(Product tb) { string sql = string.Format("insert into Product (id, id_cate, name_pro, qty, price) values ('{0}', '{1}', '{2}', {3}, {4})", tb.Id, tb.Id_cate, tb.Name_pro, tb.Qty, tb.Price); bool kq = SqlDataAccessHelper.ExecuteNonQuery(sql); return(kq); }
public static bool XoaHDTheoSoHD(string soHD) { bool kq; string sql = string.Format("delete Bill where id = '{0}'", soHD); kq = SqlDataAccessHelper.ExecuteNonQuery(sql); return(kq); }
public static bool XoaCTHDTheoSoHDVaMaTB(string soHD, string maTB) { bool kq; string sql = string.Format("delete BillDetails where id_bill = {0} and id_pro = {1}", soHD, maTB); kq = SqlDataAccessHelper.ExecuteNonQuery(sql); return(kq); }
public static bool ThemChiTietHoaDon(BillDetails cthd) { bool kq; string sql = string.Format("insert into BillDetails values ({0}, {1}, {2}, {3}. {4}, {5})", cthd.Id_bill, cthd.Id_pro, cthd.Qty, cthd.Price, cthd.Discount, cthd.Amount); kq = SqlDataAccessHelper.ExecuteNonQuery(sql); return(kq); }