Example #1
0
        public bool VoidQty(ProductDto dto)
        {
            var oldProductDetails = FindByProductId(dto.ProductID);

            this.product = new Product()
            {
                ProductID        = oldProductDetails.ProductID,
                ProductCode      = oldProductDetails.ProductCode,
                ProductName      = oldProductDetails.ProductName,
                ProductDesc      = oldProductDetails.ProductDesc,
                ProductExtension = oldProductDetails.ProductExtension,
                Quantity         = dto.CRType == "+" ? (dto.Quantity + oldProductDetails.Quantity) : (oldProductDetails.Quantity - dto.Quantity),
                Price            = oldProductDetails.Price,
                OriginalPrice    = oldProductDetails.OriginalPrice,
                Size             = oldProductDetails.Size,
                CategoryID       = oldProductDetails.CategoryID,
                IsActive         = oldProductDetails.IsActive,
                Remarks          = oldProductDetails.Remarks,
                CreatedBy        = oldProductDetails.CreatedBy,
                DateCreated      = oldProductDetails.DateCreated,
                UpdatedBy        = dto.UpdatedBy,
                DateUpdated      = dto.DateUpdated,
                ProductImage     = oldProductDetails.ProductImage,
                BranchID         = oldProductDetails.BranchID,
                BarCode          = oldProductDetails.BarCode
            };


            if (this._product.Update2(this.product).IsNull())
            {
                return(false);
            }
            return(true);
        }
Example #2
0
        public bool UpdateProductQtyOrder(long productId, ProductDto updatedProductDetails, string orderTypeAbbrev)
        {
            var oldProductDetails = FindByProductId(productId);

            this.product = new Product()
            {
                ProductID        = productId,
                ProductCode      = oldProductDetails.ProductCode,
                ProductName      = oldProductDetails.ProductName,
                ProductDesc      = oldProductDetails.ProductDesc,
                ProductExtension = oldProductDetails.ProductExtension,
                Quantity         = orderTypeAbbrev == "PO" ? (oldProductDetails.Quantity + updatedProductDetails.Quantity) : (oldProductDetails.Quantity - updatedProductDetails.Quantity),
                Price            = oldProductDetails.Price,
                OriginalPrice    = oldProductDetails.OriginalPrice,
                Size             = oldProductDetails.Size,
                CategoryID       = oldProductDetails.CategoryID,
                IsActive         = oldProductDetails.IsActive,
                Remarks          = oldProductDetails.Remarks,
                CreatedBy        = oldProductDetails.CreatedBy,
                DateCreated      = oldProductDetails.DateCreated,
                UpdatedBy        = updatedProductDetails.UpdatedBy,
                DateUpdated      = updatedProductDetails.DateUpdated,
                ProductImage     = oldProductDetails.ProductImage,
                BranchID         = oldProductDetails.BranchID,
                BarCode          = oldProductDetails.BarCode
            };


            if (this._product.Update2(this.product).IsNull())
            {
                return(false);
            }
            return(true);
        }
        public static IOBalanceEntity.Product DtoToEntity(this ProductDto dto)
        {
            IOBalanceEntity.Product entity = null;

            if (!dto.IsNull())
            {
                entity = new IOBalanceEntity.Product
                {
                    ProductID        = dto.ProductID,
                    ProductCode      = dto.ProductCode,
                    ProductName      = dto.ProductName,
                    ProductDesc      = dto.ProductDesc,
                    ProductExtension = dto.ProductExtension,
                    Quantity         = dto.Quantity,
                    Price            = dto.Price,
                    OriginalPrice    = dto.OriginalPrice,
                    CategoryID       = dto.CategoryID,
                    IsActive         = dto.IsActive,
                    Remarks          = dto.Remarks,
                    CreatedBy        = dto.CreatedBy,
                    DateCreated      = dto.DateCreated,
                    UpdatedBy        = dto.UpdatedBy,
                    DateUpdated      = dto.DateUpdated,
                    ModelID          = dto.ModelID,
                    ProductImage     = dto.ProductImage,
                    Size             = dto.Size,
                    BranchID         = dto.BranchID,
                    BarCode          = dto.BarCode
                };
            }

            return(entity);
        }
        public SalesService(IIOBalanceRepository <Product> product,
                            IOrderService orderService)
        {
            this._product      = product;
            this._orderService = orderService;

            this.product          = new Product();
            this.salesOrder       = new SalesOrder();
            this.salesOrderDetail = new SalesOrderDetail();
        }
Example #5
0
        public long SaveProduct(ProductDto dto)
        {
            this.product = dto.DtoToEntity();

            if (this._product.Insert(this.product).IsNull())
            {
                return(0);
            }

            return(this.product.ProductID);
        }
Example #6
0
        public InventoryService(IIOBalanceRepository <Product> product,
                                IIOBalanceRepository <BatchSummary> batchSummary,
                                IIOBalanceRepository <BatchProductLog> batchProductLog)
        {
            this._product         = product;
            this._batchSummary    = batchSummary;
            this._batchProductLog = batchProductLog;

            this.product             = new Product();
            this.purchaseOrder       = new PurchaseOrder();
            this.purchaseOrderDetail = new PurchaseOrderDetail();
            this.batchSummary        = new BatchSummary();
            this.batchProductLog     = new BatchProductLog();
        }
Example #7
0
        public bool UpdateProductDetails(long productId, ProductDto updatedProductDetails)
        {
            var oldProductDetails = FindByProductId(productId);

            this.product = new Product()
            {
                ProductID        = productId,
                ProductCode      = updatedProductDetails.ProductCode,
                ProductName      = updatedProductDetails.ProductName,
                ProductDesc      = updatedProductDetails.ProductDesc,
                ProductExtension = updatedProductDetails.ProductExtension,
                Quantity         = oldProductDetails.Quantity,
                Price            = updatedProductDetails.Price,
                OriginalPrice    = updatedProductDetails.OriginalPrice == null ? oldProductDetails.OriginalPrice : updatedProductDetails.OriginalPrice,
                Size             = updatedProductDetails.Size,
                CategoryID       = updatedProductDetails.CategoryID,
                ModelID          = oldProductDetails.ModelID,
                IsActive         = oldProductDetails.IsActive,
                Remarks          = updatedProductDetails.Remarks,
                CreatedBy        = oldProductDetails.CreatedBy,
                DateCreated      = oldProductDetails.DateCreated,
                UpdatedBy        = updatedProductDetails.UpdatedBy,
                DateUpdated      = updatedProductDetails.DateUpdated,
                ProductImage     = oldProductDetails.ProductImage,
                BranchID         = updatedProductDetails.BranchID,
                BarCode          = updatedProductDetails.BarCode
            };


            if (this._product.Update2(this.product).IsNull())
            {
                return(false);
            }

            return(true);
        }