Example #1
0
        //billing manage services

        public static PriceLineDTO Entity2PriceLineDto(this BILL_ItemsPriceList entity, CurrencyDTO currency)
        {
            var token = new PriceLineDTO
            {
                PriceLineID        = entity.PriceLineId
                , ItemId           = entity.ItemId
                , ItemType         = Utils.ParseEnum <BillingEnums.ePurchaseItemTypes>(entity.ItemTypeId)
                , PriceType        = Utils.ParseEnum <BillingEnums.ePricingTypes>(entity.PriceTypeId)
                , Price            = entity.Price.FormatPrice(currency.KeepDecimal ? 2 : 0)
                , Name             = entity.Name
                , NumOfPeriodUnits = entity.NumOfPeriodUnits
                , Currency         = currency.ToBaseCurrencyDto()
            };

            token.Title = token.PriceLineToken2Title();

            if (entity.PeriodTypeId != null)
            {
                token.PeriodType = Utils.ParseEnum <BillingEnums.eBillingPeriodType>(entity.PeriodTypeId.ToString());
            }

            token.Name = token.PriceLineToken2Name();

            return(token);
        }
Example #2
0
        public static void UpdatePriceLine(this BILL_ItemsPriceList entity, decimal?price, bool?isDeleted)
        {
            if (price != null)
            {
                entity.Price = (decimal)price;
            }

            if (isDeleted != null)
            {
                entity.IsDeleted = (bool)isDeleted;
            }

            entity.UpdateOn  = DateTime.Now;
            entity.UpdatedBy = DtoExtensions.CurrentUserId;
        }