예제 #1
0
        protected void DataModelInti(string id, string planType)
        {
            EyouSoft.BLL.PlanStruture.TravelAgency travelbll = new EyouSoft.BLL.PlanStruture.TravelAgency();
            //travelbll.GetTravelModel("");
            EyouSoft.Model.PlanStructure.LocalTravelAgencyInfo travelModel = travelbll.GetTravelModel(id);

            if (travelModel != null)
            {
                //地接社名称
                this.txtDiJieName.Text = travelModel.LocalTravelAgency;
                //地接社编号
                this.hideDiJieID.Value = travelModel.TravelAgencyID.ToString();
                //获得地接社的返利

                EyouSoft.Model.CompanyStructure.CompanySupplier djModel = new EyouSoft.BLL.CompanyStructure.CompanySupplier().GetModel(travelModel.TravelAgencyID, SiteUserInfo.CompanyID);
                if (djModel != null)
                {
                    this.hideCommission.Value = djModel.Commission.ToString("0.00");
                }

                //联系人
                this.txtContact.Text = travelModel.Contacter;
                //电话
                this.txtPhone.Text = travelModel.ContactTel;
                //接团时间
                this.txtBeginTime.Text = travelModel.ReceiveTime.ToString("yyyy-MM-dd");
                //送团时间
                this.txtEndTime.Text = travelModel.DeliverTime.ToString("yyyy-MM-dd");
                //接待行程
                IList <EyouSoft.Model.PlanStructure.LocalAgencyTourPlanInfo> tourList = travelModel.LocalAgencyTourPlanInfoList;
                //设置选中
                if (travelModel.LocalAgencyTourPlanInfoList != null && travelModel.LocalAgencyTourPlanInfoList.Count > 0)
                {
                    for (int i = 0; i < travelModel.LocalAgencyTourPlanInfoList.Count; i++)
                    {
                        this.hideXingCheng.Value += travelModel.LocalAgencyTourPlanInfoList[i].Days + ",";
                    }
                }
                //判断 价格组成 为A or B
                IList <EyouSoft.Model.PlanStructure.TravelAgencyPriceInfo> priceList = travelModel.TravelAgencyPriceInfoList;
                this.rptProjectB.DataSource = priceList;
                this.rptProjectB.DataBind();

                this.rptProjectA.DataSource = priceList;
                this.rptProjectA.DataBind();

                //团款
                this.txtTeamPrice.Text = travelModel.Fee.ToString("0.00");
                //返款
                this.txtBackPrice.Text = travelModel.Commission.ToString("0.00");
                //结算费用
                this.txtSettlePrice.Text = travelModel.Settlement.ToString("0.00");
                //支付方式
                DdlPayListInit(Convert.ToInt32(travelModel.PayType).ToString());
                //地接社须知
                this.txtNotes.Text = travelModel.Notice;
                //备注
                this.txtRemarks.Text = travelModel.Remark;
            }
        }
예제 #2
0
        protected void rpt_area_ItemDataBound(object sender, RepeaterItemEventArgs e)
        {
            EyouSoft.Model.PlanStructure.LocalTravelAgencyInfo item         = e.Item.DataItem as EyouSoft.Model.PlanStructure.LocalTravelAgencyInfo;
            EyouSoft.BLL.CompanyStructure.CompanySupplier      bll          = new EyouSoft.BLL.CompanyStructure.CompanySupplier();
            EyouSoft.Model.CompanyStructure.CompanySupplier    companyModel = bll.GetModel(item.TravelAgencyID, CurrentUserCompanyID);
            Literal lt_cName = e.Item.FindControl("lt_cName") as Literal;
            Literal lt_cTel  = e.Item.FindControl("lt_cTel") as Literal;
            Literal lt_cFax  = e.Item.FindControl("lt_cFax") as Literal;

            if (companyModel != null && companyModel.SupplierContact.Count > 0)
            {
                lt_cName.Text = companyModel.SupplierContact[0].ContactName;
                lt_cTel.Text  = companyModel.SupplierContact[0].ContactTel;
                lt_cFax.Text  = companyModel.SupplierContact[0].ContactFax;
            }
        }
예제 #3
0
        protected void btnSave_Click(object sender, EventArgs e)
        {
            //地接社名称
            string diJieName = Utils.GetFormValue(this.txtDiJieName.UniqueID);
            //地接社ID
            string diJieId = Utils.GetFormValue(this.hideDiJieID.UniqueID);
            //联系人
            string contact = Utils.GetFormValue(this.txtContact.UniqueID);
            //电话
            string phone = Utils.GetFormValue(this.txtPhone.UniqueID);
            //接团时间
            DateTime?benginTime = Utils.GetDateTimeNullable(this.txtBeginTime.Text);
            //送团时间
            DateTime?endTime = Utils.GetDateTimeNullable(this.txtEndTime.Text);

            //接待行程
            string[] travel = Utils.GetFormValues("cbxTravel");

            #region 价格项目1
            //项目
            string[] sltProjectArray = Utils.GetFormValues("sltProject");
            //具体要求
            string[] Claim = Utils.GetFormValues("txtClaim");
            //价格项目
            string[] proPrice = Utils.GetFormValues("txtProPrice");
            #endregion

            #region 价格项目2
            //价格项目
            string[] pricePro = Utils.GetFormValues("txtPricePro");
            //备注
            string[] bak = Utils.GetFormValues("txtBak");
            //单人价格
            string[] onePrice = Utils.GetFormValues("txtOnePrice");
            //人数
            string[] peopleCount = Utils.GetFormValues("txtPeoCount");
            #endregion

            //团款
            decimal teamPrice = Utils.GetDecimal(this.txtTeamPrice.Text, 0);
            //反款
            decimal backPrice = Utils.GetDecimal(this.txtBackPrice.Text, 0);
            //结算费用
            decimal settlePrice = Utils.GetDecimal(this.txtSettlePrice.Text, 0);
            //支付类型
            string payType = Utils.GetFormValue(this.dllPayType.UniqueID);
            //地接社需知
            string notes = this.txtNotes.Text.Trim();
            //备注
            string remarks = this.txtRemarks.Text.Trim();

            #region 验证
            //地接社名 不能为空
            if (diJieName.TrimEnd() == "")
            {
                Utils.ShowAndRedirect("请选择地接社!", Request.Url.ToString());
                return;
            }
            //结算费用 不能为空
            if (this.txtSettlePrice.Text.Trim() == "")
            {
                Utils.ShowAndRedirect("请输入结算费用!", Request.Url.ToString());
                return;
            }


            EyouSoft.BLL.PlanStruture.TravelAgency travelbll = new EyouSoft.BLL.PlanStruture.TravelAgency();
            //声明对象model
            EyouSoft.Model.PlanStructure.LocalTravelAgencyInfo travelModel = null;
            //判断如果是修改 则getmodel 反之 new 一个新的对象
            if (this.hideDoType.Value == "Update")
            {
                travelModel = travelbll.GetTravelModel(this.hideId.Value);
            }
            else
            {
                travelModel = new EyouSoft.Model.PlanStructure.LocalTravelAgencyInfo();
            }
            if (travelModel != null)
            {
                //地接ID
                travelModel.TravelAgencyID = Utils.GetInt(this.hideDiJieID.Value);
                //地接名称
                travelModel.LocalTravelAgency = diJieName;
                //联系人
                travelModel.Contacter = contact;
                //联系电话
                travelModel.ContactTel = phone;
                //接团时间
                travelModel.ReceiveTime = Convert.ToDateTime(benginTime);
                //送团时间
                travelModel.DeliverTime = Convert.ToDateTime(endTime);
                //行程接待
                IList <EyouSoft.Model.PlanStructure.LocalAgencyTourPlanInfo> planList = new List <EyouSoft.Model.PlanStructure.LocalAgencyTourPlanInfo>();
                if (this.hidePlanType.Value == "Quick")
                {
                    this.pnlJieDai.Visible = false;
                }
                else
                {
                    if (travel != null && travel.Length > 0)
                    {
                        for (int i = 0; i < travel.Length; i++)
                        {
                            EyouSoft.Model.PlanStructure.LocalAgencyTourPlanInfo localTourModel = new EyouSoft.Model.PlanStructure.LocalAgencyTourPlanInfo();
                            localTourModel.Days          = (i + 1);
                            localTourModel.LocalTravelId = this.hideDiJieID.Value;
                            planList.Add(localTourModel);
                        }
                    }
                }
                //价格组成
                if (hideTypeAorB.Value == "B")                                                                                                                         //B类
                {
                    if (sltProjectArray != null && Claim != null && proPrice != null && sltProjectArray.Count() == Claim.Count() && Claim.Count() == proPrice.Count()) //判断数组count 是否一致
                    {
                        IList <EyouSoft.Model.PlanStructure.TravelAgencyPriceInfo> tList = new List <EyouSoft.Model.PlanStructure.TravelAgencyPriceInfo>();
                        for (int i = 0; i < sltProjectArray.Count(); i++)
                        {
                            //声明价格组成model
                            EyouSoft.Model.PlanStructure.TravelAgencyPriceInfo tModel = new EyouSoft.Model.PlanStructure.TravelAgencyPriceInfo();
                            //B类实体赋值
                            tModel.PriceTpyeAorB = EyouSoft.Model.EnumType.CompanyStructure.PriceComponent.分项报价;
                            tModel.PriceTpyeId   = (EyouSoft.Model.EnumType.TourStructure.ServiceType)Enum.Parse(typeof(EyouSoft.Model.EnumType.TourStructure.ServiceType), sltProjectArray[i]);
                            tModel.Remark        = Claim[i];
                            tModel.ReferenceID   = this.hideDiJieID.Value;
                            tModel.Price         = Utils.GetDecimal(proPrice[i]);
                            // tModel.ID = travelModel.ID;
                            tList.Add(tModel);
                        }
                        travelModel.TravelAgencyPriceInfoList = tList;
                    }
                }
                else  //A类
                {
                    if (pricePro != null && bak != null && onePrice != null && peopleCount != null && pricePro.Count() == bak.Count() && pricePro.Count() == onePrice.Count() && pricePro.Count() == peopleCount.Count())
                    {
                        IList <EyouSoft.Model.PlanStructure.TravelAgencyPriceInfo> tList = new List <EyouSoft.Model.PlanStructure.TravelAgencyPriceInfo>();
                        for (int i = 0; i < pricePro.Count(); i++)
                        {
                            //声明价格组成model
                            EyouSoft.Model.PlanStructure.TravelAgencyPriceInfo tModel = new EyouSoft.Model.PlanStructure.TravelAgencyPriceInfo();
                            //A类实体赋值
                            tModel.PriceTpyeAorB = EyouSoft.Model.EnumType.CompanyStructure.PriceComponent.统一报价;
                            tModel.Title         = pricePro[i];
                            tModel.Remark        = bak[i];
                            tModel.Price         = Utils.GetDecimal(onePrice[i]);
                            tModel.PeopleCount   = Utils.GetInt(peopleCount[i]);
                            tList.Add(tModel);
                        }
                        travelModel.TravelAgencyPriceInfoList = tList;
                    }
                }
                //团款
                travelModel.Fee = teamPrice;
                //反款
                travelModel.Commission = backPrice;
                //结算费用
                travelModel.Settlement = settlePrice;
                //支付类型
                travelModel.PayType = (EyouSoft.Model.EnumType.TourStructure.RefundType)Enum.Parse(typeof(EyouSoft.Model.EnumType.TourStructure.RefundType), payType);
                //地接社需知
                travelModel.Notice = notes;
                //行程接待
                travelModel.LocalAgencyTourPlanInfoList = planList;
                //备注
                travelModel.Remark = remarks;
                //公司ID
                travelModel.CompanyId = SiteUserInfo.CompanyID;

                travelModel.TourId = this.hidePlanId.Value;

                travelModel.OperateTime = DateTime.Now;

                travelModel.OperatorID = SiteUserInfo.ID;

                travelModel.Operator = SiteUserInfo.ContactInfo.ContactName;

                if (this.hideDoType.Value == "Update")
                {
                    travelModel.OperateTime = DateTime.Now;
                    if (travelbll.UpdateTravelAgency(travelModel))
                    {
                        Utils.ShowAndRedirect("修改成功!", Request.Url.ToString());
                        return;
                    }
                    else
                    {
                        Utils.ShowAndRedirect("修改失败!", Request.Url.ToString());
                        return;
                    }
                }
                else
                {
                    //add model
                    if (travelbll.AddTravel(travelModel))
                    {
                        Utils.ShowAndRedirect("新增成功!", Request.Url.ToString());
                        return;
                    }
                    else
                    {
                        Utils.ShowAndRedirect("新增失败!", Request.Url.ToString());
                        return;
                    }
                }
            }

            #endregion
        }
예제 #4
0
        protected void DataListInitfirst(string tourid)
        {
            if (tourid != null)
            {
                //地接的操作BLL
                EyouSoft.BLL.PlanStruture.TravelAgency             travelbll   = new EyouSoft.BLL.PlanStruture.TravelAgency();
                EyouSoft.Model.PlanStructure.LocalTravelAgencyInfo travelModel = new EyouSoft.Model.PlanStructure.LocalTravelAgencyInfo();
                //获得该计划下的所有地接的集合
                IList <EyouSoft.Model.PlanStructure.LocalTravelAgencyInfo> list = travelbll.GetList(tourid);
                travelModel = travelbll.GetTravelModel(list[0].ID);
                if (travelModel != null)
                {
                    //地接社名称
                    this.LitDjName.Text = travelModel.LocalTravelAgency;
                    //地接社编号
                    this.hideDiJieID.Value = travelModel.TravelAgencyID.ToString();
                    //获得地接社的返利
                    EyouSoft.Model.CompanyStructure.CompanySupplier djModel = new EyouSoft.BLL.CompanyStructure.CompanySupplier().GetModel(travelModel.TravelAgencyID, SiteUserInfo.CompanyID);
                    if (djModel != null)
                    {
                        this.hideCommission.Value = djModel.Commission.ToString("0.00");
                    }
                    //联系人
                    this.LitName.Text = travelModel.Contacter;
                    //电话
                    this.LitPhone.Text = travelModel.ContactTel;
                    //接团时间
                    this.LitBeginTime.Text = travelModel.ReceiveTime.ToString("yyyy-MM-dd");
                    //送团时间
                    this.LitEndTime.Text = travelModel.DeliverTime.ToString("yyyy-MM-dd");

                    //接待行程
                    IList <EyouSoft.Model.PlanStructure.LocalAgencyTourPlanInfo> tourList = travelModel.LocalAgencyTourPlanInfoList;
                    //设置选中
                    if (travelModel.LocalAgencyTourPlanInfoList != null && travelModel.LocalAgencyTourPlanInfoList.Count > 0)
                    {
                        for (int i = 0; i < travelModel.LocalAgencyTourPlanInfoList.Count; i++)
                        {
                            this.hideXingCheng.Value += travelModel.LocalAgencyTourPlanInfoList[i].Days + ",";
                        }
                    }

                    //判断 价格组成 为A or B
                    IList <EyouSoft.Model.PlanStructure.TravelAgencyPriceInfo> priceList = travelModel.TravelAgencyPriceInfoList;
                    this.rptProjectB.DataSource = priceList;
                    this.rptProjectB.DataBind();

                    this.rptProjectA.DataSource = priceList;
                    this.rptProjectA.DataBind();

                    //团款
                    this.litTeamPrice.Text = travelModel.Fee.ToString("0.00");
                    //返款
                    this.litBackPrice.Text = travelModel.Commission.ToString("0.00");
                    //结算费用
                    this.litSettlePrice.Text = travelModel.Settlement.ToString("0.00");
                    //支付方式
                    this.litPayType.Text = travelModel.PayType.ToString();
                    //地接社须知
                    this.litNotes.Text = travelModel.Notice;
                    //备注
                    this.litRemarks.Text = travelModel.Remark;
                }
            }
        }