//cap nhat so luong ton cua hang hoa khi ban hang public void CapNhatSoLuongTonHH(string mahh, int soluong) { HangHoa hh = da.HangHoas.Where(t => t.maMH == mahh).SingleOrDefault(); hh.SoLuongTon = hh.SoLuongTon - soluong; da.SubmitChanges(); }
public void SuaLoaiHangHoa(string ma, string ten) { LoaiHangHoa hh = lhh.LoaiHangHoas.Where(t => t.maLoaiHH == ma).FirstOrDefault(); hh.maLoaiHH = ma; hh.tenLoaiHH = ten; lhh.SubmitChanges(); }
//them phieu nhap public void ThemPhieuNhap(string ma, string ngaylap, string manv) { PhieuNhapHang hd = new PhieuNhapHang(); hd.maPN = ma; hd.NgayNhap = DateTime.Parse(ngaylap); hd.maNV = manv; da.PhieuNhapHangs.InsertOnSubmit(hd); da.SubmitChanges(); }
public void ThemNCC(string ma, string ten, string diachi, string dienthoai) { NhaCungCap nv = new NhaCungCap(); nv.maNCC = ma; nv.tenNCC = ten; nv.DiaChi = diachi; nv.DienThoai = dienthoai; da.NhaCungCaps.InsertOnSubmit(nv); da.SubmitChanges(); }
public void ThemKhachHang(string ma, string ten, string diachi, string dienthoai, int diem) { KhachHang nv = new KhachHang(); nv.maThe = ma; nv.tenKH = ten; nv.DiaChi = diachi; nv.DienThoai = dienthoai; nv.DiemTL = diem; da.KhachHangs.InsertOnSubmit(nv); da.SubmitChanges(); }
public void ThemNhanVien(string ma, string ten, string ngaysinh, string diachi, string dienthoai) { NhanVien nv = new NhanVien(); nv.maNV = ma; nv.tenNV = ten; nv.NgaySinh = DateTime.Parse(ngaysinh); nv.DiaChi = diachi; nv.DienThoai = dienthoai; da.NhanViens.InsertOnSubmit(nv); da.SubmitChanges(); }
public void Them(string tentk, string mk, string quyen, string hd, string manv) { TaiKhoan tk = new TaiKhoan(); tk.TenTK = tentk; tk.MatKhau = mk; tk.Quyen = quyen; tk.HoatDong = bool.Parse(hd); tk.maNV = manv; da.TaiKhoans.InsertOnSubmit(tk); da.SubmitChanges(); }
//them hoa don public void ThemHoaDon(string mahd, string ngaylap, string manv, string mathe) { HoaDon hd = new HoaDon(); hd.maHD = mahd; hd.NgayLapHD = DateTime.Parse(ngaylap); hd.maNV = manv; hd.maThe = mathe; hd.TongTien = 0; da.HoaDons.InsertOnSubmit(hd); da.SubmitChanges(); }