示例#1
0
        public static IOBalanceDBV2Entity.PurchaseOrder DtoToEntity(this OrderDto dto)
        {
            IOBalanceDBV2Entity.PurchaseOrder entity = null;

            if (!dto.IsNull())
            {
                entity = new IOBalanceDBV2Entity.PurchaseOrder
                {
                    PurchaseOrderID = dto.OrderId,
                    DateCreated     = dto.DateCreated,
                    CreatedBy       = dto.CreatedBy
                };
            }

            return(entity);
        }
        public static IOBalanceEntity.PurchaseOrder DtoToEntityPurchaseOrder(this OrderDto dto)
        {
            IOBalanceEntity.PurchaseOrder entity = null;

            if (!dto.IsNull())
            {
                entity = new IOBalanceEntity.PurchaseOrder
                {
                    PurchaseOrderID  = (long)dto.OrderId,
                    PurchaseOrderNum = dto.OrderNum,
                    BranchID         = dto.BranchId,
                    CreatedBy        = dto.CreatedBy,
                    DateCreated      = dto.DateCreated
                };
            }

            return(entity);
        }
        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);
        }