Ejemplo n.º 1
0
        public bool SaveSalesOrderDetail(SalesOrderDetailDto newDetails)
        {
            this.salesOrderDetail = newDetails.DtoToEntity();

            if (this._salesOrderDetail.Insert(this.salesOrderDetail).IsNull())
            {
                return(false);
            }

            //_inventoryService.UpdateQuantityOrder(newDetails.ProductId, newDetails.Quantity, Enums.OrderType.SalesOrder);

            return(true);
        }
Ejemplo n.º 2
0
        public static IOBalanceDBV2Entity.SalesOrderDetail DtoToEntity(this SalesOrderDetailDto dto)
        {
            IOBalanceDBV2Entity.SalesOrderDetail entity = null;

            if (!dto.IsNull())
            {
                entity = new IOBalanceDBV2Entity.SalesOrderDetail
                {
                    SalesOrderID = dto.SalesOrderId,
                    ProductID    = dto.ProductId,
                    SalesPrice   = dto.SalesPrice,
                    UnitPrice    = dto.UnitPrice,
                    Quantity     = dto.Quantity,
                    DateCreated  = dto.DateCreated,
                    CreatedBy    = dto.CreatedBy
                };
            }

            return(entity);
        }
Ejemplo n.º 3
0
        public OrderService(
            IIOBalanceV2Repository <PurchaseOrder> purchaseOrder,
            IIOBalanceV2Repository <PurchaseOrderDetail> purchaseOrderDetail,
            IIOBalanceV2Repository <SalesOrder> salesOrder,
            IIOBalanceV2Repository <SalesOrderDetail> salesOrderDetail,
            IInventoryService inventoryService,
            ISupplierService supplierService,
            ICustomerService customerService)
        {
            this._purchaseOrder       = purchaseOrder;
            this._purchaseOrderDetail = purchaseOrderDetail;
            this._inventoryService    = inventoryService;
            this._supplierService     = supplierService;
            this._customerService     = customerService;
            this._salesOrder          = salesOrder;
            this._salesOrderDetail    = salesOrderDetail;

            this.purchaseOrder       = new IOBalanceDBV2Entity.PurchaseOrder();
            this.purchaseOrderDetail = new IOBalanceDBV2Entity.PurchaseOrderDetail();
            this.salesOrder          = new IOBalanceDBV2Entity.SalesOrder();
            this.salesOrderDetail    = new IOBalanceDBV2Entity.SalesOrderDetail();
        }