コード例 #1
0
        private void InitPage()
        {
            EyouSoft.IBLL.TourStructure.ITourOrder Ibll  = EyouSoft.BLL.TourStructure.TourOrder.CreateInstance();
            EyouSoft.Model.TourStructure.TourOrder Model = new EyouSoft.Model.TourStructure.TourOrder();
            Model = Ibll.GetOrderModel(OrderID);
            List <EyouSoft.Model.TourStructure.TourOrder> lists = new List <EyouSoft.Model.TourStructure.TourOrder>();

            if (Model != null)
            {
                if (this.SiteUserInfo.CompanyID == Model.CompanyID)
                {
                    isRouteCompanyProduct = true;
                }
                if (this.SiteUserInfo.CompanyID == Model.BuyCompanyID)
                {
                    isTourCompanyProduct = true;
                }
                //该产品既不属于专线,也不是组团所买的产品时
                if (!isTourCompanyProduct && !isRouteCompanyProduct)
                {
                    Response.Clear();
                    Response.Write("对不起,该订单你没有修改和查看的权限!");
                    Response.End();
                }
                InitButtonSate(Model.OrderState);
                TourID = Model.TourId;
                lists.Add(Model);
                ShowRemnantNumber = EyouSoft.BLL.TourStructure.Tour.CreateInstance().GetTourInfo(Model.TourId).RealRemnantNumber;
                BuyCompanyName    = Model.BuyCompanyName;
                ContactName       = Model.ContactName;
                ContactTel        = Model.ContactTel;
                ContactQQ         = Model.ContactQQ;
                LeaveDate         = Model.LeaveDate.ToShortDateString();
                ContactMQ         = Model.ContactMQ;
                LeaveTraffic      = Model.LeaveTraffic;
                OrderSource       = (int)Model.OrderSource;
                OrderState        = (int)Model.OrderState;
                //游客
                InitCustomers(Model.TourOrderCustomer);
                this.rptEditOrder.DataSource = lists;
                this.rptEditOrder.DataBind();
                Model = null;
                Ibll  = null;
                Model = null;
            }
            else
            {
                InitButtonSate(null);
            }
            lists = null;
        }
コード例 #2
0
        /// <summary>
        /// 初始化
        /// </summary>
        private void InitPage(bool isShow)
        {
            #region 根据订单号获取相关信息
            //EyouSoft.Model.TourStructure.TourOrder
            EyouSoft.IBLL.TourStructure.ITourOrder IOrderbll  = EyouSoft.BLL.TourStructure.TourOrder.CreateInstance();
            EyouSoft.Model.TourStructure.TourOrder OrderModel = IOrderbll.GetOrderModel(OrderID);
            if (OrderModel != null)
            {
                BuyCompanyID  = OrderModel.BuyCompanyID;
                SellCompanyID = OrderModel.CompanyID;
                RouteName     = OrderModel.RouteName;

                if (!string.IsNullOrEmpty(OrderModel.LeaveTraffic))
                {
                    ltrTraffic.Text = EyouSoft.Common.Function.StringValidate.TextToHtml(OrderModel.LeaveTraffic);
                }
                else
                {
                    Tr_Traffic.Visible = false;
                }

                ComfirmTime        = DateTime.Now.ToShortDateString();
                AdultPrice         = OrderModel.PersonalPrice.ToString("F2");
                this.ChildrenPrice = OrderModel.ChildPrice.ToString("F2");
                SumPrice           = OrderModel.SumPrice.ToString("F2");
                AdultNum           = OrderModel.AdultNumber;
                ChildrenNum        = OrderModel.ChildNumber;
            }
            else
            {
                return;
            }
            #endregion

            #region 游客信息
            if (OrderModel.TourOrderCustomer != null && OrderModel.TourOrderCustomer.Count > 0)
            {
                IList <EyouSoft.Model.TourStructure.TourOrderCustomer> OrderCustomerList = OrderModel.TourOrderCustomer;
                this.rptCustomers.DataSource = OrderCustomerList;
                this.rptCustomers.DataBind();
                if (rptCustomers.Items.Count < 1)
                {
                    this.tblCustomers.Visible = false;
                }
            }
            #endregion

            #region 专线公司信息
            EyouSoft.Model.CompanyStructure.CompanyInfo SellCompany = new EyouSoft.Model.CompanyStructure.CompanyInfo();
            SellCompany = this.GetCompanyInfo(SellCompanyID);
            if (SellCompany != null)
            {
                txtSellCompanyName.Value = SellCompany.CompanyName;
                txtSellConnectName.Value = SellCompany.ContactInfo.ContactName;
                txtSellConnectFax.Value  = SellCompany.ContactInfo.Fax;
                txtSellConnectTel.Value  = SellCompany.ContactInfo.Tel;
            }
            #endregion

            #region 组团公司信息
            EyouSoft.Model.CompanyStructure.CompanyInfo BuyCompany = new EyouSoft.Model.CompanyStructure.CompanyInfo();
            BuyCompany = this.GetCompanyInfo(BuyCompanyID);
            if (BuyCompany != null)
            {
                txtBuyCompanyName.Value = BuyCompany.CompanyName;
                txtBuyConnectName.Value = BuyCompany.ContactInfo.ContactName;
                txtBuyConnectFax.Value  = BuyCompany.ContactInfo.Fax;
                txtBuyConnectTel.Value  = BuyCompany.ContactInfo.Tel;
            }
            #endregion

            if (this.IsLogin)
            {
                CompanyID = this.SiteUserInfo.CompanyID;
                ltrSellCompanyName.Text = this.SiteUserInfo.CompanyName;
            }

            #region 银行帐号信息
            EyouSoft.IBLL.CompanyStructure.IBankAccount         IbankBll = EyouSoft.BLL.CompanyStructure.BankAccount.CreateInstance();
            IList <EyouSoft.Model.CompanyStructure.BankAccount> bankList = IbankBll.GetList(SellCompanyID);
            if (bankList != null && bankList.Count > 0)
            {
                EyouSoft.Model.CompanyStructure.BankAccount CompanyBankAccount = bankList.FirstOrDefault(BankItem =>
                {
                    return(BankItem.AccountType == EyouSoft.Model.CompanyStructure.BankAccountType.公司);
                });
                if (CompanyBankAccount != null)
                {
                    ltrSellCompanyName.Text    = CompanyBankAccount.BankAccountName;
                    ltrBuyComapnyBankName.Text = CompanyBankAccount.BankName;
                    ltrBuyComapnyBankNo.Text   = CompanyBankAccount.AccountNumber;
                }

                rptBankAccount.DataSource = ((List <EyouSoft.Model.CompanyStructure.BankAccount>)bankList).FindAll(BankItem =>
                {
                    return(BankItem.AccountType == EyouSoft.Model.CompanyStructure.BankAccountType.个人);
                });
                rptBankAccount.DataBind();
                IbankBll           = null;
                bankList           = null;
                CompanyBankAccount = null;
            }
            #endregion

            #region 团队信息
            EyouSoft.IBLL.TourStructure.ITour     Ibll  = EyouSoft.BLL.TourStructure.Tour.CreateInstance();
            EyouSoft.Model.TourStructure.TourInfo model = Ibll.GetTourInfo(TourID);
            if (model != null)
            {
                RouteName = model.RouteName;
                TourDays  = model.TourDays;
                LeaveDate = model.LeaveDate;
                if (model.ReleaseType == EyouSoft.Model.TourStructure.ReleaseType.Standard)//标准发布
                {
                    if (!string.IsNullOrEmpty(model.MeetTourContect))
                    {
                        ltrMeetTourContect.Text = EyouSoft.Common.Function.StringValidate.TextToHtml(model.MeetTourContect);
                    }
                    else
                    {
                        tr_MeetTourContect.Visible = false;
                    }
                    if (!string.IsNullOrEmpty(model.CollectionContect))
                    {
                        ltrCollectionContect.Text = EyouSoft.Common.Function.StringValidate.TextToHtml(model.CollectionContect);
                    }
                    else
                    {
                        tr_CollectionContect.Visible = false;
                    }
                    ResideContent       = EyouSoft.Common.Function.StringValidate.TextToHtml(model.ServiceStandard.ResideContent);       //住宿
                    DinnerContent       = EyouSoft.Common.Function.StringValidate.TextToHtml(model.ServiceStandard.DinnerContent);       //用餐
                    SightContent        = EyouSoft.Common.Function.StringValidate.TextToHtml(model.ServiceStandard.SightContent);        //景点
                    CarContent          = EyouSoft.Common.Function.StringValidate.TextToHtml(model.ServiceStandard.CarContent);          //用车
                    GuideContent        = EyouSoft.Common.Function.StringValidate.TextToHtml(model.ServiceStandard.GuideContent);        //导游
                    TrafficContent      = EyouSoft.Common.Function.StringValidate.TextToHtml(model.ServiceStandard.TrafficContent);      //往返交通
                    IncludeOtherContent = EyouSoft.Common.Function.StringValidate.TextToHtml(model.ServiceStandard.IncludeOtherContent); //其它
                    NotContainService   = EyouSoft.Common.Function.StringValidate.TextToHtml(model.ServiceStandard.NotContainService);   //其它说明
                    //备注
                    SpeciallyNotice = EyouSoft.Common.Function.StringValidate.TextToHtml(model.ServiceStandard.SpeciallyNotice);
                    //行程信息
                    rptStandardPlan.DataSource = model.StandardPlan;
                    rptStandardPlan.DataBind();
                }
                else//快速发布
                {
                    tr_MeetTourContect.Visible   = false;
                    tr_CollectionContect.Visible = false;
                    pnlQuickPlan.Visible         = true;
                    pnlNotQuickPlan.Visible      = false;
                    QuickPlanContent             = model.QuickPlan;
                }
            }
            Ibll       = null;
            model      = null;
            IOrderbll  = null;
            OrderModel = null;
            #endregion

            #region 公司盖章信息
            if (!string.IsNullOrEmpty(OrderID))
            {
                //判断是否属于该订单的专线商或组团社
                if (this.SiteUserInfo.CompanyID == BuyCompanyID || this.SiteUserInfo.CompanyID == SellCompanyID)
                {
                    string[] imgPath = EyouSoft.BLL.TourStructure.CompanyContractSignet.CreateInstance().GetConfirmationSignet(OrderID);
                    if (imgPath.Length > 0)
                    {
                        imgBuyCompany.ImageUrl = Domain.FileSystem + imgPath[0];
                        if (!string.IsNullOrEmpty(imgPath[0]))
                        {
                            imgBuyCompany.Visible = true;
                        }
                        if (!string.IsNullOrEmpty(imgPath[0]) && isTourCompany)
                        {
                            this.btnCancelStamp.Visible = true;
                            this.btnToStamp.Visible     = false;
                        }
                        if (imgPath.Length > 1)
                        {
                            imgSellCompany.ImageUrl = Domain.FileSystem + imgPath[1];
                            if (!string.IsNullOrEmpty(imgPath[1]))
                            {
                                imgSellCompany.Visible = true;
                            }
                            if (!string.IsNullOrEmpty(imgPath[1]) && !isTourCompany)
                            {
                                this.btnCancelStamp.Visible = true;
                                this.btnToStamp.Visible     = false;
                            }
                        }
                    }
                }
                else
                {
                    this.btnCancelStamp.Visible = false;
                    this.btnToStamp.Visible     = false;
                }
            }
            else
            {
                this.btnCancelStamp.Visible = false;
                this.btnToStamp.Visible     = false;
            }
            //if (!this.CheckGrant(EyouSoft.Common.TravelPermission.系统设置_盖章))
            //{
            this.btnCancelStamp.Visible = false;
            this.btnToStamp.Visible     = false;
            //}
            if (!isShow)
            {
                imgSellCompany.Visible = false;
                imgBuyCompany.Visible  = false;
            }
            #endregion
            IOrderbll   = null;
            OrderModel  = null;
            SellCompany = null;
            BuyCompany  = null;
        }