using System;
using ChuPiao.Common.Utils;

namespace ChuPiao.Common.Models
{
    /// <summary>
    /// 票信息实体类
    /// </summary>
    public class L_LotTicketEntity : ICloneable
    {
        private int limitType=0;
        /// <summary>
        /// 撤单原因（只有在status=-300的时候有意义，非-300则默认0）：限号撤单-300，其它撤单待扩展
        /// </summary>
        public int L_LimitType
        {
            set { limitType = value; }
            get { return limitType; }
        }

        private int _l_addtype = 0;
        /// <summary>
        /// 大乐透加奖类型：0-无加奖(默认)；1-1.6倍；2-2倍；3-“加油中国”3元；4-“光芒焕新”3元
        /// </summary>
        public int L_AddType
        {
            get { return _l_addtype; }
            set { _l_addtype = value; }
        }

        public int EncashOption = 1;

        #region Model
        private int _l_id;
        private string _l_expect;
        //private string _l_prizeexpect;
        private int _l_userid = 0;
        private string _l_ordersn = "";
        private int _l_playid;
        private int _l_webplayid;
        private string _l_macnumber = "";
        private string _l_ticketsn = "";
        private decimal _l_money = 0;
        private int _l_singlezhushu = 0;
        private int _l_mutiple = 0;
        private string _l_code = "";
        private string _l_ticketcode = "";
        private string _l_password = "";
        private string _l_randomcode = "";
        private int _l_allowprint = 0;
        private int _l_status = 0;
        private int _l_notifystatus = 0;
        private int _l_printnum = 0;
        private int _l_priority = 0;
        private decimal _l_getmoney = 0;
        private decimal _l_pregetmoney = 0;
        private int _l_prizestatus = 0;
        private int _l_encashstatus = 0;
        private string _l_encashmacnumber = "";
        private int _l_encashtype = 0;
        private DateTime _l_addtime = DateTime.Now;
        private DateTime _l_suctime = new DateTime(1900, 1, 1);
        private int _l_spendtime = 0;   //出票花费时间，毫秒
        private DateTime _l_endtime = DateTime.MaxValue;
        private int _l_getnum01 = 0;
        private int _l_getnum02 = 0;
        private int _l_getnum03 = 0;
        private int _l_getnum04 = 0;
        private int _l_getnum05 = 0;
        private int _l_getnum06 = 0;
        private int _l_getnum07 = 0;
        private int _l_getnum08 = 0;
        private int _l_getnum09 = 0;
        private int _l_getnum10 = 0;
        private int _l_getnum11 = 0;
        private int _l_getnum12 = 0;
        private int _l_getnum13 = 0;
        private int _l_getnum14 = 0;
        private int _l_getnum15 = 0;
        private int _l_getnum16 = 0;
        private int _l_getnum17 = 0;
        private long _l_datarequestid = 0;
        private int _l_source = 100;
        private string _l_prntext = "";
        private string _l_zxnumber = "";

       
        public string L_AllowPrintName
        {
            get
            {
                string name = "默认";
                switch (_l_allowprint)
                {
                    case 0:
                        name = "不允许";
                        break;
                    case 100:
                        name = "允许";
                        break;
                }
                return name;
            }
        }

        public string L_PlayName
        {
            get
            {
                return LotPlayTypeHashTable.GetPlayName(_l_playid);
                //if (_l_playid == 70501)
                //{
                //    return "单式";
                //}
                //else if (_l_playid == 70502)
                //{
                //    return "复式";
                //}
                //return "";
            }
        }

        //彩种名称
        public string L_LotName
        {
            get
            {
                return LotPlayTypeHashTable.GetLotName(_lotId);
            }
        }


        /// <summary>
        /// 主键ID
        /// </summary>
        public int L_Id
        {
            set { _l_id = value; }
            get { return _l_id; }
        }


        private string _l_currentExpect;
        /// <summary>
        /// 彩种在售的当前期
        /// </summary>
        public string L_CurrentExpect
        {
            set { _l_currentExpect = value; }
            get { return _l_currentExpect; }
        }

        /// <summary>
        /// 期号
        /// </summary>
        public string L_Expect
        {
            set { _l_expect = value; }
            get { return _l_expect; }
        }
        /// <summary>
        /// 用户编号
        /// </summary>
        public int L_UserId 
        {
            set { _l_userid = value; }
            get { return _l_userid; }           
        }
        /// <summary>
        /// 用户订单号
        /// </summary>
        public string L_OrderSn
        {
            set { _l_ordersn = value; }
            get { return _l_ordersn; }
        }
        /// <summary>
        /// 玩法ID
        /// </summary>
        public int L_PlayId
        {
            set { _l_playid = value; }
            get { return _l_playid; }
        }
        /// <summary>
        /// 网站玩法ID
        /// </summary>
        public int L_WebPlayId
        {
            set { _l_webplayid = value; }
            get { return _l_webplayid; }
        }
        /// <summary>
        /// 出票机器号
        /// </summary>
        public string L_MacNumber
        {
            set { _l_macnumber = value; }
            get { return _l_macnumber; }
        }
        /// <summary>
        /// 票的唯一标识
        /// </summary>
        public string L_TicketSn
        {
            set { _l_ticketsn = value; }
            get { return _l_ticketsn; }
        }
        /// <summary>
        /// 金额
        /// </summary>
        public decimal L_Money
        {
            set { _l_money = value; }
            get { return _l_money; }
        }
        /// <summary>
        /// 单倍注数
        /// </summary>
        public int L_SingleZhuShu
        {
            set { _l_singlezhushu = value; }
            get { return _l_singlezhushu; }
        }
        /// <summary>
        /// 倍数
        /// </summary>
        public int L_Mutiple
        {
            set { _l_mutiple = value; }
            get { return _l_mutiple; }
        }
        /// <summary>
        /// 投注号码
        /// </summary>
        public string L_Code
        {
            set { _l_code = value; }
            get { return _l_code; }
        }
        /// <summary>
        /// 票号
        /// </summary>
        public string L_TicketCode
        {
            set { _l_ticketcode = value; }
            get { return _l_ticketcode; }
        }
        /// <summary>
        /// 彩票密码
        /// </summary>
        public string L_Password
        {
            set { _l_password = value; }
            get { return _l_password; }
        }
        /// <summary>
        /// 随机码
        /// </summary>
        public string L_RandomCode
        {
            set { _l_randomcode = value; }
            get { return _l_randomcode; }
        }
        /// <summary>
        /// 状态：0--默认；100--可出票
        /// </summary>
        public int L_AllowPrint
        {
            set { _l_allowprint = value; }
            get { return _l_allowprint; }
        }
        /// <summary>
        /// 状态：0--默认；3--撤单，2--取消；1--已出票----->撤单-300，取消100，已出票300
        /// </summary>
        public int L_Status
        {
            set { _l_status = value; }
            get { return _l_status; }
        }

        public string L_StatusName
        {
            get
            {
                return TicketStatusHashTable.GetStringByCode(_l_status);
            }
        }

        /// <summary>
        /// 通知状态：0--默认，100--可通知，300--已通知
        /// </summary>
        public int L_NotifyStatus
        {
            set { _l_notifystatus = value; }
            get { return _l_notifystatus; }
        }

        /// <summary>
        /// 通知状态名称
        /// </summary>
        public string L_NotifyStatusName
        {
            get
            {
                string name = "默认";
                switch (_l_notifystatus)
                {
                    case 100:
                        name = "可通知";
                        break;
                    case 300:
                        name = "已通知";
                        break;
                }
                return name;
            }
        }

        /// <summary>
        /// 打印次数
        /// </summary>
        public int L_PrintNum
        {
            set { _l_printnum = value; }
            get { return _l_printnum; }
        }
        /// <summary>
        /// 出票优先级（默认值：0  值越大优先级越高）
        /// </summary>
        public int L_Priority
        {
            set { _l_priority = value; }
            get { return _l_priority; }
        }
        /// <summary>
        /// 奖金
        /// </summary>
        public decimal L_GetMoney
        {
            set { _l_getmoney = value; }
            get { return _l_getmoney; }
        }
        /// <summary>
        /// 税前奖金
        /// </summary>
        public decimal L_PreGetMoney
        {
            set { _l_pregetmoney = value; }
            get { return _l_pregetmoney; }
        }
        /// <summary>
        /// 奖金状态：0--默认；300--已算奖
        /// </summary>
        public int L_PrizeStatus
        {
            set { _l_prizestatus = value; }
            get { return _l_prizestatus; }
        }


        /// <summary>
        /// 算奖状态名称
        /// </summary>
        public string L_PrizeStatusName
        {
            get
            {
                string name = "默认";
                if (_l_prizestatus == 300)
                {
                    name = "已算奖";
                }
                return name;
            }
        }


        /// <summary>
        /// 奖金状态：0--默认；100--可兑奖；200--不可兑奖；300--已兑奖
        /// </summary>
        public int L_EncashStatus
        {
            set { _l_encashstatus = value; }
            get { return _l_encashstatus; }
        }

        /// <summary>
        /// 通知状态名称
        /// </summary>
        public string L_EncashStatusName
        {
            get
            {
                string name = "默认";
                switch (_l_encashstatus)
                {
                    case 100:
                        name = "可兑奖";
                        break;
                    case 200:
                        name = "不可兑奖";
                        break;
                    case 300:
                        name = "已兑奖";
                        break;
                }
                return name;
            }
        }

        /// <summary>
        /// 兑奖机器号
        /// </summary>
        public string L_EncashMacNumber
        {
            set { _l_encashmacnumber = value; }
            get { return _l_encashmacnumber; }
        }
        /// <summary>
        /// 兑奖类别（0--默认；100--机器兑奖；200--中心兑奖）
        /// </summary>
        public int L_EncashType
        {
            set { _l_encashtype = value; }
            get { return _l_encashtype; }
        }
        /// <summary>
        /// 添加时间
        /// </summary>
        public DateTime L_AddTime
        {
            set { _l_addtime = value; }
            get { return _l_addtime; }
        }
        /// <summary>
        /// 出票时间
        /// </summary>
        public DateTime L_SucTime
        {
            set { _l_suctime = value; }
            get { return _l_suctime; }
        }
        /// <summary>
        /// 出票花费时间
        /// </summary>
        public int L_SpendTime
        {
            set { _l_spendtime = value; }
            get { return _l_spendtime; }
        }
        /// <summary>
        /// 截止时间
        /// </summary>
        public DateTime L_EndTime
        {
            get { return _l_endtime; }
            set { _l_endtime = value; }
        }
        /// <summary>
        /// 一等奖注数，多乐彩前1直选
        /// </summary>
        public int L_GetNum01
        {
            set { _l_getnum01 = value; }
            get { return _l_getnum01; }
        }
        /// <summary>
        /// 二等奖注数，前2直选
        /// </summary>
        public int L_GetNum02
        {
            set { _l_getnum02 = value; }
            get { return _l_getnum02; }
        }
        /// <summary>
        /// 三等奖注数，前3直选
        /// </summary>
        public int L_GetNum03
        {
            set { _l_getnum03 = value; }
            get { return _l_getnum03; }
        }
        /// <summary>
        /// 四等奖注数，前2组选
        /// </summary>
        public int L_GetNum04
        {
            set { _l_getnum04 = value; }
            get { return _l_getnum04; }
        }
        /// <summary>
        /// 五等奖注数，前3组选
        /// </summary>
        public int L_GetNum05
        {
            set { _l_getnum05 = value; }
            get { return _l_getnum05; }
        }
        /// <summary>
        /// 六等奖注数，任选2
        /// </summary>
        public int L_GetNum06
        {
            set { _l_getnum06 = value; }
            get { return _l_getnum06; }
        }
        /// <summary>
        /// 七等奖注数，任选3
        /// </summary>
        public int L_GetNum07
        {
            set { _l_getnum07 = value; }
            get { return _l_getnum07; }
        }
        /// <summary>
        /// 八等奖注数，任选4
        /// </summary>
        public int L_GetNum08
        {
            set { _l_getnum08 = value; }
            get { return _l_getnum08; }
        }
        /// <summary>
        /// 12选2中奖注数，任选5
        /// </summary>
        public int L_GetNum09
        {
            set { _l_getnum09 = value; }
            get { return _l_getnum09; }
        }
        /// <summary>
        /// 追加一等奖注数，任选6
        /// </summary>
        public int L_GetNum10
        {
            set { _l_getnum10 = value; }
            get { return _l_getnum10; }
        }
        /// <summary>
        /// 追加二等奖注数，任选7
        /// </summary>
        public int L_GetNum11
        {
            set { _l_getnum11 = value; }
            get { return _l_getnum11; }
        }
        /// <summary>
        /// 追加三等奖注数，任选8      
        /// </summary>
        public int L_GetNum12
        {
            set { _l_getnum12 = value; }
            get { return _l_getnum12; }
        }
        /// <summary>
        /// 追加四等奖注数
        /// </summary>
        public int L_GetNum13
        {
            set { _l_getnum13 = value; }
            get { return _l_getnum13; }
        }
        /// <summary>
        /// 追加五等奖注数
        /// </summary>
        public int L_GetNum14
        {
            set { _l_getnum14 = value; }
            get { return _l_getnum14; }
        }
        /// <summary>
        /// 追加六等奖注数
        /// </summary>
        public int L_GetNum15
        {
            set { _l_getnum15 = value; }
            get { return _l_getnum15; }
        }
        /// <summary>
        /// 追加七等奖注数
        /// </summary>
        public int L_GetNum16
        {
            set { _l_getnum16 = value; }
            get { return _l_getnum16; }
        }
        /// <summary>
        /// 追加八等奖注数
        /// </summary>
        public int L_GetNum17
        {
            set { _l_getnum17 = value; }
            get { return _l_getnum17; }
        }

        /// <summary>
        /// 下载ID
        /// </summary>
        public long L_DataRequestId
        {
            set { _l_datarequestid = value; }
            get { return _l_datarequestid; }
        }
        /// <summary>
        /// 数据来源：100--广天地，500--500万
        /// </summary>
        public int L_Source
        {
            set { _l_source = value; }
            get { return _l_source; }
        }
        /// <summary>
        /// 电子票文本
        /// </summary>
        public string L_PrnText
        {
            get { return _l_prntext; }
            set { _l_prntext = value; }
        }
        /// <summary>
        /// 销售点
        /// </summary>
        public string L_SaleAddress
        {
            set { _l_zxnumber = value; }
            get { return _l_zxnumber; }
        }
        #endregion Model

        #region 扩展属性

        private int _lotId;
        /// <summary>
        /// 彩种ID
        /// </summary>
        public int LotId
        {
            get { return _lotId; }
            set { _lotId = value; }
        }

        private int _macLotId;
        private int _macPlayId;
        private int _macModeId;
        /// <summary>
        /// 彩票机彩种ID
        /// </summary>
        public int MacLotId
        {
            get { return _macLotId; }
            set { _macLotId = value; }
        }
        /// <summary>
        /// 彩票机玩法ID
        /// </summary>
        public int MacPlayId
        {
            get { return _macPlayId; }
            set { _macPlayId = value; }
        }
        /// <summary>
        /// 彩票机投注模式ID
        /// </summary>
        public int MacModeId
        {
            get { return _macModeId; }
            set { _macModeId = value; }
        }


        private string _ticketFilePath = string.Empty;
        /// <summary>
        /// 电子票文件路径
        /// </summary>
        public string TicketFilePath
        {
            get { return _ticketFilePath; }
            set { _ticketFilePath = value; }
        }

        private bool _isUseScanner = false;
        /// <summary>
        /// 是否扫描出票
        /// </summary>
        public bool IsUseScanner
        {
            get { return _isUseScanner; }
            set { _isUseScanner = value; }
        }


        private bool _isClearExpect = false;
        /// <summary>
        /// 是否出票前清除奖期已更新对话框
        /// </summary>
        public bool IsClearExpect
        {
            get { return _isClearExpect; }
            set { _isClearExpect = value; }
        }

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

        #region  竞彩扩展属性
        private string _l_firstexpect = "";
        private string _l_lastexpect = "";
        private int _l_firstabbdate = 0;
        private int _l_lastabbdate = 0;
        private int _l_codetype = 0;
        private int _l_ratetype = 0;
        private string _l_coderate = "";
        private decimal _l_maxgetmoney = 0;
        private string _l_codereference = "";

        /// <summary>
        /// 结算开始场次
        /// </summary>
        public string L_FirstExpect
        {
            get { return _l_firstexpect; }
            set { _l_firstexpect = value; }
        }
        /// <summary>
        /// 结算场次，统一为方案的结算场次
        /// </summary>
        public string L_LastExpect
        {
            get { return _l_lastexpect; }
            set { _l_lastexpect = value; }
        }
        /// <summary>
        /// 结算开始日期
        /// </summary>
        public int L_FirstAbbDate
        {
            get { return _l_firstabbdate; }
            set { _l_firstabbdate = value; }
        }
        /// <summary>
        /// 结算日期，统一为方案的结算日期
        /// </summary>
        public int L_LastAbbDate
        {
            get { return _l_lastabbdate; }
            set { _l_lastabbdate = value; }
        }
        /// <summary>
        /// 投注类型 n串m
        /// </summary>
        public int L_CodeType
        {
            get { return _l_codetype; }
            set { _l_codetype = value; }
        }
        /// <summary>
        /// 赔率类型  0浮动赔率  1固定赔率
        /// </summary>
        public int L_RateType
        {
            get { return _l_ratetype; }
            set { _l_ratetype = value; }
        }
        /// <summary>
        /// 投注赔率
        /// </summary>
        public string L_CodeRate
        {
            get { return _l_coderate; }
            set { _l_coderate = value; }
        }
        /// <summary>
        /// 投注最大中奖金额
        /// </summary>
        public decimal L_MaxGetMoney
        {
            get { return _l_maxgetmoney; }
            set { _l_maxgetmoney = value; }
        }
        /// <summary>
        /// 号码参照，实时让球、预设总分等
        /// </summary>
        public string L_CodeReference
        {
            get { return _l_codereference; }
            set { _l_codereference = value; }
        }
        #endregion

        #region 北单扩展属性
        private int _l_lastMatch;
        /// <summary>
        /// 最后场次
        /// </summary>
        public int L_LastMatch 
        {
            get
            {
                return _l_lastMatch;
            }
            set 
            {
                _l_lastMatch = value;
            }
        }

        private int _l_exptype;
        /// <summary>
        /// 扩展类型 0单式 1复式
        /// </summary>
        public int L_ExpType
        {
            get { return _l_exptype; }
            set { _l_exptype = value; }
        }

        #endregion

        #region 竞彩名次扩展属性
        private int  _l_f_startnumber;
        /// <summary>
        /// 竞彩名次冠军投注开始号码
        /// </summary>
        public int L_F_StartNumber 
        {
            get { return _l_f_startnumber; }
            set { _l_f_startnumber = value; }
        }

        private int _l_f_endnumber;
        /// <summary>
        /// 竞彩名次冠军投注截止号码
        /// </summary>
        public int L_F_EndNumber 
        {
            get { return _l_f_endnumber; }
            set { _l_f_endnumber = value; }
        }

        private int _l_fs_startnumber;
        /// <summary>
        /// 竞彩名次冠亚军投注开始号码
        /// </summary>
        public int L_FS_StartNumber
        {
            get { return _l_fs_startnumber; }
            set { _l_fs_startnumber = value; }
        }

        private int _l_fs_endnumber;
        /// <summary>
        /// 竞彩名次冠亚军投注截止号码
        /// </summary>
        public int L_FS_EndNumber
        {
            get { return _l_fs_endnumber; }
            set { _l_fs_endnumber = value; }
        }
        #endregion



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

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

        private int _l_GetNum_BaoShi01;
        /// <summary>
        /// 宝石奖1等 5+2
        /// </summary>
        public int L_GetNum_BaoShi01
        {
            get { return _l_GetNum_BaoShi01; }
            set { _l_GetNum_BaoShi01 = value; }
        }

        private int _l_GetNum_BaoShi02;
        /// <summary>
        /// 宝石奖2等 5+1 5
        /// </summary>
        public int L_GetNum_BaoShi02
        {
            get { return _l_GetNum_BaoShi02; }
            set { _l_GetNum_BaoShi02 = value; }
        }

        private int _l_GetNum_BaoShi03;
        /// <summary>
        /// 宝石奖3等 4+2 4+1
        /// </summary>
        public int L_GetNum_BaoShi03
        {
            get { return _l_GetNum_BaoShi03; }
            set { _l_GetNum_BaoShi03 = value; }
        }

        private int _l_GetNum_BaoShi04;
        /// <summary>
        /// 宝石奖4等 4 3+2 3+1 2+2
        /// </summary>
        public int L_GetNum_BaoShi04
        {
            get { return _l_GetNum_BaoShi04; }
            set { _l_GetNum_BaoShi04 = value; }
        }

        private int _l_GetNum_ZuanShi01;
        /// <summary>
        /// 钻石奖1等 5+2
        /// </summary>
        public int L_GetNum_ZuanShi01
        {
            get { return _l_GetNum_ZuanShi01; }
            set { _l_GetNum_ZuanShi01 = value; }
        }

        private int _l_GetNum_ZuanShi02;
        /// <summary>
        /// 钻石奖2等 5+1 5
        /// </summary>
        public int L_GetNum_ZuanShi02
        {
            get { return _l_GetNum_ZuanShi02; }
            set { _l_GetNum_ZuanShi02 = value; }
        }

        private int _l_GetNum_ZuanShi03;
        /// <summary>
        /// 钻石奖3等 4+2 4+1
        /// </summary>
        public int L_GetNum_ZuanShi03
        {
            get { return _l_GetNum_ZuanShi03; }
            set { _l_GetNum_ZuanShi03 = value; }
        }

        private int _l_GetNum_ZuanShi04;
        /// <summary>
        /// 钻石奖4等 4 3+2 3+1 2+2
        /// </summary>
        public int L_GetNum_ZuanShi04
        {
            get { return _l_GetNum_ZuanShi04; }
            set { _l_GetNum_ZuanShi04 = value; }
        }
        #endregion

        private string _prizeexpect;
        /// <summary>
        /// 结算期
        /// </summary>
        public string PrizeExpect
        {
            get { return _prizeexpect; }
            set { _prizeexpect = value; }
        }
        private int _switchToAddress;
        /// <summary>
        /// 切换目标出票点
        /// </summary>
        public int L_ToAddress
        {
            get { return _switchToAddress; }
            set { _switchToAddress = value; }
        }
    }
}
