Пример #1
0
        /// <summary>
        /// 订单下面的游客信息汇总
        /// </summary>
        /// <param name="orderId">订单编号</param>
        /// <param name="tourId">团队编号</param>
        protected void InitPageForOrder(string orderId)
        {
            EyouSoft.BLL.TourStructure.BTourOrder BLL = new EyouSoft.BLL.TourStructure.BTourOrder();
            IList <EyouSoft.Model.TourStructure.BuyCompanyTraveller> list = BLL.GetTourOrderBuyCompanyTravellerByOrderId(orderId);

            if (list != null && list.Count > 0)
            {
                this.rpt_CustomerList.DataSource = list.Where(p => p.TravellerStatus == TravellerStatus.在团);
                this.rpt_CustomerList.DataBind();
            }

            EyouSoft.Model.TourStructure.MTourOrderExpand model = BLL.GetTourOrderExpandByOrderId(orderId);
            EyouSoft.BLL.TourStructure.BTour BTour = new EyouSoft.BLL.TourStructure.BTour();

            if (model != null)
            {
                EyouSoft.Model.TourStructure.MTourBaseInfo tourModel = BTour.GetBasicTourInfo(model.TourId);
                if (tourModel != null)
                {
                    this.lbRouteName.Text = tourModel.RouteName;
                    this.lbTourCode.Text  = tourModel.TourCode;
                    this.lbName.Text      = tourModel.OperatorInfo.Name + (string.IsNullOrEmpty(tourModel.OperatorInfo.Mobile) ? "" : "/" + tourModel.OperatorInfo.Mobile);
                    if (tourModel.GuideList != null && tourModel.GuideList.Count > 0)
                    {
                        this.lbGuid.Text = tourModel.GuideList.First().Name + (string.IsNullOrEmpty(tourModel.GuideList.First().Phone) ? "" : "/" + tourModel.GuideList.First().Phone);
                    }
                    if (tourModel.TourPlaner != null && tourModel.TourPlaner.Count > 0)
                    {
                        this.lbTourPlaner.Text = tourModel.TourPlaner.First().Planer + (string.IsNullOrEmpty(tourModel.TourPlaner.First().Phone) ? "" : "/" + tourModel.TourPlaner.First().Phone);
                    }
                }
            }
        }
Пример #2
0
        /// <summary>
        /// 获取座位人数
        /// </summary>
        /// <param name="orderid"></param>
        /// <returns></returns>
        private string GetPeopleNum(string orderid)
        {
            EyouSoft.BLL.TourStructure.BTourOrder         bll        = new EyouSoft.BLL.TourStructure.BTourOrder();
            EyouSoft.Model.TourStructure.MTourOrderExpand orderModel = bll.GetTourOrderExpandByOrderId(orderid);
            int peonum = 0;

            if (orderModel != null)
            {
                peonum = orderModel.Adults + orderModel.Childs;
            }
            return(peonum.ToString());
        }
Пример #3
0
 private void PageInitForOrder(string orderID)
 {
     EyouSoft.BLL.TourStructure.BTourOrder         bll        = new EyouSoft.BLL.TourStructure.BTourOrder();
     EyouSoft.Model.TourStructure.MTourOrderExpand orderModel = bll.GetTourOrderExpandByOrderId(orderID);
     if (orderModel != null)
     {
         this.lblOrderNum.Text       = orderModel.OrderCode;
         this.ltrBuyCompanyName.Text = orderModel.BuyCompanyName;
         txtHeTongHao.HeTongId       = orderModel.ContractId;
         txtHeTongHao.HeTongCode     = orderModel.ContractCode;
     }
     else
     {
         Utils.ResponseGoBack();
     }
 }
Пример #4
0
        /// <summary>
        /// 保存操作
        /// </summary>
        /// <returns></returns>
        private string Save()
        {
            string msg = string.Empty;

            EyouSoft.Model.TourStructure.MTourOrderExpand order             = new EyouSoft.Model.TourStructure.MTourOrderExpand();
            IList <EyouSoft.Model.TourStructure.MTourOrderCarTypeSeat> list = null;

            if (PageValidate(ref order, ref msg))
            {
                //判断客户单位是否欠款、单团账龄是否超限
                EyouSoft.BLL.TourStructure.BQuote            bll = new EyouSoft.BLL.TourStructure.BQuote();
                EyouSoft.Model.FinStructure.MCustomerWarning customerWarningModel = bll.GetCustomerOverrunDetail(SiteUserInfo.TourCompanyInfo.CompanyId, order.SumPrice, SiteUserInfo.CompanyId);

                if (customerWarningModel != null)
                {
                    msg = UtilsCommons.AjaxReturnJson("0", "您的欠款已经超过限额,暂不可报名。");
                }
                else
                {
                    EyouSoft.BLL.TourStructure.BTourOrder bOrder = new EyouSoft.BLL.TourStructure.BTourOrder();
                    string IsShortRoute = Utils.GetQueryStringValue("IsShort");
                    int    flg          = 0;
                    if (!string.IsNullOrEmpty(IsShortRoute))
                    {
                        flg = bOrder.AddTourOrderExpand(order, ref list);
                    }
                    else
                    {
                        flg = bOrder.AddTourOrderExpand(order);
                    }
                    if (flg == 3)
                    {
                        msg = UtilsCommons.AjaxReturnJson("1", "订单报名成功! 正在跳转...");
                    }
                    else if (flg == 5)
                    {
                        msg = UtilsCommons.AjaxReturnJson("0", "计划自动客满,不允许报名!");
                    }
                    else if (flg == 6)
                    {
                        msg = UtilsCommons.AjaxReturnJson("0", "计划自动停收,不允许报名!");
                    }
                    else if (flg == 7)
                    {
                        msg = UtilsCommons.AjaxReturnJson("0", "计划手动客满,不允许报名!");
                    }
                    else if (flg == 8)
                    {
                        msg = UtilsCommons.AjaxReturnJson("0", "计划手动停收,不允许报名!");
                    }
                    else if (flg == 1)
                    {
                        msg = UtilsCommons.AjaxReturnJson("0", "订单报名人数超过计划剩余人数!");
                    }
                    else
                    {
                        msg = UtilsCommons.AjaxReturnJson("0", "订单报名失败!");
                    }
                }
            }
            else
            {
                msg = UtilsCommons.AjaxReturnJson("0", msg);
            }

            return(msg);
        }
Пример #5
0
        /// <summary>
        /// 页面验证
        /// </summary>
        /// <param name="order"></param>
        /// <param name="msg"></param>
        /// <returns></returns>
        private bool PageValidate(ref EyouSoft.Model.TourStructure.MTourOrderExpand order, ref string msg)
        {
            //验证的字段
            string DCompanyName = Utils.GetFormValue("txtDCompanyName");

            if (string.IsNullOrEmpty(DCompanyName))
            {
                msg += "客源单位 不能为空!</br>";
            }
            string DContactName = Utils.GetFormValue("txtDContactName");

            if (string.IsNullOrEmpty(DContactName))
            {
                msg += "联系人 不能为空!</br>";
            }

            string DContactTel = Utils.GetFormValue("txtDContactTel");

            if (string.IsNullOrEmpty(DContactTel))
            {
                msg += "联系定电话 不能为空!</br>";
            }

            int Adults = Utils.GetInt(Utils.GetFormValue("txtAdults"));

            if (Adults < 0)
            {
                msg += "成人数 格式不正确!</br>";
            }

            int Childs = Utils.GetInt(Utils.GetFormValue("txtChilds"));

            if (Childs < 0)
            {
                msg += "儿童数 格式不正确!</br>";
            }
            decimal SumPrice = Utils.GetDecimal(Utils.GetFormValue("txtSumPrice"));

            if (SumPrice <= 0)
            {
                msg += "合计金额 格式不正确!</br>";
            }
            string saveDate = Utils.GetFormValue("txtSaveSeatDate");

            if (!string.IsNullOrEmpty(saveDate))
            {
                DateTime?SaveSeatDate = Utils.GetDateTimeNullable(saveDate);
                if (!SaveSeatDate.HasValue)
                {
                    msg += "留位时间 格式不正确!</br>";
                }
            }
            string tourType = Utils.GetFormValue("hfTourType");

            if (msg.Length <= 0)
            {
                //短线
                if (!string.IsNullOrEmpty(Utils.GetQueryStringValue("IsShort")))
                {
                    string CarLocationID = Utils.GetFormValue("selPickUpPosition");
                    if (!string.IsNullOrEmpty(CarLocationID))
                    {
                        EyouSoft.Model.TourStructure.MTourOrderCarLocation modelcar = new EyouSoft.Model.TourStructure.MTourOrderCarLocation();
                        string location = this.hidlocation.Value;
                        string desc     = this.hidDesc.Value;
                        modelcar.Desc              = desc;
                        modelcar.Location          = location;
                        modelcar.OffPrice          = Utils.GetDecimal(this.hidOffPrice.Value);
                        modelcar.OnPrice           = Utils.GetDecimal(this.hidOnPrice.Value);
                        modelcar.TourLocationId    = CarLocationID;
                        order.TourOrderCarLocation = modelcar;
                    }
                    IList <EyouSoft.Model.TourStructure.MTourOrderCarTypeSeat> listSeat = new List <EyouSoft.Model.TourStructure.MTourOrderCarTypeSeat>();
                    listSeat = Newtonsoft.Json.JsonConvert.DeserializeObject <IList <MTourOrderCarTypeSeat> >(Utils.GetFormValue(this.SetSeat1.setSeatHidClientID));
                    order.TourOrderCarTypeSeatList = listSeat;
                }
                order.CompanyId      = SiteUserInfo.CompanyId;
                order.TourId         = Utils.GetQueryStringValue("TourId");
                order.BuyCompanyName = SiteUserInfo.TourCompanyInfo.CompanyName;
                order.BuyCompanyId   = SiteUserInfo.TourCompanyInfo.CompanyId;
                //客源单位联系人信息(当前分销商)
                string lxrId = SiteUserInfo.TourCompanyInfo.LxrId;
                order.ContactDepartId = lxrId;
                EyouSoft.BLL.CrmStructure.BCrmLinkMan   link    = new EyouSoft.BLL.CrmStructure.BCrmLinkMan();
                EyouSoft.Model.CrmStructure.MCrmLinkman linkMan = link.GetLinkManModel(lxrId);
                if (linkMan != null)
                {
                    order.ContactName = linkMan.Name;
                    order.ContactTel  = linkMan.Telephone;
                }


                order.OrderStatus = EyouSoft.Model.EnumType.TourStructure.OrderStatus.未处理;

                //联系人信息
                order.DCompanyName = DCompanyName;
                order.DContactName = DContactName;
                order.DContactTel  = DContactTel;



                //销售员信息
                order.SellerId   = SiteUserInfo.UserId;
                order.SellerName = SiteUserInfo.Name;
                order.DeptId     = SiteUserInfo.DeptId;

                //操作员信息
                order.Operator   = SiteUserInfo.Name;
                order.OperatorId = SiteUserInfo.UserId;

                order.Adults = Adults;
                order.Childs = Childs;

                //价格组成
                string strPrice = Utils.GetFormValue("txt_PriceStand_radio_price");
                if (!string.IsNullOrEmpty(strPrice))
                {
                    string[] price = strPrice.Split('|');
                    order.LevId      = Utils.GetInt(price[0]);
                    order.AdultPrice = Utils.GetDecimal(price[1]);
                    order.ChildPrice = Utils.GetDecimal(price[2]);
                }

                string strStandard = Utils.GetFormValue("_hstandard");
                if (!string.IsNullOrEmpty(strStandard))
                {
                    int Standard = Utils.GetInt(strStandard);
                    order.PriceStandId = Standard;
                    EyouSoft.BLL.TourStructure.BTour                        bll          = new EyouSoft.BLL.TourStructure.BTour();
                    EyouSoft.Model.TourStructure.MTourSanPinInfo            model        = (EyouSoft.Model.TourStructure.MTourSanPinInfo)bll.GetTourInfo(order.TourId);
                    IList <EyouSoft.Model.TourStructure.MTourPriceStandard> standardList = model.MTourPriceStandard.Where(c => c.Standard == Standard).ToList();

                    if (standardList != null && standardList.Count != 0)
                    {
                        List <EyouSoft.Model.TourStructure.MTourPriceLevel> levelList = new List <EyouSoft.Model.TourStructure.MTourPriceLevel>();
                        foreach (var a in standardList)
                        {
                            levelList.AddRange(a.PriceLevel);
                        }
                        if (levelList != null && levelList.Count != 0)
                        {
                            EyouSoft.Model.TourStructure.MTourPriceLevel item = levelList.SingleOrDefault(c => c.LevType == EyouSoft.Model.EnumType.ComStructure.LevType.内部结算价);
                            if (item != null)
                            {
                                order.PeerAdultPrice  = item.AdultPrice;
                                order.PeerChildPrice  = item.ChildPrice;
                                order.PeerLevId       = item.LevelId;
                                order.SettlementMoney = order.PeerAdultPrice * Adults + order.PeerChildPrice * Childs;
                            }
                        }
                    }
                }

                order.SaleAddCost          = Utils.GetDecimal(Utils.GetFormValue("txtSaleAddCost"));
                order.SaleAddCostRemark    = Utils.GetFormValue("txtSaleAddCostRemark");
                order.SaleReduceCost       = Utils.GetDecimal(Utils.GetFormValue("txtSaleReduceCost"));
                order.SaleReduceCostRemark = Utils.GetFormValue("txtSaleReduceCostRemark");

                order.SumPrice = Utils.GetDecimal(Utils.GetFormValue("txtSumPrice"));

                order.SaveSeatDate = Utils.GetDateTimeNullable(Utils.GetFormValue("txtSaveSeatDate"));
                order.OrderRemark  = Utils.GetFormValue("txtOrderRemark");



                order.OrderType = EyouSoft.Model.EnumType.TourStructure.OrderType.分销商下单;

                order.MTourOrderTravellerList = new List <EyouSoft.Model.TourStructure.MTourOrderTraveller>();
                order.TourType = (EyouSoft.Model.EnumType.TourStructure.TourType)Enum.Parse(typeof(EyouSoft.Model.EnumType.TourStructure.TourType), tourType);
                switch (order.TourType)
                {
                case EyouSoft.Model.EnumType.TourStructure.TourType.组团散拼:
                case TourType.组团散拼短线:
                case EyouSoft.Model.EnumType.TourStructure.TourType.地接散拼:
                    order.MTourOrderTravellerList = UtilsCommons.GetTravelList();
                    break;

                case EyouSoft.Model.EnumType.TourStructure.TourType.出境散拼:
                    order.MTourOrderTravellerList = UtilsCommons.GetTravelListS();
                    break;
                }
            }

            return(msg.Length <= 0);
        }