public string LayMaHD(DataTable dt)
        {
            string MAHD = "";

            DAL_HD xuLyHD = new DAL_HD();
            int    total  = 1;

            do
            {
                MAHD = "HD";
                if (total < 10)
                {
                    MAHD += "00" + total.ToString();
                }
                else if (total < 100)
                {
                    MAHD += "0" + total.ToString();
                }
                else
                {
                    MAHD += total.ToString();
                }
                total++;
            } while (!xuLyHD.TaoMaHD(MAHD, total - 1, dt));
            return(MAHD);
        }
Exemple #2
0
 public bool Phuchoitheoten(string ten)
 {
     try
     {
         DAL_HD objdal = new DAL_HD();
         return(objdal.phuchoitheoten(ten));
     }
     catch
     {
         throw;
     }
 }
Exemple #3
0
 public DataTable LayDSHDXoa()
 {
     try
     {
         DAL_HD objdal = new DAL_HD();
         return(objdal.DocSQLXOAHD("tbHoaDon"));
     }
     catch (Exception err)
     {
         throw;
     }
 }
Exemple #4
0
 //public DataTable LayTongTienBan()
 //{
 //    try
 //    {
 //        DAL_HD objdal = new DAL_HD();
 //        return objdal.LayTongTienBan("tbHoaDon");
 //    }
 //    catch (Exception err)
 //    {
 //        throw;
 //    }
 //}
 public bool Phuchoitheoma(string ma)
 {
     try
     {
         DAL_HD objdal = new DAL_HD();
         return(objdal.phuchoitheoma(ma));
     }
     catch
     {
         throw;
     }
 }
Exemple #5
0
        public bool XoaHD(string mahd)
        {
            DAL_HD objdal = new DAL_HD();

            return(objdal.Xoa(mahd));
        }
Exemple #6
0
        public DataTable TimTheoTenNV(string tennv)
        {
            DAL_HD objdal = new DAL_HD();

            return(objdal.TimTenNV(tennv));
        }
Exemple #7
0
        public DataTable TimTheoMaHD(string mahd)
        {
            DAL_HD objdal = new DAL_HD();

            return(objdal.TimMaHD(mahd));
        }
        public bool ThemHDNhap(BEL_HDNHAP HD)
        {
            DAL_HD xuLyHD = new DAL_HD();

            return(xuLyHD.ThemHDNhap(HD));
        }
        public bool ThemCTHDNHAP(BEL_CTHD chiTietHDNhap)
        {
            DAL_HD xuLyHD = new DAL_HD();

            return(xuLyHD.ThemCTHDNHAP(chiTietHDNhap));
        }
Exemple #10
0
        public bool CapNhatTrung()
        {
            var xuly = new DAL_HD();

            return(xuly.CapNhaphdTrung());
        }
Exemple #11
0
        public bool CapNhapKM_MaKH(double giam, int ma)
        {
            var xuly = new DAL_HD();

            return(xuly.CapNhapKM_MAKH(giam, ma));
        }
Exemple #12
0
        public DataTable LayDSHD_TheoNgay(int ngay1, int ngay2, int thang1, int thang2)
        {
            DAL_HD objdal = new DAL_HD();

            return(objdal.DocSQLHD_TheoNgay(ngay1, ngay2, thang1, thang2));
        }
Exemple #13
0
        public bool XoaSachHD(string ma)
        {
            var xuly = new DAL_HD();

            return(xuly.XoaHD(ma));
        }
Exemple #14
0
        public bool CapNhaphd(BEL_HD hd)
        {
            var xuly = new DAL_HD();

            return(xuly.CapNhaphd(hd));
        }
Exemple #15
0
        public bool ThemHD(BEL_HD hd)
        {
            var xuly = new DAL_HD();

            return(xuly.ThemHD(hd));
        }
        public DataTable LayDanhSachCTHDNhap()
        {
            DAL_HD xuLyHD = new DAL_HD();

            return(xuLyHD.LayDanhSachCTHDNhap());
        }
Exemple #17
0
        public bool CapNhaDaTru()
        {
            var xuly = new DAL_HD();

            return(xuly.CapNhapDaTru());
        }
        public DataTable LayDanhSachHDBan()
        {
            DAL_HD xuLyHD = new DAL_HD();

            return(xuLyHD.LayDanhSachHDBan());
        }
Exemple #19
0
        /*       public bool CapNhapTThai()
         *     {
         *         var xuly = new DAL_HD();
         *         return xuly.CapNhapTThaiHD();
         *     }
         *     public bool LayHD()
         *     {
         *         var xuly = new DAL_HD();
         *         return xuly.LayHD();
         *     }*/

        public DataTable LayDSHD(string ten)
        {
            DAL_HD objdal = new DAL_HD();

            return(objdal.DocSQLHD("tbHoaDon", ten));
        }
        public bool ThemCTHDBan(BEL_CTHD chiTietHDBan)
        {
            DAL_HD xuLyHD = new DAL_HD();

            return(xuLyHD.ThemCTHDBan(chiTietHDBan));
        }
Exemple #21
0
        public DataTable LayDSHD_HD()
        {
            DAL_HD objdal = new DAL_HD();

            return(objdal.DocSQLHD_HD("tbHoaDon"));
        }
        public bool ThemHDBan(BEL_HDBAN HD)
        {
            DAL_HD xuLyHD = new DAL_HD();

            return(xuLyHD.ThemHDBan(HD));
        }
Exemple #23
0
        public DataTable LayDSMaHD()
        {
            DAL_HD objdal = new DAL_HD();

            return(objdal.DocSQLMaHD());
        }