//Thêm loại sản phẩm public int InsertLSP(LoaiSanPhamDTO loaiSanPham) { int result = 0; string Query = "Insert into LoaiSP values('" + loaiSanPham.MaLoai + "', N'" + loaiSanPham.TenLoai + "')"; try { result = DBcon.ExecuteSPNoneQuery(Query); } catch (SqlException ex) { } return(result); }
public int InsertPN(PhieuNhapDTO phieuNhap) { int result = 0; string Query = "Insert into PhieuNhap(MaPN, NgayNhap) values('" + phieuNhap.MaPN + "', N'" + phieuNhap.NgayNhap.ToShortDateString() + "')"; try { result = DBcon.ExecuteSPNoneQuery(Query); } catch (SqlException ex) { } return(result); }
//THÊM PHIẾU XUẤT public int InsertPX(PhieuXuatDTO phieuXuatDTO) { int result = 0; string Query = "Insert into PhieuXuat(MaPX, NgayXuat) values('" + phieuXuatDTO.MaPX + "', N'" + phieuXuatDTO.NgayXuat.ToShortDateString() + "')"; try { result = DBcon.ExecuteSPNoneQuery(Query); } catch (SqlException ex) { } return(result); }
//Thêm SẢN PHẨM public int InsertSP(SanPhamDTO sanPham) { int result = 0; string Query = "Insert into SanPham values (" + sanPham.MaSP + ",N'" + sanPham.Ten + "'," + sanPham.MaLoai + "," + sanPham.MaNCC + "," + sanPham.MaKichCo + ",N'" + sanPham.GioiTinh + "',N'" + sanPham.GhiChu + "'," + sanPham.DonGia + ")"; try { result = DBcon.ExecuteSPNoneQuery(Query); } catch (SqlException ex) { } return(result); }
//Thêm CHI TIẾT PHIẾU NHẬP public int InsertCTPN(ChiTietPhieuNhapDTO chiTietPhieuNhap) { int result = 0; string Query = "Insert into CTPhieuNhap values('" + chiTietPhieuNhap.MaPN + "', '" + chiTietPhieuNhap.MaSP + "', '" + chiTietPhieuNhap.MaNCC + "', '" + chiTietPhieuNhap.SoLuong + "', '" + chiTietPhieuNhap.GiaNhap + "')"; try { result = DBcon.ExecuteSPNoneQuery(Query); } catch (SqlException ex) { } return(result); }
//Thêm CHI TIẾT PHIẾU xuất public int InsertCTPX(ChiTietPhieuXuatDTO chiTietPhieuXuat) { int result = 0; string Query = "Insert into CTPhieuXuat values('" + chiTietPhieuXuat.MaPX + "', '" + chiTietPhieuXuat.MaSP + "', '" + chiTietPhieuXuat.SoLuong + "', '" + chiTietPhieuXuat.MaKH + "','" + chiTietPhieuXuat.GiamGia + "')"; try { result = DBcon.ExecuteSPNoneQuery(Query); } catch (SqlException ex) { } return(result); }
//Thêm khách hàng public int InsertKH(KhachHangDTO khachHang) { int result = 0; string Query = "Insert into KhachHang values('" + khachHang.MaKH + "', N'" + khachHang.HoTen + "', N'" + khachHang.DiaChi + "', N'" + khachHang.SDT + "')"; try { result = DBcon.ExecuteSPNoneQuery(Query); } catch (SqlException ex) { } return(result); }
//THÊM public int InsertNV(NhanVienDTO nhanVien) { int result = 0; string Query = "Insert into NhanVien values(N'" + nhanVien.MaNV + "', N'" + nhanVien.HoTen + "', '" + nhanVien.NamSinh.ToShortDateString() + "', N'" + nhanVien.QueQuan + "','" + nhanVien.TenDangNhap + "','" + nhanVien.MatKhau + "','" + nhanVien.SDT + "'," + nhanVien.MaLoaiNguoiDung + ")"; try { result = DBcon.ExecuteSPNoneQuery(Query); } catch (SqlException ex) { } return(result); }
//Thêm nhà cung cấp public int InsertNCC(NhaCungCapDTO nhaCungCap) { int result = 0; string Query = "Insert into NhaCungCap values('" + nhaCungCap.MaNCC + "', N'" + nhaCungCap.HoTen + "', N'" + nhaCungCap.DiaChi + "', '" + nhaCungCap.SDT + "')"; try { result = DBcon.ExecuteSPNoneQuery(Query); } catch (SqlException ex) { } return(result); }