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 #2
0
        public long SaveSalesOrder(OrderDto dto)
        {
            this.salesOrder = dto.DtoToEntitySalesOrder();
            if (_salesOrder.Insert(this.salesOrder).IsNull())
            {
                return(0);
            }

            return(this.salesOrder.SalesOrderID);
        }
Example #3
0
        public OrderService(IIOBalanceRepository <PurchaseOrder> purchaseOrder,
                            IIOBalanceRepository <PurchaseOrderDetail> purchaseOrderDetail,
                            IIOBalanceRepository <SalesOrder> salesOrder,
                            IIOBalanceRepository <SalesOrderDetail> salesOrderDetail,
                            IIOBalanceRepository <ReportCombination> reportCombination,
                            IInventoryService inventoryService)
        {
            this._purchaseOrder       = purchaseOrder;
            this._purchaseOrderDetail = purchaseOrderDetail;
            this._salesOrder          = salesOrder;
            this._salesOrderDetail    = salesOrderDetail;
            this._reportCombination   = reportCombination;
            this._inventoryService    = inventoryService;

            this.purchaseOrder       = new IOBalanceEntity.PurchaseOrder();
            this.purchaseOrderDetail = new IOBalanceEntity.PurchaseOrderDetail();
            this.salesOrder          = new IOBalanceEntity.SalesOrder();
            this.salesOrderDetail    = new IOBalanceEntity.SalesOrderDetail();
            this.reportCombination   = new IOBalanceEntity.ReportCombination();
        }
        public static IOBalanceEntity.SalesOrder DtoToEntitySalesOrder(this OrderDto dto)
        {
            IOBalanceEntity.SalesOrder entity = null;

            if (!dto.IsNull())
            {
                entity = new IOBalanceEntity.SalesOrder
                {
                    SalesOrderID       = dto.OrderId,
                    SalesOrderNum      = dto.OrderNum,
                    Messenger          = dto.Messenger,
                    PaymentTerms       = dto.PaymentTerms,
                    BranchID           = dto.BranchId,
                    CustomerID         = dto.CustomerId,
                    CreatedBy          = dto.CreatedBy,
                    DateCreated        = dto.DateCreated,
                    DiscountPercentage = dto.DiscountPercentage
                };
            }

            return(entity);
        }