public static ArrayList getAllPhieuNhapHang()
        {
            ArrayList dataList = new ArrayList();

            try
            {
                DataSet dataSet = PhieuNhapHangDAO.getAllPhieuNhapHang();

                foreach (DataRow row in dataSet.Tables[0].Rows)
                {
                    int           id            = Convert.ToInt32(row["id"]);
                    int           idMatHang     = Convert.ToInt32(row["idMatHang"]);
                    DateTime      ngayNhap      = (DateTime)row["ngayNhap"];
                    int           soLuong       = Convert.ToInt32(row["soLuong"]);
                    float         tongTien      = (float)Convert.ToDouble(row["TongTien"]);
                    PhieuNhapHang phieuNhapHang = new PhieuNhapHang(id, idMatHang, ngayNhap, soLuong, tongTien);
                    dataList.Insert(0, phieuNhapHang);
                }
            }
            catch (SqlException e)
            {
            }

            return(dataList);
        }
        public static bool deletePhieuNhapHang(int id)
        {
            bool kt = true;

            try
            {
                PhieuNhapHangDAO.deletePhieuNhapHang(id);
            }
            catch (SqlException e)
            {
                kt = false;
            }
            return(kt);
        }
        public static bool addPhieuNhapHang(PhieuNhapHang phieuNhapHang)
        {
            bool kt = true;

            try
            {
                PhieuNhapHangDAO.addPhieuNhapHang(phieuNhapHang.idMatHang, phieuNhapHang.ngayNhap,
                                                  phieuNhapHang.soLuong, phieuNhapHang.tongTien);
            }
            catch (SqlException e)
            {
                kt = false;
            }
            return(kt);
        }
Пример #4
0
 public static void Them(string MaPhieu, string MaNCC, string DiaChi, string DienThoai, DateTime Ngay, string GhiChu, string SoHoaDonVAT, string SoHoaDonVietTay, string MaNV, string MaKho, string MaDKTT, string MaHTTT, DateTime HTT)
 {
     PhieuNhapHangDAO.Them(MaPhieu, MaNCC, DiaChi, DienThoai, Ngay, GhiChu, SoHoaDonVAT, SoHoaDonVietTay, MaNV, MaKho, MaDKTT, MaHTTT, HTT);
 }
Пример #5
0
 public static string LayMaPhieu()
 {
     return(PhieuNhapHangDAO.LayMaPhieu());
 }
        // GET: NhapHang/Edit/5
        public ActionResult Edit(int id)
        {
            var pn = new PhieuNhapHangDAO().GetPhieuNhapByID(id.ToString());

            return(View(pn));
        }
        // GET: NhapHang
        public ActionResult Index()
        {
            var pn = new PhieuNhapHangDAO().GetListPhieuNhap();

            return(View(pn));
        }