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

📄 paymenttype.cs

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

    public sealed class PaymentType
    {
        private static readonly IPaymentType dal = DataAccess.CreatePaymentType();

        private PaymentType()
        {
        }

        public static bool Add(PaymentTypeInfo paymentTypeInfo)
        {
            if (paymentTypeInfo != null)
            {
                paymentTypeInfo.TypeName = DataSecurity.HtmlEncode(paymentTypeInfo.TypeName);
                paymentTypeInfo.Intro = DataSecurity.HtmlEncode(paymentTypeInfo.Intro);
                return dal.Add(paymentTypeInfo);
            }
            return false;
        }

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

        public static string GetCategory(int index)
        {
            switch (index)
            {
                case 1:
                    return "在线支付";

                case 2:
                    return "余额支付";
            }
            return "其它";
        }

        public static PaymentTypeInfo GetPaymentTypeById(int typeId)
        {
            return dal.GetPaymentTypeById(typeId);
        }

        public static PaymentTypeInfo GetPaymentTypeById(int typeId, bool isDecode)
        {
            PaymentTypeInfo paymentTypeById = GetPaymentTypeById(typeId);
            if (!paymentTypeById.IsNull && isDecode)
            {
                paymentTypeById.TypeName = DataSecurity.HtmlDecode(paymentTypeById.TypeName);
                paymentTypeById.Intro = DataSecurity.HtmlDecode(paymentTypeById.Intro);
            }
            return paymentTypeById;
        }

        public static IList<PaymentTypeInfo> GetPaymentTypeList()
        {
            return dal.GetPaymentTypeList();
        }

        public static IList<PaymentTypeInfo> GetPaymentTypeList(int category)
        {
            return dal.GetPaymentTypeList(category);
        }

        public static IList<PaymentTypeInfo> GetPaymentTypeListByEnabled()
        {
            return dal.GetPaymentTypeListByEnabled();
        }

        public static bool Update(PaymentTypeInfo paymentTypeInfo)
        {
            if (paymentTypeInfo != null)
            {
                paymentTypeInfo.TypeName = DataSecurity.HtmlEncode(paymentTypeInfo.TypeName);
                paymentTypeInfo.Intro = DataSecurity.HtmlEncode(paymentTypeInfo.Intro);
                return dal.Update(paymentTypeInfo);
            }
            return false;
        }
    }
}

⌨️ 快捷键说明

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