public void xoahanghoatrongchitiethdxuat(string mahh, string madhdxuat) { using (QLBanHangDataContext data = new QLBanHangDataContext()) { ChiTietHD_Xuat chitiethdnhap = new ChiTietHD_Xuat(); chitiethdnhap = data.ChiTietHD_Xuats.Where(t => t.MAHH == mahh && t.MAHD_Xuat == madhdxuat).FirstOrDefault(); if (chitiethdnhap != null) { data.ChiTietHD_Xuats.DeleteOnSubmit(chitiethdnhap); data.SubmitChanges(); } } }
public void xoa1chitiethoadon(string mahh, string mahdxuat) // theo mahh { using (QLBanHangDataContext data = new QLBanHangDataContext()) { ChiTietHD_Xuat cthdx = new ChiTietHD_Xuat(); cthdx = data.ChiTietHD_Xuats.Where(t => t.MAHH == mahh && t.MAHD_Xuat == mahdxuat).FirstOrDefault(); if (cthdx != null) { data.ChiTietHD_Xuats.DeleteOnSubmit(cthdx); data.SubmitChanges(); } } }
public void them1chitiethoadonxuat(string mahdx, string mahh, int soluongxuat, double dongiaxuat, long thanhtienxuat, float vat, string donvi) { using (QLBanHangDataContext data = new QLBanHangDataContext()) { ChiTietHD_Xuat cthdx = new ChiTietHD_Xuat(); cthdx.MAHD_Xuat = mahdx; cthdx.MAHH = mahh; cthdx.SoLuong_Xuat = soluongxuat; cthdx.ThanhTienXuat = thanhtienxuat; cthdx.DonGia_Xuat = dongiaxuat; cthdx.DonVi = donvi; data.ChiTietHD_Xuats.InsertOnSubmit(cthdx); data.SubmitChanges(); } }