Ejemplo n.º 1
0
        //1.线路使用费 Fee1---(直接导入数据OK)
        private double GetFee1(bool sum)
        {
            double Fee0  = 0;
            String temp1 = String.Empty;

            if (String.IsNullOrEmpty(this.TrainName) == false)
            {
                String[] arr1 = this.TrainName.Split('/');
                temp1 = this.TrainName;
                foreach (String m in arr1)
                {
                    temp1 = temp1 + "," + m;
                }

                if (String.IsNullOrEmpty(temp1) == false)
                {
                    List <SearchField> condition = new List <SearchField>();
                    tab1.TableName = "NEWTRAINXIANLUFEE";
                    condition.Add(new SearchField("TRAINNAME", temp1, SearchOperator.Collection));
                    condition.Add(new SearchField("BYEAR", this.Year + "", SearchFieldType.NumericType));
                    if (sum == false)
                    {
                        condition.Add(new SearchField("BMONTH", this.Month + "", SearchFieldType.NumericType));
                    }
                    else
                    {
                        condition.Add(new SearchField("BMONTH", this.Month + "", SearchOperator.SmallerAndEqual,
                                                      SearchFieldType.NumericType));
                    }

                    object obj1 = tab1.SearchScalar(condition, "sum(Fee1+Fee2+Fee3)");
                    if (obj1 != null && obj1.ToString().Trim() != String.Empty)
                    {
                        Fee0 = double.Parse(obj1.ToString());
                    }
                }
            }
            return(JMath.Round1(Fee0 / UnitRate, 2));
        }
Ejemplo n.º 2
0
        //20140409  编写
        /// <summary>
        /// 求得客运专线的电费地和接触费
        /// </summary>
        /// <param name="busType"></param>
        /// <returns></returns>
        internal override double GetFee3(List <string[]> lineInfos)
        {
            double Fee  = 0;
            JTable tab1 = new JTable("gscorpelecfee");

            for (int i = 0; i < lineInfos.Count; i++)
            {
                double JieChuFeeRate = 0.0d;
                double DianFeeRate   = 0.0d;
                if (string.IsNullOrEmpty(lineInfos[i][0])) //判断客专id值
                {
                    string linetype = lineInfos[i][2];     //获得线路类型
                    if (linetype == "1")
                    {
                        JieChuFeeRate = TrainLineKindProfile.JieChuFee2;
                        DianFeeRate   = TrainLineKindProfile.DianFee2;
                    }
                    else if (linetype == "2")
                    {
                        JieChuFeeRate = TrainLineKindProfile.JieChuFee1;
                        DianFeeRate   = TrainLineKindProfile.DianFee1;
                    }
                }
                else
                {
                    List <SearchField> condition = new List <SearchField>();
                    condition.Add(new SearchField("Num", lineInfos[i][0]));
                    JieChuFeeRate = Convert.ToDouble(tab1.SearchScalar(condition, "NETFEE"));
                    DianFeeRate   = Convert.ToDouble(tab1.SearchScalar(condition, "ELECFEE"));
                }

                Fee = Fee + (JieChuFeeRate + DianFeeRate) * Convert.ToInt32(lineInfos[i][1]) * this.GetTrainWeight();//获得里程数
            }
            if (this.IsYearFlag)
            {
                Fee = Fee * 2 * 365;
            }
            else
            {
                Fee = Fee * 2;
            }

            #region 注释信息
            //TrainLine line0 = this.Line;
            //double Fee = 0;
            //if (line0 != null)
            //{
            //    //根据线路的里程和线路的级别计算电费和接触网使用费用
            //    for (int i = 0; i < line0.Nodes.Count; i++)
            //    {
            //        string  lineID = line0.Nodes[i].LineID;
            //        string astation = line0.Nodes[i].AStation;
            //        string bstation = line0.Nodes[i].BStation;

            //        condition.Clear();
            //        condition.Add(new SearchField("lineID",lineID));
            //        condition.Add(new SearchField("AStation",astation));
            //        condition.Add(new SearchField("BStation",bstation));
            //        //得到相应客专主键id
            //        string corpid = tab1.SearchScalar(condition, "KZID").ToString() ;
            //        //得到相应的标准
            //        condition.Clear();
            //        condition.Add(new SearchField("Num",corpid));
            //        double JieChuFeeRate=0.0d;
            //        double DianFeeRate =0.0d;
            //        //不是默认的计算方法,bugsType表示选中的客专路线
            //        if (corpid != "0")
            //        {
            //          JieChuFeeRate = Convert.ToDouble(tab2.SearchScalar(condition, "NETFEE"));
            //          DianFeeRate = Convert.ToDouble(tab2.SearchScalar(condition, "ELECFEE"));
            //        }
            //        else
            //        {
            //            String lineType = line0.Nodes[i].LineType.Trim();
            //            if (lineType == "1")
            //            {
            //                JieChuFeeRate = TrainLineKindProfile.JieChuFee2;
            //                 DianFeeRate = TrainLineKindProfile.DianFee2;
            //            }
            //            else if (lineType == "2")
            //             {
            //                JieChuFeeRate = TrainLineKindProfile.JieChuFee1;
            //                DianFeeRate = TrainLineKindProfile.DianFee1;
            //             }
            //        }
            //        Fee = Fee + (JieChuFeeRate + DianFeeRate) * line0.Nodes[i].Miles * this.GetTrainWeight();
            //    }
            //}
            //if (this.IsYearFlag)
            //{
            //    Fee = Fee * 2 * 365;
            //}
            //else
            //{
            //    Fee = Fee * 2;
            //}
            #endregion
            Fee = Fee / UnitRate;
            return(JMath.Round1(Fee / 10000, this.XiaoShou));
        }