Esempio n. 1
0
        /// <summary>
        /// 获取大交通时间实体
        /// </summary>
        /// <param name="LargeTimeXml">大交通时间XML</param>
        /// <returns></returns>
        private IList <EyouSoft.Model.PlanStructure.MPlanLargeTime> GetLargeTimeList(string LargeTimeXml)
        {
            IList <EyouSoft.Model.PlanStructure.MPlanLargeTime> list = new List <EyouSoft.Model.PlanStructure.MPlanLargeTime>();

            if (!string.IsNullOrEmpty(LargeTimeXml))
            {
                EyouSoft.Model.PlanStructure.MPlanLargeTime model = null;
                XElement xem = XElement.Parse(LargeTimeXml);
                var      row = xem.Elements("row");
                foreach (var item in row)
                {
                    model = new EyouSoft.Model.PlanStructure.MPlanLargeTime()
                    {
                        Departure     = item.Element("Departure").Value,
                        DepartureTime = item.Element("DepartureTime").Value == string.Empty ? DateTime.MinValue : Utils.GetDateTime(item.Element("DepartureTime").Value),
                        Destination   = item.Element("Destination").Value,
                        Numbers       = item.Element("Numbers").Value
                    };
                    list.Add(model); model = null;
                }
            }
            return(list);
        }
Esempio n. 2
0
        void PageSave()
        {
            #region 表单赋值
            string message     = string.Empty;
            string seterrorMsg = string.Empty;
            //出票点
            string votesID = Utils.GetFormValue(this.supplierControl1.ClientValue);
            //出票点id
            string votesName = Utils.GetFormValue(this.supplierControl1.ClientText);
            //联系人 电话 传真
            string contectName  = Utils.GetFormValue(this.txtContentName.UniqueID);
            string contectPhone = Utils.GetFormValue(this.txtContentPhone.UniqueID);
            string contectFax   = Utils.GetFormValue(this.txtContentFax.UniqueID);
            //出发时间 出发地 目的地 航班号
            string[] startdate = Utils.GetFormValues("txtstartTime");
            //string[] startTime = Utils.GetFormValues("txtstartHours");
            string[] startPlace = Utils.GetFormValues("txtstartPlace");
            string[] endplace   = Utils.GetFormValues("txtendPlace");
            string[] filghtNum  = Utils.GetFormValues("txtFilghtnumbers");
            //舱位 乘客类型 人数  价格 保险 机建费 附加费 折扣 小计
            string[] seleSpaceType  = Utils.GetFormValues("seleSpaceType");
            string[] Passengerstype = Utils.GetFormValues("Passengerstype");
            string[] peopleNums     = Utils.GetFormValues("txtpeopleNums");
            string[] prices         = Utils.GetFormValues("txtprices");
            //string[] Insurance = Utils.GetFormValues("txtInsurance");
            //string[] jiJianFei = Utils.GetFormValues("txtjiJianFei");
            //string[] FujiaFei = Utils.GetFormValues("txtFujiaFei");
            //string[] Zekou = Utils.GetFormValues("txtZekou");
            string[] TotalPrices           = Utils.GetFormValues("txtXiaoJi");
            string[] txtFeiJiHangBanBeiZhu = Utils.GetFormValues("txtFeiJiHangBanBeiZhu");
            //结算费用 费用明细
            decimal totalPrices = Utils.GetDecimal(Utils.GetFormValue(this.txtCostAccount.UniqueID));
            string  costDetail  = Utils.GetFormValue(this.txtCostParticu.UniqueID);
            //导游需知 其它备注
            string guidNotes   = Utils.GetFormValue(this.txtGuidNotes.UniqueID);
            string otherRemark = Utils.GetFormValue(this.txtOtherMark.UniqueID);
            #endregion

            #region 验证
            if (string.IsNullOrEmpty(votesID) && string.IsNullOrEmpty(votesName))
            {
                message += "请选择出票点!<br/>";
            }
            if (startdate.Length > 0)
            {
                for (int i = 0; i < startdate.Length; i++)
                {
                    if (string.IsNullOrEmpty(startdate[i]))
                    {
                        message += "*请选择出发日期!<br/>";
                    }
                }
            }

            /*if (startTime.Length > 0)
             * {
             *  for (int i = 0; i < startTime.Length; i++)
             *  {
             *      if (string.IsNullOrEmpty(startTime[i]))
             *      {
             *          message += "*请输入出发时间!<br/>";
             *      }
             *  }
             * }
             * if (startPlace.Length > 0)
             * {
             *  for (int i = 0; i < startPlace.Length; i++)
             *  {
             *      if (string.IsNullOrEmpty(startPlace[i]))
             *      {
             *          message += "*请输入出发地!<br/>";
             *      }
             *  }
             * }
             * if (endplace.Length > 0)
             * {
             *  for (int i = 0; i < startPlace.Length; i++)
             *  {
             *      if (string.IsNullOrEmpty(endplace[i]))
             *      {
             *          message += "*请输入目的地!<br/>";
             *      }
             *  }
             * }
             * if (filghtNum.Length > 0)
             * {
             *  for (int i = 0; i < filghtNum.Length; i++)
             *  {
             *      if (string.IsNullOrEmpty(filghtNum[i]))
             *      {
             *          message += "*请输入航班号!<br/>";
             *      }
             *  }
             * }
             *
             * if (seleSpaceType.Length > 0)
             * {
             *  for (int i = 0; i < seleSpaceType.Length; i++)
             *  {
             *      if (string.IsNullOrEmpty(seleSpaceType[i]))
             *      {
             *          message += "*请选择舱位!<br/>";
             *      }
             *  }
             * }
             * if (Passengerstype.Length > 0)
             * {
             *  for (int i = 0; i < Passengerstype.Length; i++)
             *  {
             *      if (string.IsNullOrEmpty(Passengerstype[i]))
             *      {
             *          message += "*请选择乘客类型!<br/>";
             *      }
             *  }
             * }
             * if (peopleNums.Length > 0)
             * {
             *  for (int i = 0; i < peopleNums.Length; i++)
             *  {
             *      if (string.IsNullOrEmpty(peopleNums[i]) || Utils.GetDecimal(peopleNums[i]) <= 0)
             *      {
             *          message += "*请输入人数!<br/>";
             *      }
             *  }
             * }
             * if (prices.Length > 0)
             * {
             *  for (int i = 0; i < prices.Length; i++)
             *  {
             *      if (string.IsNullOrEmpty(prices[i]) || Utils.GetDecimal(prices[i]) <= 0)
             *      {
             *          message += "*请输入价格!<br/>";
             *      }
             *  }
             * }
             * if (Insurance.Length > 0)
             * {
             *  for (int i = 0; i < Insurance.Length; i++)
             *  {
             *      if (string.IsNullOrEmpty(Insurance[i]) || Utils.GetDecimal(Insurance[i]) <= 0)
             *      {
             *          message += "*请输入保险!<br/>";
             *      }
             *  }
             * }
             * if (jiJianFei.Length > 0)
             * {
             *  for (int i = 0; i < jiJianFei.Length; i++)
             *  {
             *      if (string.IsNullOrEmpty(jiJianFei[i]) || Utils.GetDecimal(jiJianFei[i]) <= 0)
             *      {
             *          message += "*请输入机建费!<br/>";
             *      }
             *  }
             * }
             * if (FujiaFei.Length > 0)
             * {
             *  for (int i = 0; i < FujiaFei.Length; i++)
             *  {
             *      if (string.IsNullOrEmpty(FujiaFei[i]) || Utils.GetDecimal(FujiaFei[i]) <= 0)
             *      {
             *          message += "*请输入附加费!<br/>";
             *      }
             *  }
             * }
             * if (Zekou.Length > 0)
             * {
             *  for (int i = 0; i < Zekou.Length; i++)
             *  {
             *      if (string.IsNullOrEmpty(Zekou[i]) || Utils.GetDecimal(Zekou[i]) <= 0)
             *      {
             *          message += "*请输入折扣!<br/>";
             *      }
             *  }
             * }
             * if (TotalPrices.Length > 0)
             * {
             *  for (int i = 0; i < TotalPrices.Length; i++)
             *  {
             *      if (string.IsNullOrEmpty(TotalPrices[i]) || Utils.GetDecimal(TotalPrices[i]) <= 0)
             *      {
             *          message += "*请输入小计费用!<br/>";
             *      }
             *  }
             * }*/
            if (string.IsNullOrEmpty(Utils.GetFormValue("SelPamyMent")))
            {
                message += "请选择支付方式!<br/>";
            }
            if (string.IsNullOrEmpty(Utils.GetFormValue("SelStatus")))
            {
                message += "请选择状态!<br/>";
            }
            if (message != "")
            {
                seterrorMsg = UtilsCommons.AjaxReturnJson("0", "" + message + "");
                RCWE(seterrorMsg);
            }
            #endregion

            #region 实体赋值
            EyouSoft.Model.PlanStructure.MPlanBaseInfo AirBase = new EyouSoft.Model.PlanStructure.MPlanBaseInfo();
            AirBase.AddStatus    = EyouSoft.Model.EnumType.PlanStructure.PlanAddStatus.计调安排时添加;
            AirBase.CompanyId    = this.SiteUserInfo.CompanyId;
            AirBase.Confirmation = totalPrices;
            AirBase.ContactFax   = contectFax;
            AirBase.ContactName  = contectName;
            AirBase.ContactPhone = contectPhone;
            AirBase.CostDetail   = costDetail;
            AirBase.GuideNotes   = guidNotes;
            AirBase.IssueTime    = System.DateTime.Now;
            AirBase.PaymentType  = (EyouSoft.Model.EnumType.PlanStructure.Payment)Utils.GetInt(Utils.GetFormValue("SelPamyMent"));
            //航班
            int nums = 0;
            AirBase.PlanLargeTime = new List <EyouSoft.Model.PlanStructure.MPlanLargeTime>();
            for (int i = 0; i < startdate.Length; i++)
            {
                EyouSoft.Model.PlanStructure.MPlanLargeTime largTime = new EyouSoft.Model.PlanStructure.MPlanLargeTime();
                largTime.Departure     = startPlace[i];
                largTime.DepartureTime = Utils.GetDateTimeNullable(startdate[i]);
                largTime.Destination   = endplace[i];
                largTime.Numbers       = filghtNum[i];
                //largTime.Time = startTime[i];
                largTime.AdultsType = (EyouSoft.Model.EnumType.PlanStructure.PlanLargeAdultsType)Enum.Parse(typeof(EyouSoft.Model.EnumType.PlanStructure.PlanLargeAdultsType), Passengerstype[i]);
                //largTime.Discount = float.Parse(Zekou[i]);
                //largTime.Fee = Utils.GetDecimal(jiJianFei[i]);
                //largTime.Insurance = Utils.GetDecimal(Insurance[i]);
                largTime.PayNumber = Utils.GetInt(peopleNums[i]);
                nums += EyouSoft.Common.Utils.GetInt(peopleNums[i]);
                largTime.FarePrice = Utils.GetDecimal(prices[i]);
                largTime.SeatType  = (EyouSoft.Model.EnumType.PlanStructure.PlanLargeSeatType)Enum.Parse(typeof(EyouSoft.Model.EnumType.PlanStructure.PlanLargeSeatType), seleSpaceType[i]);
                largTime.SumPrice  = Utils.GetDecimal(TotalPrices[i]);
                //largTime.Surcharge = Utils.GetDecimal(FujiaFei[i]);
                largTime.BeiZhu = txtFeiJiHangBanBeiZhu[i];
                AirBase.PlanLargeTime.Add(largTime);
            }
            AirBase.Num          = nums;
            AirBase.Remarks      = otherRemark;
            AirBase.SourceId     = votesID;
            AirBase.SourceName   = votesName;
            AirBase.Status       = (EyouSoft.Model.EnumType.PlanStructure.PlanState)Utils.GetInt(Utils.GetFormValue("SelStatus"));
            AirBase.SueId        = "";
            AirBase.TourId       = Utils.GetQueryStringValue("tourId");
            AirBase.Type         = EyouSoft.Model.EnumType.PlanStructure.PlanProject.飞机;
            AirBase.PlanCost     = totalPrices;
            AirBase.OperatorId   = this.SiteUserInfo.UserId;
            AirBase.OperatorName = this.SiteUserInfo.Name;
            #endregion

            #region 提交操作
            if (Utils.GetQueryStringValue("action") == "saveAir")
            {
                string planID = Utils.GetQueryStringValue("planIdAir");
                if (planID != null && !string.IsNullOrEmpty(planID))
                {
                    AirBase.PlanId = planID;
                    if (new EyouSoft.BLL.PlanStructure.BPlan().UpdPlan(AirBase) > 0)
                    {
                        message    += "修改成功!";
                        seterrorMsg = UtilsCommons.AjaxReturnJson("1", "" + message + "");
                    }
                    else
                    {
                        message    += "修改失败!";
                        seterrorMsg = UtilsCommons.AjaxReturnJson("0", "" + message + "");
                    }
                }
                else
                {
                    if (new EyouSoft.BLL.PlanStructure.BPlan().AddPlan(AirBase) > 0)
                    {
                        message    += "添加成功!";
                        seterrorMsg = UtilsCommons.AjaxReturnJson("1", "" + message + "");
                    }
                    else
                    {
                        message    += "添加失败!";
                        seterrorMsg = UtilsCommons.AjaxReturnJson("0", "" + message + "");
                    }
                }
            }
            RCWE(seterrorMsg);
            #endregion
        }