public void ChinhSuaSL(string tensp, int SL) { DSGH dh = db.DSGHs.FirstOrDefault(s => s.TenSP.Equals(tensp)); dh.Số_Lượng = SL; db.SubmitChanges(); }
public void XoaSPGH(string tensp) { DSGH e = db.DSGHs.FirstOrDefault(p => p.TenSP.Equals(tensp)); db.DSGHs.DeleteOnSubmit(e); db.SubmitChanges(); }
public void ThemSLsanpham(string tensp) { DSGH dh = db.DSGHs.FirstOrDefault(s => s.TenSP.Equals(tensp)); dh.Số_Lượng = (dh.Số_Lượng + 1); db.SubmitChanges(); }
public void ThemVaoDSGH(string tensp, int giasanpham, int soluong) { DSGH DS = new DSGH(); DS.TenSP = tensp; DS.GiaBan = giasanpham; DS.Số_Lượng = soluong; da.ThemSPVB(DS); }
public void ThemSPVB(DSGH DS) { db.DSGHs.InsertOnSubmit(DS); db.SubmitChanges(); }