public ContentResult AddStocIn(int id_vl, int id_nhacc, int soluong, int nv_role, int id_nv) { string content = null; phieunhap item = new phieunhap(); item.ID_NhaCC = id_nhacc; item.ID_NV = id_nv; item.ID_VL = id_vl; item.SoLuong = soluong; item.Status = 0; if (nv_role != 2) { item.NgayNhap = DateTime.Now; item.Status = 1; } var result = new PhieuNhapDAO().Insert(item); if (result) { content = "<script type='text/javascript'>alert(' Thêm thành công');window.location.href = '/Storage/StockIn/';</script>"; } else { content = "<script type='text/javascript'>alert(' Thêm thất bại !');script>"; } return(Content(content)); }
public ThemMoiPhieuNhap() { InitializeComponent(); phieunhap = new PhieuNhapDAO(); nhacungcap = new NCCDAO(); sach = new SachDAO(); vpp = new VPPDAO(); source = new DataTable(); dsdachon = new DataTable(); source.Columns.Add("Mã sách/vvp", typeof(string)); source.Columns.Add("Tên sách/vpp", typeof(string)); source.Columns.Add("Tác giả", typeof(string)); source.Columns.Add("Đơn giá", typeof(double)); source.Columns.Add("Số lượng tồn", typeof(int)); for (int i = 0; i < source.Columns.Count; i++) { source.Columns[i].ReadOnly = true; } dsdachon.Columns.Add("Mã sách/vvp", typeof(string)); dsdachon.Columns.Add("Tên sách/vpp", typeof(string)); dsdachon.Columns.Add("Tác giả", typeof(string)); dsdachon.Columns.Add("Đơn giá", typeof(double)); dsdachon.Columns.Add("Số lượng tồn", typeof(int)); dsdachon.Columns.Add("Số lượng đặt", typeof(int)); for (int i = 0; i < dsdachon.Columns.Count - 1; i++) { dsdachon.Columns[i].ReadOnly = true; } //gdcDsMatHang. //gdcDsMatHangDaChon.Forma }
public static bool themchitietphieunhap(PhieuNhapDTO p) { if (PhieuNhapDAO.GetPhieuNhapByName(p.MaPhieuNhap, p.MaSach) == null) { PhieuNhapDAO.Insert(p); return(true); } else { return(false); } }
public static bool KhoiPhucPhieuNhap(int maPhieuNhap, List <CTPhieuNhapDTO> lsCTPhieuNhap) { if (PhieuNhapDAO.KhoiPhucPhieuNhap(maPhieuNhap)) { foreach (CTPhieuNhapDTO ctpn in lsCTPhieuNhap) { if (!NguyenLieuDAO.TangSoLuongTonKho(ctpn)) { return(false); } } } return(true); }
public void InitData(PhieuNhapDAO thongTinPhieuNhap, List <ChiTietHangHoaDAO> dataHangNhap) { SoPhieuNhap.Value = thongTinPhieuNhap.SoPhieuNhap; NgayNhap.Value = thongTinPhieuNhap.NgayNhap; NguoiGiaoHang.Value = thongTinPhieuNhap.NguoiGiaoHang; NhapTaiKho.Value = thongTinPhieuNhap.NhapTaiKho; GhiChu.Value = thongTinPhieuNhap.GhiChu; NguoiLapPhieu.Value = thongTinPhieuNhap.TenNhanVienNhap; objectDataSource1.DataSource = dataHangNhap; }
public void InPhieuNhap(PhieuNhapDAO thongTinPhieuNhap, List <ChiTietHangHoaDAO> dataHangHoaNhap) { XtraReportNhapHang reportNhapHang = new XtraReportNhapHang(); // Bỏ submit paramater review report reportNhapHang.Parameters["SoPhieuNhap"].Visible = false; reportNhapHang.Parameters["NgayNhap"].Visible = false; reportNhapHang.Parameters["NguoiGiaoHang"].Visible = false; reportNhapHang.Parameters["NhapTaiKho"].Visible = false; reportNhapHang.Parameters["GhiChu"].Visible = false; reportNhapHang.Parameters["NguoiLapPhieu"].Visible = false; reportNhapHang.InitData(thongTinPhieuNhap, dataHangHoaNhap); documentViewer1.DocumentSource = reportNhapHang; reportNhapHang.CreateDocument(); }
private void btnIn_Click(object sender, EventArgs e) { using (frmReviewIn XemTruocKhiIn = new frmReviewIn()) { int rowindex = dgvDanhSachPhieuNhap.CurrentCell.RowIndex; // Lấy thông tin phiếu nhập từ dòng click PhieuNhapDAO thongTinPhieuNhap = new PhieuNhapDAO(dgvDanhSachPhieuNhap.Rows[rowindex].Cells[1].Value.ToString(), dgvDanhSachPhieuNhap.Rows[rowindex].Cells[2].Value.ToString(), dgvDanhSachPhieuNhap.Rows[rowindex].Cells[3].Value.ToString(), dgvDanhSachPhieuNhap.Rows[rowindex].Cells[4].Value.ToString(), dgvDanhSachPhieuNhap.Rows[rowindex].Cells[5].Value.ToString(), dgvDanhSachPhieuNhap.Rows[rowindex].Cells[6].Value.ToString()); // Lấy chi tiết phiếu nhập (danh sách mặt hàng nhập) từ bảng string MaPN = dgvDanhSachPhieuNhap.Rows[rowindex].Cells[1].Value.ToString(); List <ChiTietHangHoaDAO> dataHangNhap = layer02.LayThongTinChiTietCuaPhieuNhapTheoSoPhieu(MaPN); // Đổ dữ liệu vào phiếu in XemTruocKhiIn.InPhieuNhap(thongTinPhieuNhap, dataHangNhap); //XemTruocKhiIn.InPhieuNhap(); XemTruocKhiIn.ShowDialog(); } }
public static bool LuuPhieuNhap(PhieuNhapDTO phieuNhap, List <CTPhieuNhapDTO> lsCTPhieuNhap) { if (!PhieuNhapDAO.LuuPhieuNhap(phieuNhap)) { return(false); } foreach (CTPhieuNhapDTO ctpn in lsCTPhieuNhap) { if (!CTPhieuNhapDAO.LuuCTPhieuNhap(ctpn)) { return(false); } if (!NguyenLieuDAO.TangSoLuongTonKho(ctpn)) { return(false); } } return(true); }
public static List <PhieuNhapDTO> LayDanhSachPhieuNhapTheoNgay(DateTime ngayNhap, bool trangThai = true) { return(PhieuNhapDAO.LayDanhSachPhieuNhapTheoNgay(ngayNhap, trangThai)); }
public void HienThiDanhSach() { dgvsach.DataSource = PhieuNhapDAO.SelectPhieuNhapChiTietAll(); dsphieunhap.DataSource = PhieuNhapDAO.SelectPhieuNhapAll(); }
public static List <PhieuNhapDTO> LayDanhSachPhieuNhap(bool trangThai = true) { return(PhieuNhapDAO.LayDanhSachPhieuNhap(trangThai)); }
public static DataTable GetThangPNDGV(int nam) { return(PhieuNhapDAO.GetThangPNDGV(nam)); }
public static bool ThemCTPN(ChiTietPhieuNhapDTO PN) { return(PhieuNhapDAO.ThemCTPN(PN)); }
public static bool UpdateTT(string SoPN, long TongTien) { return(PhieuNhapDAO.UpdateTT(SoPN, TongTien)); }
public static DataTable GetPhieuTheoNgay(DateTime NgayLap) { return(PhieuNhapDAO.GetPhieuTheoNgay(NgayLap)); }
public static bool XoaPN(string SoPN) { return(PhieuNhapDAO.XoaPN(SoPN)); }
public static DataSet GetThangPN(int nam) { return(PhieuNhapDAO.GetThangPN(nam)); }
public static DataTable DanhSachCTPN(string SoPN) { return(PhieuNhapDAO.DanhSachCTPN(SoPN)); }
public static double LayDoanhSoPhieuNhapTheoNam(int nam) { return(PhieuNhapDAO.LayDoanhSoPhieuNhapTheoNam(nam)); }
public static void InsertPhieuNhap(long MaNV, DateTime NgayLap) { PhieuNhapDAO.InsertPhieuNhap(MaNV, NgayLap); }
public static DataTable GetAllPhieuNhap() { return(PhieuNhapDAO.GetAllPhieuNhap()); }
public static DataSet XuatPhieuNhapSach(string SoPN) { return(PhieuNhapDAO.XuatPhieuNhapSach(SoPN)); }
public static int LayMaPhieuNhapMoiNhat() { return(PhieuNhapDAO.LayMaPhieuNhapMoiNhat()); }
public static DataTable GetNamPN() { return(PhieuNhapDAO.GetNamPN()); }
public static long GetMaPN() { return(PhieuNhapDAO.GetMaPN()); }
public static DataTable DanhSachPN() { return(PhieuNhapDAO.DanhSachPN()); }
public static double LayDoanhSoPhieuNhapTheoThang(int thang) { return(PhieuNhapDAO.LayDoanhSoPhieuNhapTheoThang(thang)); }
public static void InsertCTPN(CTPNDTO ctpn) { PhieuNhapDAO.InsertCTPN(ctpn); }
public static List <ChiPhiDTO> LayChiPhiPhieuNhap() { return(PhieuNhapDAO.LayChiPhiPhieuNhap()); }
public static DataTable GetCTPN(long maPN) { return(PhieuNhapDAO.GetCTPN(maPN)); }