using System;
using System.Collections.Generic;
using System.Linq;
using MySystem.MainModels;

namespace MySystem
{
    public class RelationClass
    {

        public static string GetUserLevelSetInfo(int key)
        {
            UserLevelSet item = UserLevelSetDbconn.Instance.GetList().FirstOrDefault(m => m.Id == key);
            if (item != null)
            {
                return item.Name;
            }
            return "K1";
        }



        public static string GetUsersInfo(int key)
        {
            Users item = UsersDbconn.Instance.Get(key) ?? new Users();
            return item.RealName;
        }

        public static string GetConsumersInfo(int key)
        {
            Consumers item = ConsumersDbconn.Instance.Get(key) ?? new Consumers();
            return item.NickName;
        }


        #region 获取产品名称
        public static string GetKqProductBrandInfo(int key)
        {
            WebCMSEntities db = new WebCMSEntities();
            KqProducts pro = db.KqProducts.FirstOrDefault(m => m.Id == key);
            db.Dispose();
            if (pro != null)
            {
                return pro.Name;
            }
            return "";
        }
        #endregion


        #region 收支明细变动类型
        public static string GetChangeTypeInfo(int key)
        {
            if (key == 0) return "激活奖励";
            if (key == 1) return "交易分润";
            if (key == 11) return "月月红";
            if (key == 12) return "交易奖励";
            if (key == 2) return "提现申请";
            if (key == 3) return "提现代付";
            if (key == 4) return "提现手续费";
            if (key == 5) return "提现税点扣除";
            if (key == 6) return "提现失败,解冻";
            if (key == 61) return "系统冻结";
            if (key == 62) return "系统解冻";
            if (key == 63) return "系统扣减";
            if (key == 64) return "系统奖励";
            if (key == 65) return "押金暂扣";
            if (key == 66) return "押金退还";
            if (key == 7) return "系统扣除";
            if (key == 10) return "办卡奖励";
            if (key == 20) return "余额支付";
            if (key == 21) return "余额退款";
            if (key == 22) return "余额退款手续费";
            if (key == 30) return "红包奖励";
            if (key == 31) return "活动奖励";
            if (key == 40) return "商户达标返";
            if (key == 50) return "开机奖励";
            if (key == 60) return "流量卡分佣";
            if (key == 111) return "分润补贴";
            if (key == 112) return "推荐奖励";
            if (key == 113) return "招商节奖励";
            if (key == 114) return "私董会分红";
            if (key == 115) return "分仓奖励";
            if (key == 116) return "大盟主奖励";
            if (key == 117) return "盟主奖励(储蓄金入账)";
            if (key == 118) return "盟主奖励(购机奖励)";
            if (key == 119) return "分仓临时额度退还";
            if (key == 120) return "运营中心(购机奖励)";
            if (key == 121) return "运营中心奖励";
            if (key == 122) return "推荐大盟主奖励";
            if (key == 123) return "推荐小盟主奖励";
            if (key == 124) return "扣机具货款";
            if (key == 125) return "软件服务费";
            if (key == 126) return "机具货款退还";
            return "";
        }
        #endregion

        #region 机具类型
        public static string GetPosSnTypeInfo(int key)
        {
            if (key == 0) return "兑换机";
            if (key == 1) return "循环机";
            return "";
        }
        #endregion

        #region 订单状态
        public static string GetOrderStatusInfo(int key)
        {
            if (key == 0) return "待付款";
            if (key == 1) return "待发货";
            if (key == 2) return "已完成";
            if (key == 3) return "已发货";
            return "";
        }
        #endregion

        #region 机具兑换申请状态
        public static string GetMachineApplyStatusInfo(int key)
        {
            if (key == 0) return "待审核";
            if (key == 1) return "申请成功";
            if (key == 2) return "申请失败";
            return "";
        }
        #endregion

        #region 组队申请状态
        public static string GetTeamOfferApplyStatusInfo(int key)
        {
            if (key == 0) return "待审核";
            if (key == 1) return "审核通过";
            if (key == 2) return "审核失败";
            if (key == 3) return "组队成功";
            if (key == 4) return "组队失败";
            return "";
        }
        #endregion

        #region 商户激活类型
        public static string GetMerchantActTypeInfo(int key)
        {
            if (key == 0) return "正常激活";
            if (key == 1) return "首次已激活MPOS";
            if (key == 2) return "首次已激活KPOS";
            if (key == 3) return "循环机划拨激活";
            return "";
        }
        #endregion


    }
}