コード例 #1
0
        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));
        }
コード例 #2
0
        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
        }
コード例 #3
0
 public static bool themchitietphieunhap(PhieuNhapDTO p)
 {
     if (PhieuNhapDAO.GetPhieuNhapByName(p.MaPhieuNhap, p.MaSach) == null)
     {
         PhieuNhapDAO.Insert(p);
         return(true);
     }
     else
     {
         return(false);
     }
 }
コード例 #4
0
 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);
 }
コード例 #5
0
        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;
        }
コード例 #6
0
ファイル: frmReviewIn.cs プロジェクト: sonlinh98/Code-Dao
        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();
        }
コード例 #7
0
ファイル: QuanLyPhieuNhap.cs プロジェクト: sonlinh98/Code-Dao
        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();
            }
        }
コード例 #8
0
        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);
        }
コード例 #9
0
 public static List <PhieuNhapDTO> LayDanhSachPhieuNhapTheoNgay(DateTime ngayNhap, bool trangThai = true)
 {
     return(PhieuNhapDAO.LayDanhSachPhieuNhapTheoNgay(ngayNhap, trangThai));
 }
コード例 #10
0
 public void HienThiDanhSach()
 {
     dgvsach.DataSource     = PhieuNhapDAO.SelectPhieuNhapChiTietAll();
     dsphieunhap.DataSource = PhieuNhapDAO.SelectPhieuNhapAll();
 }
コード例 #11
0
 public static List <PhieuNhapDTO> LayDanhSachPhieuNhap(bool trangThai = true)
 {
     return(PhieuNhapDAO.LayDanhSachPhieuNhap(trangThai));
 }
コード例 #12
0
 public static DataTable GetThangPNDGV(int nam)
 {
     return(PhieuNhapDAO.GetThangPNDGV(nam));
 }
コード例 #13
0
 public static bool ThemCTPN(ChiTietPhieuNhapDTO PN)
 {
     return(PhieuNhapDAO.ThemCTPN(PN));
 }
コード例 #14
0
 public static bool UpdateTT(string SoPN, long TongTien)
 {
     return(PhieuNhapDAO.UpdateTT(SoPN, TongTien));
 }
コード例 #15
0
 public static DataTable GetPhieuTheoNgay(DateTime NgayLap)
 {
     return(PhieuNhapDAO.GetPhieuTheoNgay(NgayLap));
 }
コード例 #16
0
 public static bool XoaPN(string SoPN)
 {
     return(PhieuNhapDAO.XoaPN(SoPN));
 }
コード例 #17
0
 public static DataSet GetThangPN(int nam)
 {
     return(PhieuNhapDAO.GetThangPN(nam));
 }
コード例 #18
0
 public static DataTable DanhSachCTPN(string SoPN)
 {
     return(PhieuNhapDAO.DanhSachCTPN(SoPN));
 }
コード例 #19
0
 public static double LayDoanhSoPhieuNhapTheoNam(int nam)
 {
     return(PhieuNhapDAO.LayDoanhSoPhieuNhapTheoNam(nam));
 }
コード例 #20
0
 public static void InsertPhieuNhap(long MaNV, DateTime NgayLap)
 {
     PhieuNhapDAO.InsertPhieuNhap(MaNV, NgayLap);
 }
コード例 #21
0
 public static DataTable GetAllPhieuNhap()
 {
     return(PhieuNhapDAO.GetAllPhieuNhap());
 }
コード例 #22
0
 public static DataSet XuatPhieuNhapSach(string SoPN)
 {
     return(PhieuNhapDAO.XuatPhieuNhapSach(SoPN));
 }
コード例 #23
0
 public static int LayMaPhieuNhapMoiNhat()
 {
     return(PhieuNhapDAO.LayMaPhieuNhapMoiNhat());
 }
コード例 #24
0
 public static DataTable GetNamPN()
 {
     return(PhieuNhapDAO.GetNamPN());
 }
コード例 #25
0
 public static long GetMaPN()
 {
     return(PhieuNhapDAO.GetMaPN());
 }
コード例 #26
0
 public static DataTable DanhSachPN()
 {
     return(PhieuNhapDAO.DanhSachPN());
 }
コード例 #27
0
 public static double LayDoanhSoPhieuNhapTheoThang(int thang)
 {
     return(PhieuNhapDAO.LayDoanhSoPhieuNhapTheoThang(thang));
 }
コード例 #28
0
 public static void InsertCTPN(CTPNDTO ctpn)
 {
     PhieuNhapDAO.InsertCTPN(ctpn);
 }
コード例 #29
0
 public static List <ChiPhiDTO> LayChiPhiPhieuNhap()
 {
     return(PhieuNhapDAO.LayChiPhiPhieuNhap());
 }
コード例 #30
0
 public static DataTable GetCTPN(long maPN)
 {
     return(PhieuNhapDAO.GetCTPN(maPN));
 }