Пример #1
0
        /// <summary>
        /// 写入团队报价信息
        /// </summary>
        private IList <EyouSoft.Model.TourStructure.TourPriceDetail> InsertTourPriceDetail()
        {
            string[] PriceStand         = Utils.GetFormValues("drpPriceRank");
            string[] hidCustomerLevelID = Utils.GetFormValues("hidCustomerLevelID");

            IList <EyouSoft.Model.TourStructure.TourPriceDetail> priceList = new List <EyouSoft.Model.TourStructure.TourPriceDetail>();
            int i = 0;

            if (PriceStand != null)
            {
                foreach (string pricestand in PriceStand)
                {
                    IList <EyouSoft.Model.TourStructure.TourPriceCustomerLeaveDetail> list = new List <EyouSoft.Model.TourStructure.TourPriceCustomerLeaveDetail>();
                    EyouSoft.Model.TourStructure.TourPriceDetail priceModel = new EyouSoft.Model.TourStructure.TourPriceDetail();
                    priceModel.PriceStandId = pricestand;

                    foreach (string customerlevelid in hidCustomerLevelID)
                    {
                        string[] PeoplePrice = Utils.GetFormValues("PeoplePrice" + customerlevelid);
                        string[] ChildPrice  = Utils.GetFormValues("ChildPrice" + customerlevelid);

                        EyouSoft.Model.TourStructure.TourPriceCustomerLeaveDetail model = new EyouSoft.Model.TourStructure.TourPriceCustomerLeaveDetail();
                        if (!String.IsNullOrEmpty(PeoplePrice[i]) && Utils.GetDecimal(PeoplePrice[i]) != 0)
                        {
                            model.AdultPrice = decimal.Parse(PeoplePrice[i]);
                        }
                        else
                        {
                            model.AdultPrice = 0;
                        }
                        if (!String.IsNullOrEmpty(ChildPrice[i]) && Utils.GetDecimal(ChildPrice[i]) != 0)
                        {
                            model.ChildrenPrice = decimal.Parse(ChildPrice[i]);
                        }
                        else
                        {
                            model.ChildrenPrice = 0;
                        }
                        model.CustomerLevelId = int.Parse(customerlevelid);
                        list.Add(model);
                        model = null;
                    }
                    priceModel.PriceDetail = list;
                    list = null;
                    priceList.Add(priceModel);
                    priceModel = null;
                    i++;
                }
            }
            return(priceList);
        }
Пример #2
0
        /// <summary>
        /// 团队报价信息
        /// </summary>
        /// <returns></returns>
        private IList <EyouSoft.Model.TourStructure.TourPriceDetail> InsertTourPriceDetail()
        {
            string[] PriceStand         = Utils.GetFormValues("drpPriceRank");       //价格等级编号
            string[] hidCustomerLevelID = Utils.GetFormValues("hidCustomerLevelID"); //客户等级编号
            IList <EyouSoft.Model.TourStructure.TourPriceDetail> priceList = new List <EyouSoft.Model.TourStructure.TourPriceDetail>();

            int i = 0;

            if (PriceStand != null)
            {
                foreach (string pricestand in PriceStand)
                {
                    IList <EyouSoft.Model.TourStructure.TourPriceCustomerLeaveDetail> list = new List <EyouSoft.Model.TourStructure.TourPriceCustomerLeaveDetail>();
                    EyouSoft.Model.TourStructure.TourPriceDetail priceModel = new EyouSoft.Model.TourStructure.TourPriceDetail();
                    priceModel.PriceStandId = pricestand;
                    foreach (string customerlevelid in hidCustomerLevelID)
                    {
                        string[] PeoplePrice  = Utils.GetFormValues("PeoplePrice" + customerlevelid);
                        string[] ChildPrice   = Utils.GetFormValues("ChildPrice" + customerlevelid);
                        string   CustomerType = Utils.GetFormValue("hidCustomerType" + customerlevelid);

                        EyouSoft.Model.TourStructure.TourPriceCustomerLeaveDetail model = new EyouSoft.Model.TourStructure.TourPriceCustomerLeaveDetail();
                        model.AdultPrice      = Utils.GetDecimal(PeoplePrice[i]);
                        model.ChildrenPrice   = Utils.GetDecimal(ChildPrice[i], 0);
                        model.CustomerLevelId = Utils.GetInt(customerlevelid);
                        list.Add(model);
                        model = null;
                    }
                    priceModel.PriceDetail = list;
                    priceList.Add(priceModel);
                    int PriceStandCount = 0;
                    PriceStandCount = priceList.Count(item => item.PriceStandId == pricestand);
                    if (PriceStandCount > 1)
                    {
                        Response.Clear();
                        Response.Write("[{isSuccess:false,ErrorMessage:'价格等级相同,保存失败!'}]");
                        Response.End();
                    }
                    list = null;
                    i++;
                }
            }
            return(priceList);
        }