Ejemplo n.º 1
0
        /// <summary>
        /// 初始化界面
        /// </summary>
        /// <param name="orderId"></param>
        private void PageInit(string orderId)
        {
            EyouSoft.BLL.TourStructure.BTourOrder         bOrder = new EyouSoft.BLL.TourStructure.BTourOrder();
            EyouSoft.Model.TourStructure.MTourOrderExpand order  = bOrder.GetTourOrderExpandByOrderId(orderId);
            if (order != null)
            {
                this.LtOrderCode.Text            = order.OrderCode;
                this.LtSellerName.Text           = order.SellerName;
                this.LtOperator.Text             = order.Operator;
                this.LtAdults.Text               = order.Adults.ToString();
                this.LtChilds.Text               = order.Childs.ToString();
                this.LtAdultPrice.Text           = EyouSoft.Common.UtilsCommons.GetMoneyString(order.AdultPrice, this.ProviderToMoney);
                this.LtChildPrice.Text           = EyouSoft.Common.UtilsCommons.GetMoneyString(order.ChildPrice, this.ProviderToMoney);
                this.LtSaleAddCost.Text          = EyouSoft.Common.UtilsCommons.GetMoneyString(order.SaleAddCost, this.ProviderToMoney);
                this.LtSaleAddCostRemark.Text    = order.SaleAddCostRemark;
                this.LtSaleReduceCost.Text       = EyouSoft.Common.UtilsCommons.GetMoneyString(order.SaleReduceCost, this.ProviderToMoney);
                this.LtSaleReduceCostRemark.Text = order.SaleReduceCostRemark;
                this.LtSumPrice.Text             = EyouSoft.Common.UtilsCommons.GetMoneyString(order.SumPrice, this.ProviderToMoney);
                this.LtGuideIncome.Text          = EyouSoft.Common.UtilsCommons.GetMoneyString(order.GuideIncome, this.ProviderToMoney);
                this.LtSalerIncome.Text          = EyouSoft.Common.UtilsCommons.GetMoneyString(order.SalerIncome, this.ProviderToMoney);
                this.txtSaveSeatDate.Text        = order.SaveSeatDate.HasValue ? order.SaveSeatDate.Value.ToString() : string.Empty;
                this.LtOrderRemark.Text          = order.OrderRemark;

                if (order.MTourOrderTravellerList != null && order.MTourOrderTravellerList.Count != 0)
                {
                    this.RpTravller.DataSource = order.MTourOrderTravellerList;
                    this.RpTravller.DataBind();
                }
                else
                {
                    this.phTraveller.Visible = false;
                }



                switch (order.OrderStatus)
                {
                case EyouSoft.Model.EnumType.TourStructure.OrderStatus.未处理:
                case EyouSoft.Model.EnumType.TourStructure.OrderStatus.已留位:
                    this.PhDo.Visible = true;
                    break;

                default:
                    this.PhDo.Visible = false;
                    break;
                }


                //写入计调信息的TourId
                this.hfTourId.Value = order.TourId;
                this.hfAdults.Value = order.Adults.ToString();
                this.hfChilds.Value = order.Childs.ToString();
                this.hfConfirmSettlementMoney.Value = order.ConfirmSettlementMoney.ToString();
            }
        }
Ejemplo n.º 2
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();
            }
            else
            {
                this.rpt_CustomerList.DataSource = null;
                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);
                    }
                }
            }
        }
Ejemplo n.º 3
0
        /// <summary>
        /// 初始化界面
        /// </summary>
        /// <param name="orderId"></param>
        private void PageInit(string orderId, string type)
        {
            EyouSoft.BLL.TourStructure.BTourOrder         bOrder = new EyouSoft.BLL.TourStructure.BTourOrder();
            EyouSoft.Model.TourStructure.MTourOrderExpand order  = bOrder.GetTourOrderExpandByOrderId(orderId);
            if (order != null)
            {
                this.LtOrderCode.Text    = order.OrderCode;
                this.LtDCompanyName.Text = order.DCompanyName;
                this.LtDContactName.Text = order.DContactName;
                this.LtDContactTel.Text  = order.DContactTel;

                this.LtSellerName.Text           = order.SellerName;
                this.LtOperator.Text             = order.Operator;
                this.LtAdults.Text               = order.Adults.ToString();
                this.LtChilds.Text               = order.Childs.ToString();
                this.LtAdultPrice.Text           = EyouSoft.Common.UtilsCommons.GetMoneyString(order.AdultPrice, this.ProviderToMoney);
                this.LtChildPrice.Text           = EyouSoft.Common.UtilsCommons.GetMoneyString(order.ChildPrice, this.ProviderToMoney);
                this.LtSaleAddCost.Text          = EyouSoft.Common.UtilsCommons.GetMoneyString(order.SaleAddCost, this.ProviderToMoney);
                this.LtSaleAddCostRemark.Text    = order.SaleAddCostRemark;
                this.LtSaleReduceCost.Text       = EyouSoft.Common.UtilsCommons.GetMoneyString(order.SaleReduceCost, this.ProviderToMoney);
                this.LtSaleReduceCostRemark.Text = order.SaleReduceCostRemark;
                this.LtSumPrice.Text             = EyouSoft.Common.UtilsCommons.GetMoneyString(order.SumPrice, this.ProviderToMoney);
                this.LtGuideIncome.Text          = EyouSoft.Common.UtilsCommons.GetMoneyString(order.GuideIncome, this.ProviderToMoney);
                this.LtSalerIncome.Text          = EyouSoft.Common.UtilsCommons.GetMoneyString(order.SalerIncome, this.ProviderToMoney);
                this.LtSaveSeatDate.Text         = order.SaveSeatDate.HasValue ? order.SaveSeatDate.Value.ToString() : string.Empty;
                this.LtOrderRemark.Text          = order.OrderRemark;

                EyouSoft.BLL.TourStructure.BTour           bll   = new EyouSoft.BLL.TourStructure.BTour();
                EyouSoft.Model.TourStructure.MTourBaseInfo model = bll.GetTourInfo(Convert.ToString(tourID));
                if (model.TourType == EyouSoft.Model.EnumType.TourStructure.TourType.组团散拼短线)
                {
                    string CarLocation = string.Empty;
                    if (order.TourOrderCarLocation != null)
                    {
                        CarLocation = order.TourOrderCarLocation.Location;
                    }
                    if (!string.IsNullOrEmpty(CarLocation))
                    {
                        this.setCarLocation.Text = CarLocation;
                    }
                    else
                    {
                        this.setCarLocation.Text = "<font class='fontred'>未设置上车地点</font>";
                    }
                    string carInfo = string.Empty;
                    if (order.TourCarTypeList != null && order.TourCarTypeList.Count > 0)
                    {
                        for (int i = 0; i < order.TourCarTypeList.Count; i++)
                        {
                            if (i == order.TourCarTypeList.Count - 1)
                            {
                                carInfo += order.TourCarTypeList[i].CarTypeName;
                            }
                            else
                            {
                                carInfo += order.TourCarTypeList[i].CarTypeName + "、";
                            }
                        }
                    }
                    if (!string.IsNullOrEmpty(carInfo))
                    {
                        this.carInfo.Text = carInfo;
                    }
                    else
                    {
                        this.carInfo.Text = "<font class='fontred'>未设置车型</font>";
                    }
                }
                else
                {
                    this.PhCarLocation.Visible = false;
                }

                if (order.MTourOrderTravellerList != null && order.MTourOrderTravellerList.Count != 0)
                {
                    this.RpTravller.DataSource = order.MTourOrderTravellerList;
                    this.RpTravller.DataBind();
                }
                else
                {
                    this.phTraveller.Visible = false;
                }
            }
        }
Ejemplo n.º 4
0
        /// <summary>
        /// 页面初始化
        /// </summary>
        private void PageInit()
        {
            this.lblApplyMan.Text      = SiteUserInfo.Name;
            this.lblApplyDateTime.Text = UtilsCommons.GetDateString(DateTime.Now, this.ProviderToDate);

            EyouSoft.BLL.TourStructure.BQuote bll = new EyouSoft.BLL.TourStructure.BQuote();

            string tourId  = Utils.GetQueryStringValue("tourId");
            string orderId = Utils.GetQueryStringValue("orderId");
            string msg     = string.Empty;
            //询价单位编号
            string buyID = string.Empty;
            //销售员编号
            string sellsID = string.Empty;
            //合计金额
            decimal price      = 0;
            decimal settePrice = 0;

            if (tourId != "")
            {
                this.hideTourId.Value = tourId;
                EyouSoft.BLL.TourStructure.BTour tourBll = new EyouSoft.BLL.TourStructure.BTour();

                EyouSoft.Model.TourStructure.MTourTeamInfo model = (EyouSoft.Model.TourStructure.MTourTeamInfo)tourBll.GetTourInfo(tourId);
                if (model != null)
                {
                    if (model.SaleInfo != null)
                    {
                        sellsID = model.SaleInfo.SellerId;
                    }
                    if (model.CompanyInfo != null)
                    {
                        buyID = model.CompanyInfo.CompanyId;
                    }
                    settePrice = price = model.SumPrice;
                }
            }

            if (orderId != "")
            {
                this.hideOrderId.Value = orderId;
                EyouSoft.BLL.TourStructure.BTourOrder         orderBll   = new EyouSoft.BLL.TourStructure.BTourOrder();
                EyouSoft.Model.TourStructure.MTourOrderExpand orderModel = orderBll.GetTourOrderExpandByOrderId(orderId);
                if (orderModel != null)
                {
                    sellsID    = orderModel.SellerId;
                    buyID      = orderModel.BuyCompanyId;
                    price      = orderModel.SumPrice;
                    settePrice = orderModel.ConfirmSettlementMoney;
                }
            }

            if (buyID != "" && sellsID != "" && price > 0)
            {
                EyouSoft.Model.FinStructure.MCustomerWarning customerWarningModel = bll.GetCustomerOverrunDetail(buyID, price, SiteUserInfo.CompanyId);
                EyouSoft.Model.FinStructure.MSalesmanWarning salesmanWarningModel = bll.GetSaleOverrunDetail(sellsID, settePrice, SiteUserInfo.CompanyId);
                if (customerWarningModel != null)
                {
                    PageHtml[0] = "<tr><td height='28' bgcolor='#FFFFFF' align='center'>" + customerWarningModel.Customer + "</td><td bgcolor='#FFFFFF' align='center'><b class='fontbsize12'>" + UtilsCommons.GetMoneyString(customerWarningModel.AmountOwed, this.ProviderToMoney) + "</b></td><td bgcolor='#FFFFFF' align='center'><a class='link1'><strong>" + UtilsCommons.GetMoneyString(customerWarningModel.Arrear, this.ProviderToMoney) + "</strong></a></td><td bgcolor='#FFFFFF' align='center'><b class='fontgreen'>" + UtilsCommons.GetMoneyString(customerWarningModel.Transfinite, this.ProviderToMoney) + "</b></td><td bgcolor='#FFFFFF' align='center'>" + UtilsCommons.GetDateString(customerWarningModel.TransfiniteTime, this.ProviderToDate) + "</td><td bgcolor='#FFFFFF' align='center'>" + customerWarningModel.Deadline.ToString() + "</td><td bgcolor='#FFFFFF' align='center'>" + (customerWarningModel.DeadDay <= 0 ? 0 : customerWarningModel.DeadDay) + "</td></tr>";
                }
                else
                {
                    this.phdKehu.Visible = false;
                }

                if (salesmanWarningModel != null)
                {
                    PageHtml[1] = "<tr><td height='28' bgcolor='#FFFFFF' align='center'>" + salesmanWarningModel.SellerName + "</td><td bgcolor='#FFFFFF' align='center'><strong>" + UtilsCommons.GetMoneyString(salesmanWarningModel.AmountOwed, this.ProviderToMoney) + "</strong></td><td bgcolor='#FFFFFF' align='center'><strong>" + UtilsCommons.GetMoneyString(salesmanWarningModel.ConfirmAdvances, this.ProviderToMoney) + "</strong></td><td bgcolor='#FFFFFF' align='center'><strong>" + UtilsCommons.GetMoneyString(salesmanWarningModel.PreIncome, this.ProviderToMoney) + "</strong></td><td bgcolor='#FFFFFF' align='center'><b class='fontblue'>" + UtilsCommons.GetMoneyString(salesmanWarningModel.SumPay, this.ProviderToMoney) + "</b></td><td bgcolor='#FFFFFF' align='center'><b class='fontbsize12'>" + UtilsCommons.GetMoneyString(salesmanWarningModel.Arrear, this.ProviderToMoney) + "</b></td><td bgcolor='#FFFFFF' align='center'><b class='fontgreen'>" + UtilsCommons.GetMoneyString(salesmanWarningModel.Transfinite, this.ProviderToMoney) + "</b></td><td bgcolor='#FFFFFF' align='center'>" + UtilsCommons.GetDateString(salesmanWarningModel.TransfiniteTime, this.ProviderToDate) + "</td></tr>";
                }
                else
                {
                    this.phdXiaoshou.Visible = false;
                }
            }
            else
            {
                this.phdKehu.Visible     = false;
                this.phdXiaoshou.Visible = false;
            }
        }
Ejemplo n.º 5
0
        /// <summary>
        /// 保存按钮点击事件执行方法
        /// </summary>
        protected string PageSave()
        {
            string msg = "";

            #region 获得参数
            string doType   = Utils.GetQueryStringValue("doType");
            string saveType = Utils.GetQueryStringValue("saveType");
            string tourID   = Utils.GetQueryStringValue("tourID");
            string orderID  = Utils.GetQueryStringValue("orderID");
            #endregion

            #region 获得表单
            //联系人
            string contactName = Utils.GetFormValue(this.txtContact.UniqueID);
            string contactTel  = Utils.GetFormValue(this.txtContactTel.UniqueID);
            //联系人部门编号
            string contactDepartId = Utils.GetFormValue(this.hideContactDeptId.UniqueID);
            //销售员
            string sellsID   = Utils.GetFormValue(this.SellsSelect1.SellsIDClient);
            string sellsName = Utils.GetFormValue(this.SellsSelect1.SellsNameClient);
            //客户单位
            string companyID   = Utils.GetFormValue(this.CustomerUnitSelect1.ClientNameKHBH);
            string companyName = Utils.GetFormValue(this.CustomerUnitSelect1.ClientNameKHMC);
            #region 团队计划价格组成
            //成人单价
            decimal adultPrice = Utils.GetDecimal(Utils.GetFormValue(this.hideAdultPrice.UniqueID));
            //成人数
            int adultCount = Utils.GetInt(Utils.GetFormValue(this.txtAdultCount.UniqueID));
            //儿童单价
            decimal childPrice = Utils.GetDecimal(Utils.GetFormValue(this.hideChildPrcie.UniqueID));
            //儿童数量
            int childCount = Utils.GetInt(Utils.GetFormValue(this.txtChildCount.UniqueID));
            #endregion
            //增加费用
            decimal addPrice = Utils.GetDecimal(Utils.GetFormValue(this.txtAddPrice.UniqueID));
            //增加费用备注
            string remarksFrist = Utils.GetFormValue(this.txtRemarksFrist.UniqueID);
            //减少费用
            decimal reducePrice = Utils.GetDecimal(Utils.GetFormValue(this.txtReducePrice.UniqueID));
            //减少费用备注
            string remarksSecond = Utils.GetFormValue(this.txtRemarksSecond.UniqueID);
            //导游现收
            decimal guidePrice = Utils.GetDecimal(Utils.GetFormValue(this.txtGuidePrice.UniqueID));
            //合计金额
            decimal totalPrice = Utils.GetDecimal(Utils.GetFormValue(this.txtTotalPrice.UniqueID));
            //销售应收
            decimal sellPrice = totalPrice - guidePrice;
            //订单备注
            string orderRemarks = Utils.GetFormValue(this.txtRemarksOrder.UniqueID);
            //合同号
            string contractCode   = Utils.GetFormValue(txtHeTongHao.HeTongCodeClientID);
            string contractCodeId = Utils.GetFormValue(txtHeTongHao.HeTongIdClientID);
            //客源地 国家
            int countryID = Utils.GetInt(Utils.GetFormValue("sltCountry"));
            //客源地 省份
            int provinceID = Utils.GetInt(Utils.GetFormValue("sltProvince"));
            //预留截至时间
            DateTime?saveSeatDate = Utils.GetDateTimeNullable(Utils.GetFormValue(this.txtSaveSeatDate.UniqueID));
            //团类型
            EyouSoft.Model.EnumType.TourStructure.TourType tourType = (EyouSoft.Model.EnumType.TourStructure.TourType)Utils.GetInt(Utils.GetFormValue(this.hideTourType.UniqueID));
            //订单来源
            EyouSoft.Model.EnumType.TourStructure.OrderType orderType = (EyouSoft.Model.EnumType.TourStructure.OrderType)Utils.GetInt(Utils.GetFormValue(this.hideOrderFrom.UniqueID));
            #endregion

            #region 表单验证

            if (contactName == "")
            {
                msg = "请输入联系人!<br />";
            }
            if (sellsID == "" || sellsName == "")
            {
                msg += "请选择销售员!<br />";
            }
            if (adultPrice <= 0)
            {
                msg += "请输入成人单价!<br />";
            }
            if (adultCount <= 0)
            {
                msg += "请输入成人数!<br />";
            }
            if (saveType == "1" && saveSeatDate == null)
            {
                msg += "请选择预留日期!<br />";
            }
            if (saveType == "1" && saveSeatDate != null)
            {
                GetMaxDateTime();
                if (saveSeatDate > Utils.GetDateTime(MaxDateTime) || saveSeatDate < DateTime.Now.AddMinutes(5))
                {
                    msg += "请选择新的预留日期!<br />";
                }
            }


            if (msg != "")
            {
                return(UtilsCommons.AjaxReturnJson("0", msg));
            }

            #endregion

            EyouSoft.BLL.TourStructure.BTourOrder         orderBll   = new EyouSoft.BLL.TourStructure.BTourOrder();
            EyouSoft.Model.TourStructure.MTourOrderExpand orderModel = new EyouSoft.Model.TourStructure.MTourOrderExpand();

            orderModel.BuyCompanyId    = companyID;
            orderModel.BuyCompanyName  = companyName;
            orderModel.ContactName     = contactName;
            orderModel.ContactTel      = contactTel;
            orderModel.ContactDepartId = contactDepartId;
            orderModel.SellerId        = sellsID;
            orderModel.SellerName      = sellsName;
            orderModel.OperatorId      = SiteUserInfo.UserId;
            orderModel.Operator        = SiteUserInfo.Name;
            orderModel.Adults          = adultCount;
            orderModel.Childs          = childCount;
            orderModel.PriceStandId    = Utils.GetInt(Utils.GetFormValue(this.hidePriceStandID.UniqueID));
            orderModel.BuyCountryId    = countryID;
            orderModel.BuyProvincesId  = provinceID;
            orderModel.SettlementMoney = adultPrice * adultCount + childCount * childPrice;
            #region 销售价
            orderModel.LevId      = Utils.GetInt(Utils.GetFormValue(this.hideLevelID.UniqueID));
            orderModel.AdultPrice = Utils.GetDecimal(Utils.GetFormValue(this.hideAdultPrice.UniqueID));
            orderModel.ChildPrice = Utils.GetDecimal(Utils.GetFormValue(this.hideChildPrcie.UniqueID));
            #endregion

            #region 结算价
            orderModel.PeerAdultPrice = Utils.GetDecimal(Utils.GetFormValue(this.hideSettAdultPrice.UniqueID));
            orderModel.PeerChildPrice = Utils.GetDecimal(Utils.GetFormValue(this.hideSettChildPrice.UniqueID));
            orderModel.PeerLevId      = Utils.GetInt(Utils.GetFormValue(this.hideSettLevelID.UniqueID));
            #endregion


            orderModel.ContractCode         = contractCode;
            orderModel.ContractId           = contractCodeId;
            orderModel.OrderRemark          = orderRemarks;
            orderModel.SaleAddCost          = addPrice;
            orderModel.SaleAddCostRemark    = remarksFrist;
            orderModel.SaleReduceCost       = reducePrice;
            orderModel.SaleReduceCostRemark = remarksSecond;
            orderModel.SalerIncome          = sellPrice;
            orderModel.GuideIncome          = guidePrice;
            orderModel.SumPrice             = totalPrice;
            orderModel.CompanyId            = SiteUserInfo.CompanyId;
            orderModel.DeptId = Utils.GetInt(Utils.GetFormValue(this.hideDeptID.UniqueID));
            orderModel.TourId = tourID;
            switch (tourType)
            {
            case EyouSoft.Model.EnumType.TourStructure.TourType.出境散拼:
            case EyouSoft.Model.EnumType.TourStructure.TourType.出境团队: orderModel.MTourOrderTravellerList = UtilsCommons.GetTravelListS(); break;

            case EyouSoft.Model.EnumType.TourStructure.TourType.组团散拼:
            case EyouSoft.Model.EnumType.TourStructure.TourType.地接散拼:
            case EyouSoft.Model.EnumType.TourStructure.TourType.地接团队:
            case EyouSoft.Model.EnumType.TourStructure.TourType.组团团队: orderModel.MTourOrderTravellerList = UtilsCommons.GetTravelList(); break;
            }
            int result = 0;

            //散拼订单新增

            orderModel.TourType   = tourType;
            orderModel.IssueTime  = DateTime.Now;
            orderModel.NeiBuXinXi = Utils.GetFormValue(txtNeiBuXinXi.UniqueID);

            #region 变更实体
            EyouSoft.Model.TourStructure.MTourOrderChange changeModel = new EyouSoft.Model.TourStructure.MTourOrderChange();
            changeModel.CompanyId    = orderModel.CompanyId;
            changeModel.TourId       = orderModel.TourId;
            changeModel.ChangePerson = adultCount + childCount;
            changeModel.ChangePrice  = totalPrice;
            changeModel.CompanyId    = SiteUserInfo.CompanyId;
            if (Utils.GetFormValue(this.hideOldAdultCount.UniqueID).Split('|').Length == 2)
            {
                int oldAdultCount = Utils.GetInt(Utils.GetFormValue(this.hideOldAdultCount.UniqueID).Split('|')[0]);
                int oldChildCount = Utils.GetInt(Utils.GetFormValue(this.hideOldAdultCount.UniqueID).Split('|')[1]);

                //changeModel.Content = "成人数由" + adultCount + "变" + oldAdultCount;
                changeModel.Content = "成人数由" + oldAdultCount + "变" + adultCount;

                //changeModel.Content += " 儿童数由" + childCount + "变" + oldChildCount;
                changeModel.Content += " 儿童数由" + oldChildCount + "变" + childCount;
            }
            changeModel.IssueTime  = DateTime.Now;
            changeModel.IsSure     = false;
            changeModel.Operator   = SiteUserInfo.Name;
            changeModel.OperatorId = SiteUserInfo.UserId;
            changeModel.OrderId    = orderID;
            changeModel.ChangeType = EyouSoft.Model.EnumType.TourStructure.ChangeType.修改;
            if (Utils.GetFormValue(this.hideOrderBianGeng.UniqueID) == "true")
            {
                changeModel.ChangeType = EyouSoft.Model.EnumType.TourStructure.ChangeType.变更;
            }

            #endregion

            switch (saveType)
            {
            //确认预留
            case "1":
                orderModel.OrderStatus     = EyouSoft.Model.EnumType.TourStructure.OrderStatus.已留位;
                orderModel.SaveSeatDate    = saveSeatDate;
                orderModel.TourOrderChange = changeModel;
                break;

            //确定成交
            case "2":
                orderModel.OrderStatus     = EyouSoft.Model.EnumType.TourStructure.OrderStatus.已成交;
                orderModel.SaveSeatDate    = null;
                orderModel.TourOrderChange = changeModel;
                break;

            case "4":
                orderModel.OrderStatus     = (EyouSoft.Model.EnumType.TourStructure.OrderStatus)Utils.GetInt(Utils.GetFormValue(this.hideOrderState.UniqueID));
                orderModel.SaveSeatDate    = saveSeatDate;
                orderModel.TourOrderChange = changeModel;
                break;

            //取消订单
            case "5":
                int bllRetCode1 = 0;
                bllRetCode1 = orderBll.UpdateTourOrderExpand(orderID, EyouSoft.Model.EnumType.TourStructure.OrderStatus.已取消, null);

                if (bllRetCode1 == 1)
                {
                    return(UtilsCommons.AjaxReturnJson("1", "操作成功"));
                }
                else if (bllRetCode1 == -99)
                {
                    return(UtilsCommons.AjaxReturnJson("0", "不存在的订单信息"));
                }
                else if (bllRetCode1 == -98)
                {
                    return(UtilsCommons.AjaxReturnJson("0", "已取消的订单不可重复取消订单"));
                }
                else if (bllRetCode1 == -97)
                {
                    return(UtilsCommons.AjaxReturnJson("0", "该计划状态不允许取消订单"));
                }
                else if (bllRetCode1 == -96)
                {
                    return(UtilsCommons.AjaxReturnJson("0", "已确认合同金额不允许取消订单"));
                }
                else if (bllRetCode1 == -95)
                {
                    return(UtilsCommons.AjaxReturnJson("0", "已存在收款信息不允许取消订单"));
                }
                else
                {
                    return(UtilsCommons.AjaxReturnJson("0", "操作失败"));
                }

            //不受理
            case "6":
                int bllRetCode2 = 0;
                bllRetCode2 = orderBll.UpdateTourOrderExpand(orderID, EyouSoft.Model.EnumType.TourStructure.OrderStatus.受理, null);

                if (bllRetCode2 == 1)
                {
                    return(UtilsCommons.AjaxReturnJson("1", "操作成功"));
                }
                else if (bllRetCode2 == -99)
                {
                    return(UtilsCommons.AjaxReturnJson("0", "不存在的订单信息"));
                }
                else if (bllRetCode2 == -98)
                {
                    return(UtilsCommons.AjaxReturnJson("0", "已取消的订单不可重复取消订单"));
                }
                else if (bllRetCode2 == -97)
                {
                    return(UtilsCommons.AjaxReturnJson("0", "该计划状态不允许取消订单"));
                }
                else if (bllRetCode2 == -96)
                {
                    return(UtilsCommons.AjaxReturnJson("0", "已确认合同金额不允许取消订单"));
                }
                else if (bllRetCode2 == -95)
                {
                    return(UtilsCommons.AjaxReturnJson("0", "已存在收款信息不允许取消订单"));
                }
                else
                {
                    return(UtilsCommons.AjaxReturnJson("0", "操作失败"));
                }
            }



            #region 新增订单
            if (tourID != "" && orderID == "")
            {
                orderModel.OrderId   = Guid.NewGuid().ToString();
                orderModel.OrderType = EyouSoft.Model.EnumType.TourStructure.OrderType.代客预定;
                result = orderBll.AddTourOrderExpand(orderModel);
            }
            #endregion

            #region 修改订单
            if (orderID != "")
            {
                //如果计划是供应商 发布的,且不超限 那么订单状态永远是未处理
                if (Utils.GetFormValue(this.hideSourceID.UniqueID).Trim() != "")
                {
                    orderModel.OrderStatus = EyouSoft.Model.EnumType.TourStructure.OrderStatus.未处理;
                }
                orderModel.OrderId   = orderID;
                orderModel.OrderType = orderType;
                result = orderBll.UpdateTourOrderExpand(orderModel);
            }

            switch (result)
            {
            case 1:
                msg = UtilsCommons.AjaxReturnJson("0", "报名失败,总人数超过计划剩余人数!");
                break;

            case 2:
                msg = UtilsCommons.AjaxReturnJson("0", "报名失败,合同号未领用!");
                break;

            case 3:
                if (saveType == "1")
                {
                    msg = UtilsCommons.AjaxReturnJson("1", "预留成功,正在跳转..");
                }
                if (saveType == "2")
                {
                    msg = UtilsCommons.AjaxReturnJson("1", "确认成功!");
                }
                if (saveType == "3")
                {
                    msg = UtilsCommons.AjaxReturnJson("1", "垫付申请成功!");
                }
                if (saveType == "4")
                {
                    msg = UtilsCommons.AjaxReturnJson("1", "操作成功!");
                }
                break;

            case 4:
                msg = UtilsCommons.AjaxReturnJson("0", "报名失败,未知错误!");
                break;

            case 5:
            case 9:
                msg = UtilsCommons.AjaxReturnJson("2", "操作成功! 销售员已超限,请收款或超限申请!", orderModel.OrderId);
                break;

            case 6:
            case 10:
                msg = UtilsCommons.AjaxReturnJson("2", "操作成功! 客户单位已超限,请收款或超限申请!", orderModel.OrderId);
                break;

            case 7:
            case 11:
                msg = UtilsCommons.AjaxReturnJson("2", "操作成功! 销售员和客户单位已超限,请收款或超限申请!", orderModel.OrderId);
                break;
            }
            #endregion
            return(msg);
        }
Ejemplo n.º 6
0
        protected 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)
            {
                if (orderModel.TourType == EyouSoft.Model.EnumType.TourStructure.TourType.组团散拼短线)
                {
                    Utils.ResponseGoBack();
                    return;
                }

                this.lblOrderNum.Text       = orderModel.OrderCode;
                this.SellsSelect1.SellsID   = orderModel.SellerId;
                this.SellsSelect1.SellsName = orderModel.SellerName;
                this.hideDeptID.Value       = orderModel.DeptId.ToString();
                this.CountryID  = orderModel.BuyCountryId.ToString();
                this.ProvinceID = orderModel.BuyProvincesId.ToString();
                this.CustomerUnitSelect1.CustomerUnitId   = orderModel.BuyCompanyId;
                this.CustomerUnitSelect1.CustomerUnitName = orderModel.BuyCompanyName;
                this.txtContact.Text         = orderModel.ContactName;
                this.txtContactTel.Text      = orderModel.ContactTel;
                this.hideContactDeptId.Value = orderModel.ContactDepartId;
                this.lblOrderMan.Text        = orderModel.Operator;
                this.txtAdultCount.Text      = orderModel.Adults.ToString();
                this.txtChildCount.Text      = orderModel.Childs.ToString();
                this.hideTourId.Value        = orderModel.TourId;
                this.hideOldAdultCount.Value = orderModel.Adults.ToString() + "|" + orderModel.Childs.ToString();
                txtHeTongHao.HeTongId        = orderModel.ContractId;
                txtHeTongHao.HeTongCode      = orderModel.ContractCode;
                this.hideSourceID.Value      = orderModel.SourceId;

                if (orderModel.OrderType == EyouSoft.Model.EnumType.TourStructure.OrderType.分销商下单)
                {
                    phKeHuKeYuanDanWei.Visible           = true;
                    ltrKeHuKeYuanDanWeiName.Text         = orderModel.DCompanyName;
                    ltrKeHuKeYuanDanWeiLxrName.Text      = orderModel.DContactName;
                    ltrKeHuKeYuanDanWeiLxrTelephone.Text = orderModel.DContactTel;
                }
                txtNeiBuXinXi.Text = orderModel.NeiBuXinXi;

                #region 销售价与报价等级
                this.hideLevelID.Value      = orderModel.LevId.ToString();
                this.hidePriceStandID.Value = orderModel.PriceStandId.ToString();
                this.hideAdultPrice.Value   = Utils.FilterEndOfTheZeroDecimal(orderModel.AdultPrice);
                this.hideChildPrcie.Value   = Utils.FilterEndOfTheZeroDecimal(orderModel.ChildPrice);
                #endregion

                #region 结算价与报价等级
                this.hideSettAdultPrice.Value = Utils.FilterEndOfTheZeroDecimal(orderModel.PeerAdultPrice);
                this.hideSettChildPrice.Value = Utils.FilterEndOfTheZeroDecimal(orderModel.PeerChildPrice);
                #endregion


                EyouSoft.Model.TourStructure.MTourSanPinInfo tourModel = (EyouSoft.Model.TourStructure.MTourSanPinInfo) new EyouSoft.BLL.TourStructure.BTour().GetTourInfo(orderModel.TourId);
                if (tourModel != null)
                {
                    //权限控制
                    PowerControl(tourModel.TourType);

                    this.hideTourType.Value           = ((int)tourModel.TourType).ToString();
                    this.PriceStand1.SetPriceStandard = tourModel.MTourPriceStandard;
                    if (orderModel.MTourOrderTravellerList != null)
                    {
                        switch (tourModel.TourType)
                        {
                        case EyouSoft.Model.EnumType.TourStructure.TourType.出境散拼:
                        case EyouSoft.Model.EnumType.TourStructure.TourType.出境团队:
                            this.pnlTravelFrist.Visible        = false;
                            this.TravelControlS1.SetTravelList = orderModel.MTourOrderTravellerList.Where(p => p.TravellerStatus == EyouSoft.Model.EnumType.TourStructure.TravellerStatus.在团).ToList();

                            break;

                        default:
                            this.pnlTravelSecond.Visible      = false;
                            this.TravelControl1.SetTravelList = orderModel.MTourOrderTravellerList.Where(p => p.TravellerStatus == EyouSoft.Model.EnumType.TourStructure.TravellerStatus.在团).ToList();
                            break;
                        }

                        IList <EyouSoft.Model.TourStructure.MTourOrderTraveller> outTraveller = orderModel.MTourOrderTravellerList.Where(p => p.TravellerStatus == EyouSoft.Model.EnumType.TourStructure.TravellerStatus.退团).ToList();
                        if (outTraveller != null && outTraveller.Count > 0)
                        {
                            this.rptOutTraveller.DataSource = outTraveller;
                            this.rptOutTraveller.DataBind();
                        }
                    }
                }
                this.txtAddPrice.Text      = Utils.FilterEndOfTheZeroDecimal(orderModel.SaleAddCost);
                this.txtRemarksFrist.Text  = orderModel.SaleAddCostRemark;
                this.txtReducePrice.Text   = Utils.FilterEndOfTheZeroDecimal(orderModel.SaleReduceCost);
                this.txtRemarksSecond.Text = orderModel.SaleReduceCostRemark;
                this.txtTotalPrice.Text    = Utils.FilterEndOfTheZeroDecimal(orderModel.SumPrice);
                this.hideOldSumMoney.Value = Utils.FilterEndOfTheZeroDecimal(orderModel.SumPrice);
                this.txtGuidePrice.Text    = Utils.FilterEndOfTheZeroDecimal(orderModel.GuideIncome);
                this.lblSellPrice.Text     = Utils.FilterEndOfTheZeroDecimal(orderModel.SalerIncome);
                this.txtSaveSeatDate.Text  = orderModel.SaveSeatDate.HasValue ? orderModel.SaveSeatDate.Value.ToString("yyyy-MM-dd HH:mm") : "";
                this.txtRemarksOrder.Text  = orderModel.OrderRemark;
                this.hideOrderFrom.Value   = ((int)orderModel.OrderType).ToString();


                this.pdhJiXuLiuWei.Visible      = false;
                this.phdQueRenYuLiu.Visible     = false;
                this.pdhBaoCun.Visible          = false;
                this.phdQuXiao.Visible          = false;
                this.phdBuShouLi.Visible        = false;
                this.phsQueRenChengJiao.Visible = false;

                #region 获得该订单的计划状态
                EyouSoft.BLL.TourStructure.BTour btour = new EyouSoft.BLL.TourStructure.BTour();
                EyouSoft.Model.EnumType.TourStructure.TourStatus tourStatus = btour.GetTourStatus(SiteUserInfo.CompanyId, orderModel.TourId);
                if (tourStatus != EyouSoft.Model.EnumType.TourStructure.TourStatus.销售未派计划)
                {
                    //该团已派计调
                    this.hideOrderBianGeng.Value = "true";
                }
                else
                {
                    this.hideOrderBianGeng.Value = "false";
                }
                #endregion

                //必须是下单人或者是销售员才可以修改订单 或者拥有修改所有数据的权限

                bool isUpdate = false;
                if (!SiteUserInfo.IsHandleElse)
                {
                    if (orderModel.SellerId == SiteUserInfo.UserId || orderModel.OperatorId == SiteUserInfo.UserId || orderModel.TourSellerId == SiteUserInfo.UserId)
                    {
                        isUpdate = true;
                    }
                    if (isUpdate == false)
                    {
                        if (orderModel.TourPlanerList != null && orderModel.TourPlanerList.Count > 0)
                        {
                            for (int i = 0; i < orderModel.TourPlanerList.Count; i++)
                            {
                                if (orderModel.TourPlanerList[i].PlanerId == SiteUserInfo.UserId)
                                {
                                    isUpdate = true;
                                }
                            }
                        }
                    }
                }

                if (isUpdate)
                {
                    this.hideOrderState.Value = ((int)orderModel.OrderStatus).ToString();

                    if (!string.IsNullOrEmpty(orderModel.SourceId) && orderModel.SourceId.Trim() != "")
                    {
                        if (orderModel.OrderType == EyouSoft.Model.EnumType.TourStructure.OrderType.分销商下单)
                        {
                            if (orderModel.OrderStatus == EyouSoft.Model.EnumType.TourStructure.OrderStatus.未处理)
                            {
                                this.pdhBaoCun.Visible = true;
                            }
                            else
                            {
                                this.pdhAllBtns.Visible = false;
                            }
                        }
                        else
                        {
                            if ((orderModel.OrderStatus == EyouSoft.Model.EnumType.TourStructure.OrderStatus.未处理 || orderModel.OrderStatus == EyouSoft.Model.EnumType.TourStructure.OrderStatus.垫付申请审核成功) && orderModel.TourStatus != EyouSoft.Model.EnumType.TourStructure.TourStatus.封团 && orderModel.TourStatus != EyouSoft.Model.EnumType.TourStructure.TourStatus.已取消)
                            {
                                this.pdhBaoCun.Visible = true;
                                this.phdQuXiao.Visible = true;
                            }
                            else
                            {
                                this.pdhAllBtns.Visible = false;
                            }
                        }
                    }
                    else
                    {
                        var _tourStatus = new EyouSoft.Model.EnumType.TourStructure.TourStatus[] {
                            EyouSoft.Model.EnumType.TourStructure.TourStatus.销售未派计划
                            , EyouSoft.Model.EnumType.TourStructure.TourStatus.计调未接收
                            , EyouSoft.Model.EnumType.TourStructure.TourStatus.计调配置
                            , EyouSoft.Model.EnumType.TourStructure.TourStatus.计调配置完毕
                            , EyouSoft.Model.EnumType.TourStructure.TourStatus.导游带团
                            , EyouSoft.Model.EnumType.TourStructure.TourStatus.导游报帐
                        };

                        switch (orderModel.OrderStatus)
                        {
                        case EyouSoft.Model.EnumType.TourStructure.OrderStatus.受理:
                            this.litOrderMsg.Text = "<div class='tishi_info'>该订单不受理,无法操作!</div>";
                            break;

                        case EyouSoft.Model.EnumType.TourStructure.OrderStatus.已取消:
                            this.litOrderMsg.Text = "<div class='tishi_info'>该订单已取消,无法操作!</div>";
                            break;

                        case EyouSoft.Model.EnumType.TourStructure.OrderStatus.垫付申请审核:
                            this.litOrderMsg.Text = "<div class='tishi_info'>该订单正在垫付申请审核中,无法操作!</div>";
                            break;

                        case EyouSoft.Model.EnumType.TourStructure.OrderStatus.垫付申请审核失败:
                            if (orderModel.OrderType == EyouSoft.Model.EnumType.TourStructure.OrderType.分销商下单)
                            {
                                this.phdBuShouLi.Visible = true;
                            }
                            else
                            {
                                this.phdQuXiao.Visible = true;
                            }
                            break;

                        case EyouSoft.Model.EnumType.TourStructure.OrderStatus.垫付申请审核成功:
                        case EyouSoft.Model.EnumType.TourStructure.OrderStatus.未处理:
                            if (_tourStatus.Contains(orderModel.TourStatus))
                            {
                                this.pdhBaoCun.Visible          = true;
                                this.phdQueRenYuLiu.Visible     = true;
                                this.phsQueRenChengJiao.Visible = true;

                                if (orderModel.OrderType == EyouSoft.Model.EnumType.TourStructure.OrderType.分销商下单)
                                {
                                    this.phdBuShouLi.Visible = true;
                                }
                                else
                                {
                                    this.phdQuXiao.Visible = true;
                                }
                            }
                            break;

                        case EyouSoft.Model.EnumType.TourStructure.OrderStatus.留位过期:
                        case EyouSoft.Model.EnumType.TourStructure.OrderStatus.已留位:
                            if (_tourStatus.Contains(orderModel.TourStatus))
                            {
                                if (orderModel.OrderType == EyouSoft.Model.EnumType.TourStructure.OrderType.分销商下单)
                                {
                                    this.phdBuShouLi.Visible = true;
                                }
                                else
                                {
                                    this.phdQuXiao.Visible = true;
                                }
                                this.pdhJiXuLiuWei.Visible      = true;
                                this.phsQueRenChengJiao.Visible = true;
                            }
                            break;

                        case EyouSoft.Model.EnumType.TourStructure.OrderStatus.已成交:
                            if (_tourStatus.Contains(orderModel.TourStatus))
                            {
                                this.pdhBaoCun.Visible = true;
                                this.phdQuXiao.Visible = true;
                            }
                            break;

                        case EyouSoft.Model.EnumType.TourStructure.OrderStatus.资金超限:
                            if (orderModel.OrderType == EyouSoft.Model.EnumType.TourStructure.OrderType.分销商下单)
                            {
                                this.phdBuShouLi.Visible = true;
                            }
                            else
                            {
                                this.phdQuXiao.Visible = true;
                            }
                            break;
                        }
                    }
                }
            }
            else
            {
                Utils.ResponseGoBack();
            }
        }