예제 #1
0
 public static BaseCurrencyDTO Entity2BaseCurrencyDto(this SALE_OrderLineViewToken entity)
 {
     return(new BaseCurrencyDTO
     {
         CurrencyId = entity.CurrencyId ?? Constants.DEFAULT_CURRENCY_ID
         , CurrencyName = entity.CurrencyName ?? string.Empty
         , ISO = entity.ISO ?? string.Empty
         , Symbol = entity.Symbol ?? string.Empty
     });
 }
예제 #2
0
        public static OrderLineDTO Entity2OrderLineDto(this SALE_OrderLineViewToken entity)
        {
            var pm = Utils.ParseEnum <BillingEnums.ePaymentTerms>(entity.PaymentTermId);

            return(new OrderLineDTO
            {
                LineId = entity.LineId
                , OrderNumber = entity.OrderNumber
                , OrderId = entity.OrderId
                , OrderDate = entity.OrderDate
                , ItemName = entity.ItemName
                , Price = entity.Price
                , Discount = entity.Discount
                , TotalPrice = entity.TotalPrice
                , TotalAmount = entity.TotalAmountPayed
                , Currency = entity.Entity2BaseCurrencyDto()
                , PaymentMethod = Utils.ParseEnum <BillingEnums.ePaymentMethods>(entity.PaymentMethodId)
                , OrderStatus = Utils.ParseEnum <BillingEnums.eOrderStatuses>(entity.OrderStatusId)
                , Status = Utils.GetEnumDescription(Utils.ParseEnum <BillingEnums.eOrderStatuses>(entity.OrderStatusId))
                , LineType = Utils.ParseEnum <BillingEnums.eOrderLineTypes>(entity.LineTypeId)
                , PaymentTerm = pm
                , PaymentTermName = Utils.GetEnumDescription(pm)
                , PaypalProfileID = entity.PaypalProfileID
                , TotalRefunded = entity.TotalRefunded
                , CouponValue = entity.OrderLineEntity2CouponDisplayValue()
                , Buyer = new BaseUserInfoDTO
                {
                    UserId = entity.BuyerUserId
                    , FullName = entity.Entity2BuyerFullName()
                    , Email = entity.BuyerEmail
                }
                , Seller = new BaseUserInfoDTO
                {
                    UserId = entity.SellerUserId
                    , FullName = entity.Entity2SellerFullName()
                    , Email = entity.SellerEmail
                }
                , WebStore = entity.WebStoreId != null ? new BaseWebStoreDTO
                {
                    StoreId = (int)entity.WebStoreId
                    , TrackingID = entity.TrackingID
                    , Name = entity.StoreName
                } : new BaseWebStoreDTO()
                , IsUnderGRP = entity.IsUnderRGP
                , IsGRPRefundable = entity.IsUnderRGP && DateTime.Now.Subtract(entity.OrderDate).Days <= 30 && entity.TotalRefunded == 0
            });
        }
예제 #3
0
 public static string Entity2BuyerFullName(this SALE_OrderLineViewToken entity)
 {
     return(CombineFullName(entity.BuyerFirstName, entity.BuyerLastName, entity.BuyerNickName));
 }
예제 #4
0
 private static string OrderLineEntity2CouponDisplayValue(this SALE_OrderLineViewToken entity)
 {
     return(entity.CouponTypeId == null ? string.Empty : CombineCouponDisplayValue((byte)entity.CouponTypeId, entity.CouponTypeAmount));
 }