Beispiel #1
0
        protected void LinkButton1_Click(object sender, EventArgs e)
        {
            BllQuote           = new EyouSoft.BLL.RouteStructure.Quote();
            ModelRouteTeaminfo = new EyouSoft.Model.RouteStructure.QuoteTeamInfo();

            if (SetQuoteTeamValues())
            {
                string ActionType = Utils.GetFormValue(this.hideType.UniqueID);
                if (ActionType == "update")
                {
                    ModelRouteTeaminfo.QuoteId = Utils.GetInt(Utils.GetQueryStringValue("QuoteID"));
                    if (BllQuote.UpdateTourTeamQuote(ModelRouteTeaminfo) > 0)
                    {
                        Utils.ShowAndRedirect("报价信息修改成功!", "/xianlu/Quote.aspx?RouteID=" + Utils.GetQueryStringValue("RouteId") + "&Areaid=" + Utils.GetQueryStringValue("Areaid"));
                    }
                    else
                    {
                        Utils.ShowAndRedirect("报价信息修改失败!", "/xianlu/Quote.aspx?RouteID=" + Utils.GetQueryStringValue("RouteId") + "&Areaid=" + Utils.GetQueryStringValue("Areaid"));
                    }
                }
                else
                {
                    //提交报价信息
                    if (BllQuote.InsertTourTeamQuote(ModelRouteTeaminfo) > 0)
                    {
                        Utils.ShowAndRedirect("提交报价成功!", "/xianlu/Quote.aspx?RouteID=" + Utils.GetQueryStringValue("RouteId") + "&Areaid=" + Utils.GetQueryStringValue("Areaid"));
                    }
                    else
                    {
                        Utils.ShowAndRedirect("提交报价失败!", "/xianlu/Quote.aspx?RouteID=" + Utils.GetQueryStringValue("RouteId") + "&Areaid=" + Utils.GetQueryStringValue("Areaid"));
                    }
                }
            }
        }
Beispiel #2
0
        protected void LinkButton2_Click(object sender, EventArgs e)
        {
            BllQuote           = new EyouSoft.BLL.RouteStructure.Quote();
            ModelRouteTeaminfo = new EyouSoft.Model.RouteStructure.QuoteTeamInfo();

            #region 提交报价信息
            SetQuoteTeamValues();
            #endregion

            #region 报价写入团队计划
            EyouSoft.BLL.TourStructure.Tour           Tour     = new EyouSoft.BLL.TourStructure.Tour();
            EyouSoft.Model.TourStructure.TourTeamInfo TourInfo = new EyouSoft.Model.TourStructure.TourTeamInfo();

            //计调员信息实体
            TourInfo.Coordinator = new EyouSoft.Model.TourStructure.TourCoordinatorInfo();
            //计调员编号
            TourInfo.Coordinator.CoordinatorId = Utils.GetInt(Request.Form[ddl_Oprator.UniqueID]);

            //预计出团时间
            if (Utils.GetDateTimeNullable(Utils.GetFormValue(this.Txt_GroupStarTime.UniqueID)) == null)
            {
                SetErrorMsg(false, "请填写预计出团时间!");
                return;
            }
            TourInfo.LDate = Convert.ToDateTime(Utils.GetString(Utils.GetFormValue(this.Txt_GroupStarTime.UniqueID), ""));

            //人数
            if (Utils.GetInt(Utils.GetFormValue(this.Txt_Numbers.UniqueID.Trim())) <= 0)
            {
                SetErrorMsg(false, "请填写大于0的整数!");
                return;
            }
            else
            {
                TourInfo.PlanPeopleNumber = Utils.GetInt(Utils.GetFormValue(this.Txt_Numbers.UniqueID.Trim()));
            }

            //我社报价总金额
            TourInfo.TotalAmount = this.PriceControl1.TotalAmount;

            //报价发布时间
            TourInfo.CreateTime = System.DateTime.Now;

            if (new EyouSoft.BLL.CompanyStructure.CompanySetting().GetTeamNumberOfPeople(SiteUserInfo.CompanyID) == EyouSoft.Model.EnumType.CompanyStructure.TeamNumberOfPeople.PartNumber)
            {
                TourInfo.TourTeamUnit = new EyouSoft.Model.TourStructure.MTourTeamUnitInfo()
                {
                    NumberCr     = TourInfo.PlanPeopleNumber,
                    NumberEt     = 0,
                    NumberQp     = 0,
                    UnitAmountCr = 0,
                    UnitAmountEt = 0,
                    UnitAmountQp = 0
                };
            }
            else
            {
                TourInfo.TourTeamUnit = null;
            }

            TourInfo.TourType = EyouSoft.Model.EnumType.TourStructure.TourType.团队计划;

            int RouteID   = Utils.GetInt(Request.QueryString["RouteId"]);
            var routeinfo = new EyouSoft.BLL.RouteStructure.Route().GetRouteInfo(RouteID);
            if (routeinfo != null)
            {
                TourInfo.ReleaseType = routeinfo.ReleaseType;
                TourInfo.AreaId      = routeinfo.AreaId;
                TourInfo.RouteName   = routeinfo.RouteName;
                TourInfo.CompanyId   = SiteUserInfo.CompanyID;
                TourInfo.OperatorId  = SiteUserInfo.ID;
                TourInfo.SellerId    = SiteUserInfo.ID;
                TourInfo.RouteId     = RouteID;
                TourInfo.BuyerCId    = Utils.GetInt(Utils.GetFormValue(this.hidCustId.UniqueID));
                TourInfo.BuyerCName  = Utils.GetFormValue(this.Txt_Inquiry.UniqueID);
                //线路天数
                TourInfo.TourDays = routeinfo.RouteDays;
                //团号
                TourInfo.TourCode = TourCode.Value;

                //价格组成
                TourInfo.Services = this.PriceControl1.GetList;

                if (TourInfo.ReleaseType == EyouSoft.Model.EnumType.TourStructure.ReleaseType.Quick)
                {
                    TourInfo.TourQuickInfo = new EyouSoft.Model.TourStructure.TourQuickPrivateInfo()
                    {
                        Remark    = routeinfo.RouteQuickInfo.Remark,
                        QuickPlan = routeinfo.RouteQuickInfo.QuickPlan,
                        Service   = routeinfo.RouteQuickInfo.Service
                    };
                }
                else
                {
                    TourInfo.TourNormalInfo               = new EyouSoft.Model.TourStructure.TourTeamNormalPrivateInfo();
                    TourInfo.TourNormalInfo.Plans         = routeinfo.RouteNormalInfo.Plans;
                    TourInfo.TourNormalInfo.BuHanXiangMu  = routeinfo.RouteNormalInfo.BuHanXiangMu;
                    TourInfo.TourNormalInfo.ErTongAnPai   = routeinfo.RouteNormalInfo.ErTongAnPai;
                    TourInfo.TourNormalInfo.GouWuAnPai    = routeinfo.RouteNormalInfo.GouWuAnPai;
                    TourInfo.TourNormalInfo.NeiBuXingXi   = routeinfo.RouteNormalInfo.NeiBuXingXi;
                    TourInfo.TourNormalInfo.Plans         = routeinfo.RouteNormalInfo.Plans;
                    TourInfo.TourNormalInfo.WenXinTiXing  = routeinfo.RouteNormalInfo.WenXinTiXing;
                    TourInfo.TourNormalInfo.ZhuYiShiXiang = routeinfo.RouteNormalInfo.ZhuYiShiXiang;
                    TourInfo.TourNormalInfo.ZiFeiXIangMu  = routeinfo.RouteNormalInfo.ZiFeiXIangMu;
                }
            }

            if (Utils.GetFormValue(this.hideType.UniqueID) == "update")
            {
                //报价编号
                ModelRouteTeaminfo.QuoteId = Utils.GetInt(Utils.GetQueryStringValue("QuoteID"));
                int QuoteID = BllQuote.UpdateTourTeamQuote(ModelRouteTeaminfo);
                if (QuoteID > 0)
                {
                    TourInfo.QuoteId = QuoteID;
                    if (Tour.InsertTeamTourInfo(TourInfo) > 0)
                    {
                        Utils.ShowAndRedirect("报价信息提交成功!", "/xianlu/Quote.aspx?RouteID=" + Utils.GetQueryStringValue("RouteId") + "&Areaid=" + Utils.GetQueryStringValue("Areaid"));
                    }
                }
                else
                {
                    Utils.ShowAndRedirect("报价信息提交失败!", "/xianlu/Quote.aspx?RouteID=" + Utils.GetQueryStringValue("RouteId") + "&Areaid=" + Utils.GetQueryStringValue("Areaid"));
                }
            }
            else
            {
                int QuoteId = BllQuote.InsertTourTeamQuote(ModelRouteTeaminfo);
                if (QuoteId > 0)
                {
                    TourInfo.QuoteId = QuoteId;
                    int insertTourResult = Tour.InsertTeamTourInfo(TourInfo);
                    if (insertTourResult > 0)
                    {
                        //提示报价完成操作成功
                        Utils.ShowAndRedirect("报价完成操作成功!", "/xianlu/Quote.aspx?areaid=" + Utils.GetQueryStringValue("areaid") + "&RouteID=" + Utils.GetQueryStringValue("RouteId"));
                    }
                }
                else
                {
                    //提示报价完成操作失败
                    Utils.ShowAndRedirect("报价完成操作失败!", "/xianlu/Quote.aspx?areaid=" + Utils.GetQueryStringValue("areaid") + "&RouteID=" + Utils.GetQueryStringValue("RouteId"));
                }
            }

            #endregion
        }