using System;
using ChuPiao.Common.Enums;
using System.Collections.Generic;

namespace ChuPiao.Common.Models
{
    /// <summary>
    /// 期号实体类
    /// </summary>
    [Serializable]
    public class L_ExpectEntity : ICloneable
    {
        public L_ExpectEntity()
        { }

        /// <summary>
        /// 根据彩种id初始化固定奖金
        /// </summary>
        /// <param name="lotid"></param>
        public L_ExpectEntity(int lotid)
        {
            Lottype lottype = (Lottype)lotid;
            //if (lottype == null)
            //{
            //    throw new Exception(string.Format("枚举[Lottype]中不包含[{0}]对应的彩种！", lotid));
            //}
            switch (lottype)
            {
                case Lottype.Lt:
                    _e_levelmoney04 = _e_maclevelmoney04 = 3000;
                    _e_levelmoney05 = _e_maclevelmoney05 = 600;
                    _e_levelmoney06 = _e_maclevelmoney06 = 100;
                    _e_levelmoney07 = _e_maclevelmoney07 = 10;
                    _e_levelmoney08 = _e_maclevelmoney08 = 5;
                    _e_levelmoney09 = _e_maclevelmoney09 = 60;
                    _e_levelmoney13 = _e_maclevelmoney13 = 4500;
                    _e_levelmoney14 = _e_maclevelmoney14 = 900;
                    _e_levelmoney15 = _e_maclevelmoney15 = 150;
                    _e_levelmoney16 = _e_maclevelmoney16 = 15;
                    _e_levelmoney17 = _e_maclevelmoney17 = 5;
                    _e_levelmoney_diamond01 = 10000;
                    _e_levelmoney_diamond02 = 100;
                    _e_levelmoney_diamond03 = 6;
                    _e_levelmoney_diamond04 = 2;
                    break;
                case Lottype.Ps:
                    _e_levelmoney01 = _e_maclevelmoney01 = 1000;
                    _e_levelmoney02 = _e_maclevelmoney02 = 320;
                    _e_levelmoney03 = _e_maclevelmoney03 = 160;
                    break;
                case Lottype.Pw:
                    _e_levelmoney01 = _e_maclevelmoney01 = 100000;
                    break;
                case Lottype.Qx:
                    _e_levelmoney03 = _e_maclevelmoney03 = 1800;
                    _e_levelmoney04 = _e_maclevelmoney04 = 300;
                    _e_levelmoney05 = _e_maclevelmoney05 = 20;
                    _e_levelmoney06 = _e_maclevelmoney06 = 5;
                    break;
                case Lottype.Xw:
                    _e_levelmoney02 = _e_maclevelmoney02 = 50;
                    _e_levelmoney03 = _e_maclevelmoney03 = 5;
                    break;

            }
        }

        #region Model
        private int _e_id;
        private string _e_expect;
        private int _e_status = 0;
        private int _e_active = 0;
        private string _e_opencode = "";
        private DateTime _e_starttime = DateTime.Now;
        private DateTime _e_endtime = DateTime.Now;
        private DateTime _e_apistarttime = DateTime.Now;
        private DateTime _e_apiendtime = DateTime.Now;
        private DateTime _e_opentime = DateTime.Now;
        private DateTime _e_getopencodetime = DateTime.Now;
        private DateTime _e_marktime = DateTime.Parse("1900-01-01");
        private int _e_opencodesource = 0;

        /// <summary>
        /// 出票登记时间
        /// </summary>
        public DateTime E_MarkTime
        {
            set { _e_marktime = value; }
            get { return _e_marktime; }
        }

        /// <summary>
        /// 主键ID
        /// </summary>
        public int E_Id
        {
            set { _e_id = value; }
            get { return _e_id; }
        }
        /// <summary>
        /// 期号
        /// </summary>
        public string E_Expect
        {
            set { _e_expect = value; }
            get { return _e_expect; }
        }
        /// <summary>
        /// 期号状态  等待审核期号时间 -100；默认状态， 未开期 0；已开期，出票中 100，已停售，等待开奖 200；已开奖，等待获得开奖等级奖金 300；已开奖，等待算奖 400，已算奖，等待审核 500，审核失败 550，审核成功 600，兑奖完成，封期 800
        /// </summary>
        public int E_Status
        {
            set { _e_status = value; }
            get { return _e_status; }
        }

        public string E_StatusName
        {
            get
            {
                string name = "默认，不可出票";
                switch (_e_status.ToString())
                {
                    case "100":
                        name = "已开售，可出票";
                        break;
                    case "200":
                        name = "等待开奖";
                        break;
                    case "400":
                        name = "已开奖";
                        break;
                    case "500":
                        name = "已算奖";
                        break;
                    case "550":
                        name = "审核失败";
                        break;
                    case "600":
                        name = "审核成功";
                        break;
                    case "800":
                        name = "结期";
                        break;
                }

                return name;
            }
        }

        /// <summary>
        /// 是否当前期
        /// </summary>
        public int E_Active
        {
            set { _e_active = value; }
            get { return _e_active; }
        }

        /// <summary>
        /// 是否当前期名称
        /// </summary>
        public string E_Activename
        {
            get { return E_Active == 1 ? "是" : "否"; }
        }

        /// <summary>
        /// 开奖号码，比分
        /// </summary>
        public string E_OpenCode
        {
            set { _e_opencode = value; }
            get { return _e_opencode; }
        }
        /// <summary>
        /// 官方开期时间
        /// </summary>
        public DateTime E_StartTime
        {
            set { _e_starttime = value; }
            get { return _e_starttime; }
        }
        /// <summary>
        /// 官方结期时间
        /// </summary>
        public DateTime E_EndTime
        {
            set { _e_endtime = value; }
            get { return _e_endtime; }
        }
        /// <summary>
        /// 出票开始时间
        /// </summary>
        public DateTime E_ApiStartTime
        {
            set { _e_apistarttime = value; }
            get { return _e_apistarttime; }
        }
        /// <summary>
        /// 出票截止时间
        /// </summary>
        public DateTime E_ApiEndTime
        {
            set { _e_apiendtime = value; }
            get { return _e_apiendtime; }
        }
        /// <summary>
        /// 官方公布开奖时间
        /// </summary>
        public DateTime E_OpenTime
        {
            set { _e_opentime = value; }
            get { return _e_opentime; }
        }
        /// <summary>
        /// 获得开奖号码的时间
        /// </summary>
        public DateTime E_GetOpenCodeTime
        {
            set { _e_getopencodetime = value; }
            get { return _e_getopencodetime; }
        }
        /// <summary>
        /// 开奖号码来源  0--彩票机；100--广天地；500--500WAN
        /// </summary>
        public int E_OpenCodeSource
        {
            set { _e_opencodesource = value; }
            get { return _e_opencodesource; }
        }
        #endregion Model

        #region 扩展属性
        private int _lotId;
        private string[] _openCodes;
        private int _hZ = -1;
        private int _kD = -1;
        private Dictionary<int, L_RateEntity> _e_ratesmap = null;
        /// <summary>
        /// 期号对应的各玩法赔率map
        /// </summary>
        public Dictionary<int, L_RateEntity> RatesMap
        {
            get { return _e_ratesmap; }
            set { _e_ratesmap = value; }
        }
        public L_RateEntity getRate(int playtype)
        {
            if (!_e_ratesmap.ContainsKey(playtype))
            {
                return null;
            }
            return _e_ratesmap[playtype];
        }
      
      
        /// <summary>
        /// 彩种ID
        /// </summary>
        public int LotId
        {
            get { return _lotId; }
            set { _lotId = value; }
        }
        /// <summary>
        /// 开奖号码
        /// </summary>
        public string[] OpenCodes
        {
            get { return _openCodes; }
            set { _openCodes = value; }
        }

        public int HZ
        {
            get { return _hZ; }
            set { _hZ = value; }
        }

        public int KD
        {
            get { return _kD; }
            set { _kD = value; }
        }

        private string _expectsn = "1";
        /// <summary>
        /// 期号序列号
        /// </summary>
        public string ExpectSn
        {
            set { _expectsn = value; }
            get { return _expectsn; }
        }
        #endregion

        #region 奖级信息

        private decimal _e_levelmoney01;
        private decimal _e_levelmoney02;
        private decimal _e_levelmoney03;
        private decimal _e_levelmoney04;
        private decimal _e_levelmoney05;
        private decimal _e_levelmoney06;
        private decimal _e_levelmoney07;
        private decimal _e_levelmoney08;
        private decimal _e_levelmoney09;
        private decimal _e_levelmoney10;
        private decimal _e_levelmoney11;
        private decimal _e_levelmoney12;
        private decimal _e_levelmoney13;
        private decimal _e_levelmoney14;
        private decimal _e_levelmoney15;
        private decimal _e_levelmoney16;
        private decimal _e_levelmoney17;
        /// <summary>
        /// 1等奖奖金,多乐彩前1直选
        /// </summary>
        public decimal E_LevelMoney01
        {
            set { _e_levelmoney01 = value; }
            get { return _e_levelmoney01; }
        }
        /// <summary>
        /// 2等奖奖金,前2直选
        /// </summary>
        public decimal E_LevelMoney02
        {
            set { _e_levelmoney02 = value; }
            get { return _e_levelmoney02; }
        }
        /// <summary>
        /// 3等奖奖金,前3直选
        /// </summary>
        public decimal E_LevelMoney03
        {
            set { _e_levelmoney03 = value; }
            get { return _e_levelmoney03; }
        }
        /// <summary>
        /// 4等奖奖金,前2组选
        /// </summary>
        public decimal E_LevelMoney04
        {
            set { _e_levelmoney04 = value; }
            get { return _e_levelmoney04; }
        }
        /// <summary>
        /// 5等奖奖金,前3组选
        /// </summary>
        public decimal E_LevelMoney05
        {
            set { _e_levelmoney05 = value; }
            get { return _e_levelmoney05; }
        }
        /// <summary>
        /// 6等奖奖金，任选2
        /// </summary>
        public decimal E_LevelMoney06
        {
            set { _e_levelmoney06 = value; }
            get { return _e_levelmoney06; }
        }
        /// <summary>
        /// 7等奖奖金，任选3
        /// </summary>
        public decimal E_LevelMoney07
        {
            set { _e_levelmoney07 = value; }
            get { return _e_levelmoney07; }
        }
        /// <summary>
        /// 8等奖奖金，任选4
        /// </summary>
        public decimal E_LevelMoney08
        {
            set { _e_levelmoney08 = value; }
            get { return _e_levelmoney08; }
        }
        /// <summary>
        /// 12选2奖金，任选5
        /// </summary>
        public decimal E_LevelMoney09
        {
            set { _e_levelmoney09 = value; }
            get { return _e_levelmoney09; }
        }
        /// <summary>
        /// 追加一等奖奖金，任选6
        /// </summary>
        public decimal E_LevelMoney10
        {
            set { _e_levelmoney10 = value; }
            get { return _e_levelmoney10; }
        }
        /// <summary>
        /// 追加二等奖奖金，任选7
        /// </summary>
        public decimal E_LevelMoney11
        {
            set { _e_levelmoney11 = value; }
            get { return _e_levelmoney11; }
        }
        /// <summary>
        /// 追加三等奖奖金，任选8
        /// </summary>
        public decimal E_LevelMoney12
        {
            set { _e_levelmoney12 = value; }
            get { return _e_levelmoney12; }
        }
        /// <summary>
        /// 追加四等奖奖金
        /// </summary>
        public decimal E_LevelMoney13
        {
            set { _e_levelmoney13 = value; }
            get { return _e_levelmoney13; }
        }
        /// <summary>
        /// 追加五等奖奖金
        /// </summary>
        public decimal E_LevelMoney14
        {
            set { _e_levelmoney14 = value; }
            get { return _e_levelmoney14; }
        }
        /// <summary>
        /// 追加六等奖奖金
        /// </summary>
        public decimal E_LevelMoney15
        {
            set { _e_levelmoney15 = value; }
            get { return _e_levelmoney15; }
        }
        /// <summary>
        /// 追加七等奖奖金
        /// </summary>
        public decimal E_LevelMoney16
        {
            set { _e_levelmoney16 = value; }
            get { return _e_levelmoney16; }
        }
        /// <summary>
        /// 追加八等奖奖金
        /// </summary>
        public decimal E_LevelMoney17
        {
            set { _e_levelmoney17 = value; }
            get { return _e_levelmoney17; }
        }

        /// <summary>
        /// 设置开奖等级奖金
        /// </summary>
        /// <param name="level"></param>
        /// <param name="money"></param>
        public void SetOpenLevelMoney(int level, decimal money)
        {
            switch (level)
            {
                case 1:
                    this.E_LevelMoney01 = money;
                    break;
                case 2:
                    this.E_LevelMoney02 = money;
                    break;
                case 3:
                    this.E_LevelMoney03 = money;
                    break;
                case 4:
                    this.E_LevelMoney04 = money;
                    break;
                case 5:
                    this.E_LevelMoney05 = money;
                    break;
                case 6:
                    this.E_LevelMoney06 = money;
                    break;
                case 7:
                    this.E_LevelMoney07 = money;
                    break;
                case 8:
                    this.E_LevelMoney08 = money;
                    break;
                case 9:
                    this.E_LevelMoney09 = money;
                    break;
                case 10:
                    this.E_LevelMoney10 = money;
                    break;
                case 11:
                    this.E_LevelMoney11 = money;
                    break;
                case 12:
                    this.E_LevelMoney12 = money;
                    break;
                case 13:
                    this.E_LevelMoney13 = money;
                    break;
                case 14:
                    this.E_LevelMoney14 = money;
                    break;
                case 15:
                    this.E_LevelMoney15 = money;
                    break;
                case 16:
                    this.E_LevelMoney16 = money;
                    break;
                case 17:
                    this.E_LevelMoney17 = money;
                    break;
            }
        }
        /// <summary>
        /// 获取开奖等级奖金
        /// </summary>
        /// <param name="level"></param>
        /// <returns></returns>
        public decimal GetOpenLevelMoney(int level)
        {
            decimal result = 0;
            switch (level)
            {
                case 1:
                    result = this.E_LevelMoney01;
                    break;
                case 2:
                    result = this.E_LevelMoney02;
                    break;
                case 3:
                    result = this.E_LevelMoney03;
                    break;
                case 4:
                    result = this.E_LevelMoney04;
                    break;
                case 5:
                    result = this.E_LevelMoney05;
                    break;
                case 6:
                    result = this.E_LevelMoney06;
                    break;
                case 7:
                    result = this.E_LevelMoney07;
                    break;
                case 8:
                    result = this.E_LevelMoney08;
                    break;
                case 9:
                    result = this.E_LevelMoney09;
                    break;
                case 10:
                    result = this.E_LevelMoney10;
                    break;
                case 11:
                    result = this.E_LevelMoney11;
                    break;
                case 12:
                    result = this.E_LevelMoney12;
                    break;
                case 13:
                    result = this.E_LevelMoney13;
                    break;
                case 14:
                    result = this.E_LevelMoney14;
                    break;
                case 15:
                    result = this.E_LevelMoney15;
                    break;
                case 16:
                    result = this.E_LevelMoney16;
                    break;
                case 17:
                    result = this.E_LevelMoney17;
                    break;
            }
            return result;
        }

        #endregion

        #region 手工录入彩票机开奖信息之奖级信息
        private string _e_macopencode;
        private decimal _e_maclevelmoney01;
        private decimal _e_maclevelmoney02;
        private decimal _e_maclevelmoney03;
        private decimal _e_maclevelmoney04;
        private decimal _e_maclevelmoney05;
        private decimal _e_maclevelmoney06;
        private decimal _e_maclevelmoney07;
        private decimal _e_maclevelmoney08;
        private decimal _e_maclevelmoney09;
        private decimal _e_maclevelmoney10;
        private decimal _e_maclevelmoney11;
        private decimal _e_maclevelmoney12;
        private decimal _e_maclevelmoney13;
        private decimal _e_maclevelmoney14;
        private decimal _e_maclevelmoney15;
        private decimal _e_maclevelmoney16;
        private decimal _e_maclevelmoney17;
        private DateTime _e_getmacopencodetime;

        /// <summary>
        /// 开奖号码（手工录入彩票机开奖信息）
        /// </summary>
        public string E_MacOpenCode
        {
            get { return _e_macopencode; }
            set { _e_macopencode = value; }
        }
        /// <summary>
        /// 1等奖奖金（手工录入彩票机开奖信息）
        /// </summary>
        public decimal E_MacLevelMoney01
        {
            set { _e_maclevelmoney01 = value; }
            get { return _e_maclevelmoney01; }
        }
        /// <summary>
        /// 2等奖奖金（手工录入彩票机开奖信息）
        /// </summary>
        public decimal E_MacLevelMoney02
        {
            set { _e_maclevelmoney02 = value; }
            get { return _e_maclevelmoney02; }
        }
        /// <summary>
        /// 3等奖奖金（手工录入彩票机开奖信息）
        /// </summary>
        public decimal E_MacLevelMoney03
        {
            set { _e_maclevelmoney03 = value; }
            get { return _e_maclevelmoney03; }
        }
        /// <summary>
        /// 4等奖奖金（手工录入彩票机开奖信息）
        /// </summary>
        public decimal E_MacLevelMoney04
        {
            set { _e_maclevelmoney04 = value; }
            get { return _e_maclevelmoney04; }
        }
        /// <summary>
        /// 5等奖奖金（手工录入彩票机开奖信息）
        /// </summary>
        public decimal E_MacLevelMoney05
        {
            set { _e_maclevelmoney05 = value; }
            get { return _e_maclevelmoney05; }
        }
        /// <summary>
        /// 6等奖奖金（手工录入彩票机开奖信息）
        /// </summary>
        public decimal E_MacLevelMoney06
        {
            set { _e_maclevelmoney06 = value; }
            get { return _e_maclevelmoney06; }
        }
        /// <summary>
        /// 7等奖奖金（手工录入彩票机开奖信息）
        /// </summary>
        public decimal E_MacLevelMoney07
        {
            set { _e_maclevelmoney07 = value; }
            get { return _e_maclevelmoney07; }
        }
        /// <summary>
        /// 8等奖奖金（手工录入彩票机开奖信息）
        /// </summary>
        public decimal E_MacLevelMoney08
        {
            set { _e_maclevelmoney08 = value; }
            get { return _e_maclevelmoney08; }
        }
        /// <summary>
        /// 12选2奖金（手工录入彩票机开奖信息）
        /// </summary>
        public decimal E_MacLevelMoney09
        {
            set { _e_maclevelmoney09 = value; }
            get { return _e_maclevelmoney09; }
        }
        /// <summary>
        /// 追加一等奖奖金（手工录入彩票机开奖信息）
        /// </summary>
        public decimal E_MacLevelMoney10
        {
            set { _e_maclevelmoney10 = value; }
            get { return _e_maclevelmoney10; }
        }
        /// <summary>
        /// 追加二等奖奖金（手工录入彩票机开奖信息）
        /// </summary>
        public decimal E_MacLevelMoney11
        {
            set { _e_maclevelmoney11 = value; }
            get { return _e_maclevelmoney11; }
        }
        /// <summary>
        /// 追加三等奖奖金（手工录入彩票机开奖信息）
        /// </summary>
        public decimal E_MacLevelMoney12
        {
            set { _e_maclevelmoney12 = value; }
            get { return _e_maclevelmoney12; }
        }
        /// <summary>
        /// 追加四等奖奖金（手工录入彩票机开奖信息）
        /// </summary>
        public decimal E_MacLevelMoney13
        {
            set { _e_maclevelmoney13 = value; }
            get { return _e_maclevelmoney13; }
        }
        /// <summary>
        /// 追加五等奖奖金（手工录入彩票机开奖信息）
        /// </summary>
        public decimal E_MacLevelMoney14
        {
            set { _e_maclevelmoney14 = value; }
            get { return _e_maclevelmoney14; }
        }
        /// <summary>
        /// 追加六等奖奖金（手工录入彩票机开奖信息）
        /// </summary>
        public decimal E_MacLevelMoney15
        {
            set { _e_maclevelmoney15 = value; }
            get { return _e_maclevelmoney15; }
        }
        /// <summary>
        /// 追加七等奖奖金（手工录入彩票机开奖信息）
        /// </summary>
        public decimal E_MacLevelMoney16
        {
            set { _e_maclevelmoney16 = value; }
            get { return _e_maclevelmoney16; }
        }
        /// <summary>
        /// 追加八等奖奖金（手工录入彩票机开奖信息）
        /// </summary>
        public decimal E_MacLevelMoney17
        {
            set { _e_maclevelmoney17 = value; }
            get { return _e_maclevelmoney17; }
        }
        /// <summary>
        /// 手工录入时间（手工录入彩票机开奖信息）
        /// </summary>
        public DateTime E_GetMacOpenCodeTime
        {
            get { return _e_getmacopencodetime; }
            set { _e_getmacopencodetime = value; }
        }

        /// <summary>
        /// 设置开奖等级奖金（手工录入彩票机开奖信息）
        /// </summary>
        /// <param name="level"></param>
        /// <param name="money"></param>
        public void SetMacOpenLevelMoney(int level, decimal money)
        {
            switch (level)
            {
                case 1:
                    this.E_MacLevelMoney01 = money;
                    break;
                case 2:
                    this.E_MacLevelMoney02 = money;
                    break;
                case 3:
                    this.E_MacLevelMoney03 = money;
                    break;
                case 4:
                    this.E_MacLevelMoney04 = money;
                    break;
                case 5:
                    this.E_MacLevelMoney05 = money;
                    break;
                case 6:
                    this.E_MacLevelMoney06 = money;
                    break;
                case 7:
                    this.E_MacLevelMoney07 = money;
                    break;
                case 8:
                    this.E_MacLevelMoney08 = money;
                    break;
                case 9:
                    this.E_MacLevelMoney09 = money;
                    break;
                case 10:
                    this.E_MacLevelMoney10 = money;
                    break;
                case 11:
                    this.E_MacLevelMoney11 = money;
                    break;
                case 12:
                    this.E_MacLevelMoney12 = money;
                    break;
                case 13:
                    this.E_MacLevelMoney13 = money;
                    break;
                case 14:
                    this.E_MacLevelMoney14 = money;
                    break;
                case 15:
                    this.E_MacLevelMoney15 = money;
                    break;
                case 16:
                    this.E_MacLevelMoney16 = money;
                    break;
                case 17:
                    this.E_MacLevelMoney17 = money;
                    break;
            }
        }
        /// <summary>
        /// 获取开奖等级奖金（手工录入彩票机开奖信息）
        /// </summary>
        /// <param name="level"></param>
        /// <returns></returns>
        public decimal GetMacOpenLevelMoney(int level)
        {
            decimal result = 0;
            switch (level)
            {
                case 1:
                    result = this.E_MacLevelMoney01;
                    break;
                case 2:
                    result = this.E_MacLevelMoney02;
                    break;
                case 3:
                    result = this.E_MacLevelMoney03;
                    break;
                case 4:
                    result = this.E_MacLevelMoney04;
                    break;
                case 5:
                    result = this.E_MacLevelMoney05;
                    break;
                case 6:
                    result = this.E_MacLevelMoney06;
                    break;
                case 7:
                    result = this.E_MacLevelMoney07;
                    break;
                case 8:
                    result = this.E_MacLevelMoney08;
                    break;
                case 9:
                    result = this.E_MacLevelMoney09;
                    break;
                case 10:
                    result = this.E_MacLevelMoney10;
                    break;
                case 11:
                    result = this.E_MacLevelMoney11;
                    break;
                case 12:
                    result = this.E_MacLevelMoney12;
                    break;
                case 13:
                    result = this.E_MacLevelMoney13;
                    break;
                case 14:
                    result = this.E_MacLevelMoney14;
                    break;
                case 15:
                    result = this.E_MacLevelMoney15;
                    break;
                case 16:
                    result = this.E_MacLevelMoney16;
                    break;
                case 17:
                    result = this.E_MacLevelMoney17;
                    break;
            }
            return result;
        }

        #endregion


        #region 竞彩扩展属性
        private int _e_abbdate = Int32.Parse(DateTime.Now.ToString("yyyyMMdd"));
        private string _e_hometeam = "";
        private string _e_awayteam = "";
        private float _e_rangscore = 0;
        private string _e_opencode2 = "";
        private int _e_iscancel = 0;
        private float _e_pretotalscore = 0;
        private string _e_gjallowcode = "";
        private string _e_gyjallowcode = "";
        /// <summary>
        /// 日期
        /// </summary>
        public int E_AbbDate
        {
            get { return _e_abbdate; }
            set { _e_abbdate = value; }
        }
        /// <summary>
        /// 主队
        /// </summary>
        public string E_HomeTeam
        {
            get { return _e_hometeam; }
            set { _e_hometeam = value; }
        }
        /// <summary>
        /// 客队
        /// </summary>
        public string E_AwayTeam
        {
            get { return _e_awayteam; }
            set { _e_awayteam = value; }
        }
        /// <summary>
        /// 让分 篮球(默认0，负分表示主队让分) 足球(默认0，负分表示客队让分)
        /// </summary>
        public float E_RangScore
        {
            get { return _e_rangscore; }
            set { _e_rangscore = value; }
        }
        /// <summary>
        /// 半场号码
        /// </summary>
        public string E_OpenCode2
        {
            get { return _e_opencode2; }
            set { _e_opencode2 = value; }
        }
        /// <summary>
        /// 是否取消比赛 0未取消 1取消
        /// </summary>
        public int E_IsCancel
        {
            get { return _e_iscancel; }
            set { _e_iscancel = value; }
        }
        /// <summary>
        /// 预设总分
        /// </summary>
        public float E_PreTotalScore
        {
            get { return _e_pretotalscore; }
            set { _e_pretotalscore = value; }
        }
        /// <summary>
        /// 竞彩名次冠军可选号码
        /// </summary>
        public string E_Gjallowcode
        {
            get { return _e_gjallowcode; }
            set { _e_gjallowcode = value; }
        }
        /// <summary>
        /// 竞彩名次冠亚军可选号码
        /// </summary>
        public string E_Gyjallowcode 
        {
            get { return _e_gyjallowcode; }
            set { _e_gyjallowcode = value; }
        }
        #endregion

        #region 竞彩名次扩展属性
        private int  _e_f_startnumber =1 ;
        /// <summary>
        /// 竞彩名次冠军投注开始号码
        /// </summary>
        public int E_F_StartNumber 
        {
            get { return _e_f_startnumber; }
            set { _e_f_startnumber = value; }
        }
        private int _e_f_endnumber = 60;
         /// <summary>
         /// 竞彩名次冠军投注截止号码
         /// </summary>
        public int E_F_EndNumber 
        {
            get { return _e_f_endnumber; }
            set { _e_f_endnumber = value; }
        }
        private int _e_fs_startnumber = 1;
        /// <summary>
        /// 竞彩名次冠亚军投注开始号码
        /// </summary>
        public int E_FS_StartNumber
        {
            get { return _e_fs_startnumber; }
            set { _e_fs_startnumber = value; }
        }
        private int _e_fs_endnumber = 60;
        /// <summary>
        /// 竞彩名次冠亚军投注截止号码
        /// </summary>
        public int E_FS_EndNumber
        {
            get { return _e_fs_endnumber; }
            set { _e_fs_endnumber = value; }
        }
        #endregion


        /// <summary>
        /// 获取对阵期号的赔率list
        /// </summary>
        /// <returns></returns>
        public List<L_RateEntity> getRatesList()
        {
            List<L_RateEntity> lists = new List<L_RateEntity>();
            foreach (L_RateEntity rate in this.RatesMap.Values)
            {
                lists.Add(rate);
            }
            return lists;
        }

        public override string ToString()
        {
            //return string.Format("{0}期，出票截止时间{1:yyyy-MM-dd HH:mm:ss}", this.E_Expect, this.E_ApiEndTime);
            return string.Format("{0}期", this.E_Expect);
        }

        /// <summary>
        /// 比较两个对阵的大小,如：20120102的 1001 大于 201201的7001
        /// </summary>
        /// <param name="entity"></param>
        /// <returns></returns>
        public int compare(L_ExpectEntity entity)
        {
            int result = this.E_AbbDate - entity.E_AbbDate;
            if (result == 0)
            {
                return this.E_Expect.CompareTo(entity.E_Expect);
            }
            else
            {
                return result;
            }
        }

        #region 大乐透五周年加奖 宝石（开奖号码+1） 钻石（-1）

        private string[] _baoShiOpenCodes;
        /// <summary>
        /// 宝石开奖号码（开奖号码的每个数字+1）
        /// </summary>
        public string[] BaoShiOpenCodes
        {
            get { return _baoShiOpenCodes; }
            set { _baoShiOpenCodes = value; }
        }

        private string[] _zuanShiOpenCodes;
        /// <summary>
        /// 钻石开奖号码（开奖号码的每个数字-1）
        /// </summary>
        public string[] ZuanShiOpenCodes
        {
            get { return _zuanShiOpenCodes; }
            set { _zuanShiOpenCodes = value; }
        }

        private decimal _e_levelmoney_diamond01 = 10000;
        /// <summary>
        /// 宝石钻石一等奖金
        /// </summary>
        public decimal E_levelmoney_diamond01
        {
            get { return _e_levelmoney_diamond01; }
            set { _e_levelmoney_diamond01 = value; }
        }

        private decimal _e_levelmoney_diamond02 = 100;
        /// <summary>
        /// 宝石钻石二等奖金
        /// </summary>
        public decimal E_levelmoney_diamond02
        {
            get { return _e_levelmoney_diamond02; }
            set { _e_levelmoney_diamond02 = value; }
        }

        private decimal _e_levelmoney_diamond03 = 6;
        public decimal E_levelmoney_diamond03
        {
            get { return _e_levelmoney_diamond03; }
            set { _e_levelmoney_diamond03 = value; }
        }


        private decimal _e_levelmoney_diamond04 = 2;
        public decimal E_levelmoney_diamond04
        {
            get { return _e_levelmoney_diamond04; }
            set { _e_levelmoney_diamond04 = value; }
        }

        #endregion

        #region 幸运赛车开奖号码构造

        private string _opencode_q2;
        /// <summary>
        /// 幸运赛车前二直选开奖号码，如：01|02
        /// </summary>
        public string Opencode_Q2
        {
            get { return _opencode_q2; }
            set { _opencode_q2 = value; }
        }

        private string _opencode_dxjo;
        /// <summary>
        /// 幸运赛车大小奇偶开奖号码
        /// </summary>
        public string Opencode_DxJo
        {
            get { return _opencode_dxjo; }
            set { _opencode_dxjo = value; }
        }

        private string _opencode_g2g;
        /// <summary>
        /// 幸运赛车过二关开奖号码，如：01|02
        /// </summary>
        public string Opencode_G2g
        {
            get { return _opencode_g2g; }
            set { _opencode_g2g = value; }
        }

        private string _opencode_g3g;
        /// <summary>
        /// 幸运赛车过三关开奖号码，如：01|02|03
        /// </summary>
        public string Opencode_G3g
        {
            get { return _opencode_g3g; }
            set { _opencode_g3g = value; }
        }

        private string _opencode_ys;
        /// <summary>
        /// 颜色玩法的开奖号码
        /// </summary>
        public string Opencode_Ys
        {
            get { return _opencode_ys; }
            set { _opencode_ys = value; }
        }

        private string _opencode_q2ys;
        /// <summary>
        /// 颜色玩法的开奖号码
        /// </summary>
        public string Opencode_Q2Ys
        {
            get { return _opencode_q2ys; }
            set { _opencode_q2ys = value; }
        }

        private string[] _openCodes_ys;
        /// <summary>
        /// 颜色玩法的开奖号码
        /// </summary>
        public string[] OpenCodes_Ys
        {
            get { return _openCodes_ys; }
            set { _openCodes_ys = value; }
        }


        #endregion

        #region 足彩快速派奖改造

        private decimal _e_salemoney;
        /// <summary>
        /// 全国销量
        /// </summary>
        public decimal E_SaleMoney
        {
            get { return _e_salemoney; }
            set { _e_salemoney = value; }
        }

        private decimal _e_leftmoney;
        /// <summary>
        /// 下期滚存
        /// </summary>
        public decimal E_LeftMoney
        {
            get { return _e_leftmoney; }
            set { _e_leftmoney = value; }
        }

        private decimal _e_salemoney_r9;
        /// <summary>
        /// 任9全国销量
        /// </summary>
        public decimal E_SaleMoney_r9
        {
            get { return _e_salemoney_r9; }
            set { _e_salemoney_r9 = value; }
        }

        private decimal _e_leftmoney_r9;
        /// <summary>
        /// 任9下期滚存
        /// </summary>
        public decimal E_LeftMoney_r9
        {
            get { return _e_leftmoney_r9; }
            set { _e_leftmoney_r9 = value; }
        }

        private int _e_winnumber01;
        /// <summary>
        /// 1等奖全国中奖注数
        /// </summary>
        public int E_WinNumber01
        {
            set { _e_winnumber01 = value; }
            get { return _e_winnumber01; }
        }

        private int _e_winnumber02;
        /// <summary>
        /// 2等奖全国中奖注数
        /// </summary>
        public int E_WinNumber02
        {
            set { _e_winnumber02 = value; }
            get { return _e_winnumber02; }
        }

        private int _e_winnumber03;
        /// <summary>
        /// 3等奖全国中奖注数
        /// </summary>
        public int E_WinNumber03
        {
            set { _e_winnumber03 = value; }
            get { return _e_winnumber03; }
        }

        /// <summary>
        /// 设置开奖等级全国中奖注数
        /// </summary>
        /// <param name="level"></param>
        /// <param name="money"></param>
        public void SetWinNumber(int level, int winnumber)
        {
            switch (level)
            {
                case 1:
                    this.E_WinNumber01 = winnumber;
                    break;
                case 2:
                    this.E_WinNumber02 = winnumber;
                    break;
                case 3:
                    this.E_WinNumber03 = winnumber;
                    break;
                default:
                    break;
            }
        }
        /// <summary>
        /// 获取中奖注数
        /// </summary>
        /// <param name="level"></param>
        /// <returns></returns>
        public int GetWinNumber(int level)
        {
            int result = 0;
            switch (level)
            {
                case 1:
                    result = this.E_WinNumber01;
                    break;
                case 2:
                    result = this.E_WinNumber02;
                    break;
                case 3:
                    result = this.E_WinNumber03;
                    break;
            }
            return result;
        }

        private decimal _e_addmoney01;
        /// <summary>
        /// 1等奖加奖
        /// </summary>
        public decimal E_AddMoney01
        {
            set { _e_addmoney01 = value; }
            get { return _e_addmoney01; }
        }

        private decimal _e_addmoney02;
        /// <summary>
        /// 2等奖加奖
        /// </summary>
        public decimal E_AddMoney02
        {
            set { _e_addmoney02 = value; }
            get { return _e_addmoney02; }
        }

        private decimal _e_addmoney03;
        /// <summary>
        /// 3等奖加奖
        /// </summary>
        public decimal E_AddMoney03
        {
            set { _e_addmoney03 = value; }
            get { return _e_addmoney03; }
        }

        /// <summary>
        /// 设置加奖
        /// </summary>
        /// <param name="level"></param>
        /// <param name="money"></param>
        public void SetAddMoney(int level, decimal addmoney)
        {
            switch (level)
            {
                case 1:
                    this.E_AddMoney01 = addmoney;
                    break;
                case 2:
                    this.E_AddMoney02 = addmoney;
                    break;
                case 3:
                    this.E_AddMoney03 = addmoney;
                    break;
                default:
                    break;
            }
        }
        /// <summary>
        /// 获取加奖
        /// </summary>
        /// <param name="level"></param>
        /// <returns></returns>
        public decimal GetAddMoney(int level)
        {
            decimal result = 0;
            switch (level)
            {
                case 1:
                    result = this.E_AddMoney01;
                    break;
                case 2:
                    result = this.E_AddMoney02;
                    break;
                case 3:
                    result = this.E_AddMoney03;
                    break;
            }
            return result;
        }

        #endregion


        #region ICloneable 成员

        public object Clone()
        {
            return this.MemberwiseClone();
        }

        #endregion
    }
}
