Exemplo n.º 1
0
        //統計每一段的FLY 成本
        private static void ReCalculateFlyCost(ref Boolean ChkFlyCost, ref float AdultFlyCost, ref float ChdFlyCost, ref float SenoirFlyCost,
                                               List <DataRow> cost_lst, bool IsHoliday)
        {
            if (cost_lst.Count > 0)
            {
                //先找出這一天是星期幾..
                //如果航段定義為來回,當去程是否加假有落在上面,有的話以假日加價的成本計,回程依去程定義為主
                //如果航段定義為單程,就單程單程看.
                //int ThisDayOfWeek = Convert.ToStringEx(e.Day.Date.DayOfWeek);

                List <string> TripWayIsRt = new List <string> {
                };                                                                //定義了去程 trp_way 是 RT 的航段明細

                foreach (DataRow Dr in cost_lst)
                {
                    string AddPriceWeeks = Dr.ToStringEx("ADD_PRICE_WEEKS");

                    try
                    {
                        float AdultPrice = 0, ChdPrice = 0, SeniorPrice = 0;

                        AdultPrice  = IsHoliday ? Dr.ToSingle("ADULT_COST_H") : Dr.ToSingle("ADULT_COST");
                        ChdPrice    = IsHoliday ? Dr.ToSingle("CHD_COST_H") : Dr.ToSingle("CHD_COST");
                        SeniorPrice = IsHoliday ? Dr.ToSingle("OLD_COST_H") : Dr.ToSingle("OLD_COST");

                        AdultFlyCost  = AdultPrice;
                        ChdFlyCost    = ChdPrice;
                        SenoirFlyCost = SeniorPrice;

                        ChkFlyCost = true;
                    }
                    catch (Exception ex)
                    {
                        Website.Instance.logger.FatalFormat("{0},{1}", ex.Message, ex.StackTrace);
                        ChkFlyCost = false;
                    }
                }
            }
            else
            {
                ChkFlyCost = false;
            }
        }