コード例 #1
0
        public void FillRentAvailable(DateTime From, DateTime To)
        {
            DataTable dataTable = Product_DAL.GetDataTable();


            DataRow dataRow;
            Product product;

            OrderRentArr orderRentArr = new OrderRentArr();

            orderRentArr.Fill();

            //  orderRentArr = orderRentArr.FilterNoReturned();
            orderRentArr = orderRentArr.Filter(From, To);

            for (int i = 0; i < dataTable.Rows.Count; i++)
            {
                dataRow = dataTable.Rows[i];

                product = new Product(dataRow);



                if (
                    (product.Status == "Rent") &&
                    (!orderRentArr.DoesExist(product))
                    )
                {
                    this.Add(product);
                }
            }
        }
コード例 #2
0
        public void FillBuyAvailable()
        {
            DataTable dataTable = Product_DAL.GetDataTable();

            //להעביר את הערכים מהטבלה לתוך אוסף הלקוחות

            //להעביר כל שורה בטבלה ללקוח
            DataRow dataRow;
            Product product;

            for (int i = 0; i < dataTable.Rows.Count; i++)
            {
                dataRow = dataTable.Rows[i];

                product = new Product(dataRow);

                if (
                    (product.Status == "Buy") &&
                    (product.Doesavailable == "")
                    )
                {
                    this.Add(product);
                }
            }
        }
コード例 #3
0
        public Product_BAL()
        {
            Product = new Product_DAL();

            product_Image_Bal = new ProductImage_BAL();

            ProductImage = new ProductImage_DAL();
        }
コード例 #4
0
        public int?GetId(Product_DAL product)
        {
            var temp = context.Products.FirstOrDefault(p => (p.Name == product.Name));

            if (temp == null)
            {
                return(null);
            }
            else
            {
                return(temp.Id);
            }
        }
コード例 #5
0
        public bool DeleteRecord(int iId)
        {
            bool objReturn = false;

            try
            {
                using (Product_DAL objDAL = new Product_DAL())
                {
                    objReturn = objDAL.DeleteRecord(iId);
                }
            }
            catch (Exception ex)
            {
                log.Error("DeleteRecord Error: ", ex);
            }
            return(objReturn);
        }
コード例 #6
0
        public ProductPage GetRecordPage(int iPageNo, int iPageSize)
        {
            ProductPage objReturn = new ProductPage();

            try
            {
                using (Product_DAL objDAL = new Product_DAL())
                {
                    objReturn = objDAL.GetRecordPage(iPageNo, iPageSize);
                }
            }
            catch (Exception ex)
            {
                log.Error("GetRecordPage Error: ", ex);
            }
            return(objReturn);
        }
コード例 #7
0
        public Product GetRecordById(Guid iId)
        {
            Product objReturn = null;

            try
            {
                using (Product_DAL objDAL = new Product_DAL())
                {
                    objReturn = objDAL.GetRecordById(iId);
                }
            }
            catch (Exception ex)
            {
                log.Error("GetRecordById Error: ", ex);
            }
            return(objReturn);
        }
コード例 #8
0
        public Guid InsertUpdateRecord(Product objProduct)
        {
            Guid objReturn = new Guid();

            try
            {
                using (Product_DAL objDAL = new Product_DAL())
                {
                    objReturn = objDAL.InsertUpdateRecord(objProduct);
                }
            }
            catch (Exception ex)
            {
                log.Error("InsertUpdateRecord Error: ", ex);
            }
            return(objReturn);
        }
コード例 #9
0
        public List <Product> GetAllRecord()
        {
            List <Product> objReturn = null;

            try
            {
                using (Product_DAL objDAL = new Product_DAL())
                {
                    objReturn = objDAL.GetAllRecord();
                }
            }
            catch (Exception ex)
            {
                log.Error("GetAllRecord Error: ", ex);
            }
            return(objReturn);
        }
コード例 #10
0
        public Product Validate(string email, string password)
        {
            Product objReturn = null;

            try
            {
                using (Product_DAL objDAL = new Product_DAL())
                {
                    objReturn = objDAL.Validate(email, password);
                }
            }
            catch (Exception ex)
            {
                log.Error("Validate Error: ", ex);
            }
            return(objReturn);
        }
コード例 #11
0
        public void Fill()
        {
            //להביא מה-DAL טבלה מלאה בכל הלקוחות

            DataTable dataTable = Product_DAL.GetDataTable();

            //להעביר את הערכים מהטבלה לתוך אוסף הלקוחות
            //להעביר כל שורה בטבלה ללקוח

            DataRow dataRow;
            Product product;

            for (int i = 0; i < dataTable.Rows.Count; i++)
            {
                dataRow = dataTable.Rows[i];
                product = new Product(dataRow);
                this.Add(product);
            }
        }
コード例 #12
0
        public void FillRentAvailable()
        {
            DataTable dataTable = Product_DAL.GetDataTable();

            //להעביר את הערכים מהטבלה לתוך אוסף הלקוחות

            //להעביר כל שורה בטבלה ללקוח
            DataRow   dataRow;
            Product   product;
            OrderRent orderRent;

            OrderRentArr orderRentArr = new OrderRentArr();

            orderRentArr.Fill();

            // orderRentArr = orderRentArr.FilterNoReturned();

            for (int i = 0; i < dataTable.Rows.Count; i++)
            {
                dataRow = dataTable.Rows[i];

                product = new Product(dataRow);

                for (int j = 0; j < orderRentArr.Count; j++)
                {
                    orderRent = orderRentArr[j] as OrderRent;

                    if (
                        (product.Status == "Rent") &&
                        (orderRent.Product.Id != product.Id) &&
                        (orderRent.Product.Doesavailable == "InRent")
                        )
                    {
                        this.Add(product);
                    }
                }
            }
        }
コード例 #13
0
        public string GenerateProductCode(LP_GenerateTransNumber_Property objtransno)
        {
            string TransactionNumber = "";

            objProduct_DAL = new Product_DAL();
            DataTable dt = objProduct_DAL.GenerateProductCode(objtransno);

            if (dt.Rows.Count > 0)
            {
                foreach (DataRow dr in dt.Rows)
                {
                    TransactionNumber = dr["TransNumber"].ToString();
                    TransactionNumber = "P-00" + TransactionNumber + "-" + objtransno.userid;
                }
                return(TransactionNumber);
            }
            else
            {
                TransactionNumber = "P-001-" + objtransno.userid;

                return(TransactionNumber);
            }
            //return _objMRNDAL.GenerateMRNNo(objtransno);
        }
コード例 #14
0
ファイル: Product_BUS.cs プロジェクト: tonyho96/source
 public static bool SuaSPCH(Product_DTO sanpham)
 {
     return(Product_DAL.SuaSanPhamCH(sanpham));
 }
コード例 #15
0
ファイル: Product_BUS.cs プロジェクト: tonyho96/source
 public static List <Product_DTO> LoadProduct()
 {
     return(Product_DAL.LoadProduct());
 }
コード例 #16
0
 public Product_BUS()
 {
     temp = new Product_DAL();
 }
コード例 #17
0
 public FrontEndBAL()
 {
     Product_DAL  = new Product_DAL();
     frontEnd_DAL = new FrontEnd_DAL();
 }
コード例 #18
0
 public DataTable ddlSubCategory()
 {
     objProduct_DAL = new Product_DAL(objProductProperty);
     return(objProduct_DAL.ddlSubCategory());
 }
コード例 #19
0
 public DataTable GetById(int?id)
 {
     objProduct_DAL = new Product_DAL(objProductProperty);
     return(objProduct_DAL.SelectById(id));
 }
コード例 #20
0
        public void Update(Product_DAL item)
        {
            var product = context.Products.FirstOrDefault(p => (p.Id == item.Id));

            product.Name = item.Name;
        }
コード例 #21
0
 public bool Insert()
 {
     objProduct_DAL = new Product_DAL(objProductProperty);
     return(objProduct_DAL.Insert());
 }
コード例 #22
0
 public void Add(Product_DAL product)
 {
     context.Products.Add(ToEntity(product));
 }
コード例 #23
0
ファイル: Product_BUS.cs プロジェクト: tonyho96/source
 public static bool XoaSPCH(Product_DTO sanpham)
 {
     return(Product_DAL.XoaSPCH(sanpham));
 }
コード例 #24
0
 public DataTable ddlUnit()
 {
     objProduct_DAL = new Product_DAL(objProductProperty);
     return(objProduct_DAL.ddlUnit());
 }
コード例 #25
0
 public bool Delete(int?id)
 {
     objProduct_DAL = new Product_DAL(objProductProperty);
     return(objProduct_DAL.Delete(id));
 }
コード例 #26
0
 public DataTable ViewAll()
 {
     objProduct_DAL = new Product_DAL(objProductProperty);
     return(objProduct_DAL.SelectAll());
 }
コード例 #27
0
 public bool Update()
 {
     objProduct_DAL = new Product_DAL(objProductProperty);
     return(objProduct_DAL.Update());
 }