⭐ 欢迎来到虫虫下载站! | 📦 资源下载 📁 资源专辑 ℹ️ 关于我们
⭐ 虫虫下载站

📄 delivertype.cs

📁 动易SiteFactory&#8482 网上商店系统1.0源代码
💻 CS
字号:
namespace PowerEasy.Shop
{
    using PowerEasy.Common;
    using PowerEasy.Enumerations;
    using PowerEasy.IDal.Shop;
    using PowerEasy.Model.Shop;
    using System;
    using System.Collections.Generic;

    public sealed class DeliverType
    {
        private static readonly IDeliverType dal = DataAccess.CreateDeliverType();

        private DeliverType()
        {
        }

        public static bool Add(DeliverTypeInfo deliverTypeInfo)
        {
            if (deliverTypeInfo == null)
            {
                return false;
            }
            DoHtmlEncode(deliverTypeInfo);
            if (deliverTypeInfo.ChargeType == 0)
            {
                deliverTypeInfo.IncludeTax = TaxRateType.BarringTaxNeedInvoiceNoTax;
            }
            return dal.Add(deliverTypeInfo);
        }

        public static bool Delete(int typeId)
        {
            return dal.Delete(typeId);
        }

        private static void DoHtmlEncode(DeliverTypeInfo deliverTypeInfo)
        {
            deliverTypeInfo.Intro = DataSecurity.HtmlEncode(deliverTypeInfo.Intro);
            deliverTypeInfo.TypeName = DataSecurity.HtmlEncode(deliverTypeInfo.TypeName);
        }

        public static DeliverTypeInfo GetDeliverTypeById(int typeId)
        {
            return dal.GetDeliverTypeById(typeId);
        }

        public static DeliverTypeInfo GetDeliverTypeById(int typeId, bool isDecode)
        {
            DeliverTypeInfo deliverTypeById = GetDeliverTypeById(typeId);
            if (!deliverTypeById.IsNull && isDecode)
            {
                deliverTypeById.Intro = DataSecurity.HtmlDecode(deliverTypeById.Intro);
                deliverTypeById.TypeName = DataSecurity.HtmlDecode(deliverTypeById.TypeName);
            }
            return deliverTypeById;
        }

        public static IList<DeliverTypeInfo> GetDeliverTypeList()
        {
            return dal.GetDeliverTypeList();
        }

        public static IList<DeliverTypeInfo> GetEnableDeliverTypeList()
        {
            return dal.GetEnableDeliverTypeList();
        }

        public static int GetMaxTypeId()
        {
            return dal.GetMaxTypeId();
        }

        public static bool Update(DeliverTypeInfo deliverTypeInfo)
        {
            if (deliverTypeInfo == null)
            {
                return false;
            }
            DoHtmlEncode(deliverTypeInfo);
            if (deliverTypeInfo.ChargeType == 0)
            {
                deliverTypeInfo.IncludeTax = TaxRateType.BarringTaxNeedInvoiceNoTax;
            }
            return dal.Update(deliverTypeInfo);
        }
    }
}

⌨️ 快捷键说明

复制代码 Ctrl + C
搜索代码 Ctrl + F
全屏模式 F11
切换主题 Ctrl + Shift + D
显示快捷键 ?
增大字号 Ctrl + =
减小字号 Ctrl + -