Пример #1
0
        public long SaveSalesOrder(SalesOrderDto newDetails)
        {
            this.salesOrder = newDetails.DtoToEntity();
            var insertedSalesOrder = this._salesOrder.Insert(this.salesOrder);

            if (insertedSalesOrder.IsNull())
            {
                return(0);
            }

            return(insertedSalesOrder.SalesOrderID);
        }
Пример #2
0
        public static IOBalanceDBV2Entity.SalesOrder DtoToEntity(this SalesOrderDto dto)
        {
            IOBalanceDBV2Entity.SalesOrder entity = null;

            if (!dto.IsNull())
            {
                entity = new IOBalanceDBV2Entity.SalesOrder
                {
                    SalesOrderID = dto.SalesOrderId,
                    SalesNo      = dto.SalesNo,
                    CustomerID   = dto.CustomerId,
                    DateCreated  = dto.DateCreated,
                    CreatedBy    = dto.CreatedBy,
                    IsPrinted    = dto.IsPrinted,
                    IsCorrected  = dto.IsCorrected
                };
            }

            return(entity);
        }
Пример #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();
        }