Exemplo n.º 1
0
        //空调费
        public virtual double GetKongTiaoFee(ECommTrainType traintype,
                                             ECommCheXian chexian1)
        {
            bool specialKongTiao = false;               //绿皮车在5.1-10.10征收空调费

            if (traintype == ECommTrainType.绿皮车25B &&
                (chexian1 == ECommCheXian.软卧 || chexian1 == ECommCheXian.高级软卧))
            {
                int      year1 = DateTime.Now.Year;
                DateTime dt1   = DateTime.Parse(year1 + "-5-1");
                DateTime dt2   = DateTime.Parse(year1 + "-10-11");
                DateTime dt0   = DateTime.Today;
                if (dt0 >= dt1 && dt0 <= dt2)
                {
                    specialKongTiao = true;
                }
            }
            if (this.kongTiaoFlag || specialKongTiao)
            {
                return(this.KongTiaoFee);
            }
            else
            {
                return(0);
            }
        }
Exemplo n.º 2
0
        /// <summary>
        /// 得到车厢的满员人数
        /// </summary>
        /// <param name="type1"></param>
        /// <returns></returns>
        private static int GetCheXianTotalPerson(ECommCheXian type1)
        {
            int d1 = 0;
            CommChexianRateAndPersonCount rp1 = GetCheXianFeeRateAndPersonCount(type1);

            d1 = rp1.PersonCount1 + rp1.PersonCount2 + rp1.PersonCount3;
            return(d1);
        }
Exemplo n.º 3
0
        /// <summary>
        /// 得到车厢类型的整体票价率
        /// </summary>
        /// <param name="type1"></param>
        /// <returns></returns>
        private static double GetCheXianFeeTotalRate(ECommCheXian type1)
        {
            double d1 = 0;
            CommChexianRateAndPersonCount rp1 = GetCheXianFeeRateAndPersonCount(type1);

            d1 = (rp1.Rate1 / 100d) * rp1.PersonCount1 + (rp1.Rate2 / 100d) * rp1.PersonCount2 + (rp1.Rate3 / 100d) * rp1.PersonCount3;
            return(d1);
        }
Exemplo n.º 4
0
 //计算空调费
 public override double GetKongTiaoFee(ECommTrainType traintype,
                                       ECommCheXian chexian1)
 {
     if (this.hasdata == false)
     {
         double fee1 = base.GetKongTiaoFee(traintype, chexian1);
         return(fee1 + JMath.Round1(fee1 * ShangFuRate, 0));
     }
     else
     {
         return(this.KtFee);
     }
 }
Exemplo n.º 5
0
        /// <summary>
        /// 得到不同车厢的重量配置
        /// </summary>
        /// <param name="type1"></param>
        /// <returns></returns>
        private static double GetCheXianWeight(ECommCheXian type1)
        {
            double             d1        = 0;
            JTable             tab1      = new JTable("CHEXIANWEIGHTPROFILE");
            List <SearchField> condition = new List <SearchField>();

            condition.Add(new SearchField("CHEXIANTYPE", (int)type1 + "", SearchFieldType.NumericType));
            DataRow dr1 = tab1.GetFirstDataRow(condition, "Weight");

            if (dr1 != null)
            {
                d1 = double.Parse(dr1[0].ToString());
            }
            tab1.Close();
            return(d1);
        }
Exemplo n.º 6
0
        /// <summary>
        /// 设置不同车厢类型的数量
        /// </summary>
        /// <param name="type">车厢类型</param>
        /// <param name="Count1">车厢数量</param>
        public void SetCheXianCount(ECommCheXian type, int Count1)
        {
            int type1 = (int)type;

            switch (type1)
            {
            case 0:
                this.YinZuo = Count1;
                break;

            case 1:
                this.RuanZuo = Count1;
                break;

            case 2:
                this.OpenYinWo = Count1;
                break;

            case 3:
                this.CloseYinWo = Count1;
                break;

            case 4:
                this.RuanWo = Count1;
                break;

            case 5:
                this.AdvanceRuanWo = Count1;
                break;

            case 6:
                this.CanChe = Count1;
                break;

            case 7:
                this.FaDianChe = Count1;
                break;

            case 8:
                this.ShuYinChe = Count1;
                break;

            default:
                break;
            }
        }
Exemplo n.º 7
0
        /// <summary>
        /// 得到车厢类型的票价率和满员人数
        /// </summary>
        /// <param name="type1"></param>
        /// <returns></returns>
        private static CommChexianRateAndPersonCount GetCheXianFeeRateAndPersonCount(ECommCheXian type1)
        {
            CommChexianRateAndPersonCount rp1 = new CommChexianRateAndPersonCount();
            JTable             tab1           = new JTable("CheXianBianZhu");
            List <SearchField> condition      = new List <SearchField>();

            if (type1 == ECommCheXian.硬座)
            {
                condition.Add(new SearchField("kind", "YinZuo"));
            }
            else if (type1 == ECommCheXian.软座)
            {
                condition.Add(new SearchField("kind", "RuanZuo"));
            }
            else if (type1 == ECommCheXian.开放式硬卧)
            {
                condition.Add(new SearchField("(kind='YinWo1' or kind='YinWo2' or kind='YinWo3')", "", SearchOperator.UserDefine));
            }
            else if (type1 == ECommCheXian.包房式硬卧)
            {
                condition.Add(new SearchField("(kind='YinWo4' or kind='YinWo5')", "", SearchOperator.UserDefine));
            }
            else if (type1 == ECommCheXian.软卧)
            {
                condition.Add(new SearchField("(kind='RuanWo1' or kind='RuanWo2')", "", SearchOperator.UserDefine));
            }
            else if (type1 == ECommCheXian.高级软卧)
            {
                condition.Add(new SearchField("(kind='GaoJiRuanWo1' or kind='GaoJiRuanWo2')", "", SearchOperator.UserDefine));
            }
            tab1.OrderBy = "kind";
            DataSet ds1 = tab1.SearchData(condition, -1, "*");
            int     i   = 0;

            foreach (DataRow dr1 in ds1.Tables[0].Rows)
            {
                rp1.SetRate(i, int.Parse(dr1["Rate"].ToString()));
                rp1.SetPerson(i, int.Parse(dr1["PCount"].ToString()));
                i++;
            }
            tab1.Close();
            return(rp1);
        }
Exemplo n.º 8
0
        /// <summary>
        /// 车辆消耗备用品
        /// </summary>
        /// <returns></returns>
        public double GetXiaoHaoCost()
        {
            double fee = 0;

            if (this.TrainBigKind == ETrainBigKind.普通列车)
            {
                JTable             tab1      = new JTable("CHEXIANWEIGHTPROFILE");
                List <SearchField> condition = new List <SearchField>();
                tab1.OrderBy = "CHEXIANTYPE";
                DataSet ds1 = tab1.SearchData(null, -1, "*");
                foreach (DataRow dr1 in ds1.Tables[0].Rows)
                {
                    ECommCheXian type1 = (ECommCheXian)(int.Parse(dr1["CHEXIANTYPE"].ToString()));
                    switch (type1)
                    {
                    case ECommCheXian.硬座:
                        fee = fee + this.YinZuo * double.Parse(dr1["UNITXHCOST"].ToString());
                        break;

                    case ECommCheXian.软座:
                        fee = fee + this.RuanZuo * double.Parse(dr1["UNITXHCOST"].ToString());
                        break;

                    case ECommCheXian.开放式硬卧:
                        fee = fee + this.OpenYinWo * double.Parse(dr1["UNITXHCOST"].ToString());
                        break;

                    case ECommCheXian.包房式硬卧:
                        fee = fee + this.CloseYinWo * double.Parse(dr1["UNITXHCOST"].ToString());
                        break;

                    case ECommCheXian.软卧:
                        fee = fee + this.RuanWo * double.Parse(dr1["UNITXHCOST"].ToString());
                        break;

                    case ECommCheXian.高级软卧:
                        fee = fee + this.AdvanceRuanWo * double.Parse(dr1["UNITXHCOST"].ToString());
                        break;

                    case ECommCheXian.餐车:
                        fee = fee + this.CanChe * double.Parse(dr1["UNITXHCOST"].ToString());
                        break;

                    case ECommCheXian.供电车:
                        fee = fee + this.FaDianChe * double.Parse(dr1["UNITXHCOST"].ToString());
                        break;

                    case ECommCheXian.宿营车:
                        fee = fee + this.ShuYinChe * double.Parse(dr1["UNITXHCOST"].ToString());
                        break;
                    }
                }
                tab1.Close();
                fee = fee * this.YongCheDiShu;
            }
            else
            {
                double db = 0;
                if (this.HighTrainBigKind == EHighTrainBigKind.动车200公里)
                {
                    db = double.Parse(JStrInfoBU.GetStrTextByID("200公里动车客运消耗备用备品成本"));
                }
                else
                {
                    db = double.Parse(JStrInfoBU.GetStrTextByID("300公里动车客运消耗备用备品成本"));
                }
                fee = db;                     //分200公里/300公里 标准2个标准
            }
            return(fee);
        }