using System;
using System.Collections.Generic;
using System.Text;
using System.ComponentModel;

namespace ChuPiao.Common.Models
{
    /// <summary>
    /// 竞彩赔率实体
    /// </summary>
    [Serializable]
    public class L_RateEntity : INotifyPropertyChanged,IComparable
    {
        #region Model
        private int _r_id;
        private int _r_abbdate = 0;
        private string _r_expect = "";
        private int _r_playtype = 0;
        private decimal _r_rate = 0;
        private string _score = "";
        private string _r_opencode = "";
        /// <summary>
        /// 主键id
        /// </summary>
        public int R_Id
        {
            get { return _r_id; }
            set { _r_id = value; }
        }
        /// <summary>
        /// 日期
        /// </summary>
        public int R_AbbDate
        {
            get { return _r_abbdate; }
            set { _r_abbdate = value; }
        }
        /// <summary>
        /// 期号
        /// </summary>
        public string R_Expect
        {
            get { return _r_expect; }
            set { _r_expect = value; }
        }
        /// <summary>
        /// 玩法类型
        /// </summary>
        public int R_PlayType
        {
            get { return _r_playtype; }
            set { _r_playtype = value; }
        }
        /// <summary>
        /// 最终浮动赔率
        /// </summary>
        public decimal R_Rate
        {
            get { return _r_rate; }
            set { _r_rate = value; }
        }
        /// <summary>
        /// 比分，加这个字段是为竞蓝固赔让分胜负或大小分玩法算奖时根据参考分和比分确定玩法开奖号码的时候用到
        /// </summary>
        public string R_Score
        {
            get { return _score; }
            set { _score = value; }
        }
        /// <summary>
        /// 对应赔率的开奖号码 如：大小分为1或2 
        /// </summary>
        public string R_OpenCode
        {
            get { return _r_opencode; }
            set { _r_opencode = value; }
        }

        #endregion

        #region 北单扩展属性
        private int _r_match;
        /// <summary>
        /// 北单场次
        /// </summary>
        public int R_Match 
        {
            get { return _r_match; }
            set { _r_match = value; }
        }
        #endregion

        #region INotifyPropertyChanged 成员

        public event PropertyChangedEventHandler PropertyChanged;

        #endregion

        #region IComparable 成员

        public int CompareTo(object obj)
        {
            L_RateEntity rate = (L_RateEntity)obj;
            int result = R_AbbDate.CompareTo(rate.R_AbbDate);
            if (result == 0)
            {
                result = R_Expect.CompareTo(rate.R_Expect);
                if (result == 0)
                {
                    result = R_PlayType.CompareTo(rate.R_PlayType);
                }
            }
            return result;
        }

        #endregion
    }
}
