示例#1
0
        /// <summary>
        /// 绑定客户等级
        /// </summary>
        void BindCustomers()
        {
            IList <EyouSoft.Model.CompanyStructure.CustomStand> list = new List <EyouSoft.Model.CompanyStructure.CustomStand>();

            EyouSoft.BLL.CompanyStructure.CompanyCustomStand bll = new CompanyCustomStand();

            list = bll.GetCustomStandByCompanyId(CurrentUserCompanyID);
            rpt_Customer.DataSource = list;
            rpt_Customer.DataBind();
        }
示例#2
0
        /// <summary>
        /// 绑定客户等级
        /// </summary>
        void BindCustomers()
        {
            //List<Customers> list = new List<Customers>();
            //list.Add(new Customers(3, "客户等级"));
            IList <EyouSoft.Model.CompanyStructure.CustomStand> list = new List <EyouSoft.Model.CompanyStructure.CustomStand>();

            EyouSoft.BLL.CompanyStructure.CompanyCustomStand bll = new CompanyCustomStand();
            //int kkk=0;
            list = bll.GetCustomStandByCompanyId(CurrentUserCompanyID);
            rpt_Customer.DataSource = list;
            rpt_Customer.DataBind();
        }
示例#3
0
        /// <summary>
        /// 提交事件
        /// </summary>
        /// <param name="sender"></param>
        /// <param name="e"></param>
        protected void LinkButton1_Click(object sender, EventArgs e)
        {
            #region 基础数据读取

            if (Request.QueryString["act"] == "update")
            {
                actType = 1;
            }
            if (Request.QueryString["act"] == "copy")
            {
                actType = 2;
            }
            IList <EyouSoft.Model.CompanyStructure.CustomStand> listcus = new List <EyouSoft.Model.CompanyStructure.CustomStand>();
            EyouSoft.BLL.CompanyStructure.CompanyCustomStand    bllCom  = new CompanyCustomStand();

            EyouSoft.BLL.TourStructure.Tour       tour = new EyouSoft.BLL.TourStructure.Tour();
            EyouSoft.Model.TourStructure.TourInfo info = new EyouSoft.Model.TourStructure.TourInfo();
            if (actType == 1)
            {
                info = (EyouSoft.Model.TourStructure.TourInfo)tour.GetTourInfo(Utils.GetQueryStringValue("id"));
            }
            listcus = bllCom.GetCustomStandByCompanyId(CurrentUserCompanyID);

            int kkk = listcus.Count;

            string[] st = Utils.GetFormValues("eat");
            info.RouteId          = Utils.GetInt(selectXl.Id);
            info.AreaId           = Utils.GetInt(Utils.GetFormValue(ddl_area.UniqueID));
            info.RouteName        = selectXl.Name;
            info.TourDays         = EyouSoft.Common.Utils.GetInt(Utils.GetFormValue(txt_Days.UniqueID));
            info.PlanPeopleNumber = 1;//EyouSoft.Common.Utils.GetInt(Utils.GetFormValue(txt_pepoleNum.UniqueID));
            info.TourTraffic      = GetSelectTraffic();
            EyouSoft.Model.TourStructure.TourCreateRuleInfo rule = new EyouSoft.Model.TourStructure.TourCreateRuleInfo();
            #region 建团规则
            if (actType == 0 || actType == 2)
            {
                string gz = createTea1.getGuiZe();
                rule.EDate = EyouSoft.Common.Utils.GetDateTime(Utils.GetFromQueryStringByKey(gz, "end"));
                rule.SDate = EyouSoft.Common.Utils.GetDateTime(Utils.GetFromQueryStringByKey(gz, "start"));

                switch (Utils.GetFromQueryStringByKey(gz, "type"))
                {
                case "1":
                {
                    rule.Cycle = Utils.GetFromQueryStringByKey(gz, "data");
                    rule.Rule  = EyouSoft.Model.EnumType.TourStructure.CreateTourRule.星期;
                } break;

                case "2":
                {
                    rule.Cycle = Utils.GetFromQueryStringByKey(gz, "data");
                    rule.Rule  = EyouSoft.Model.EnumType.TourStructure.CreateTourRule.天数;
                } break;

                case "3":
                {
                    rule.SDate = null;
                    rule.EDate = null;
                    rule.Cycle = null;
                    rule.Rule  = EyouSoft.Model.EnumType.TourStructure.CreateTourRule.日期;
                } break;
                }
                info.CreateRule = rule;
            }
            else
            {
            }
            #endregion
            info.LTraffic = txt_startTraffic.Text;
            info.RTraffic = txt_endTraffic.Text;
            IList <EyouSoft.Model.TourStructure.TourLocalAgencyInfo> local;
            local             = DiJieControl1.GetList;
            info.LocalAgencys = local;

            info.CompanyId     = CurrentUserCompanyID;
            info.TourQuickInfo = new EyouSoft.Model.TourStructure.TourQuickPrivateInfo();
            IList <EyouSoft.Model.TourStructure.TourPriceStandardInfo> pricelist = new List <EyouSoft.Model.TourStructure.TourPriceStandardInfo>();
            string[] ddl_price = Utils.GetFormValues("ddl_price");
            for (int k = 0; k < ddl_price.Length; k++)
            {
                EyouSoft.Model.TourStructure.TourPriceStandardInfo price = new EyouSoft.Model.TourStructure.TourPriceStandardInfo();
                price.StandardId   = Utils.GetInt(Utils.GetFormValues("ddl_price")[k].Split('|')[0]);
                price.StandardName = Utils.GetFormValues("ddl_price")[k].Split('|')[1];
                if (ddl_price[k] == "" || price.StandardId == 0)
                {
                    continue;
                }
                IList <EyouSoft.Model.TourStructure.TourPriceCustomerLevelInfo> listLevels = new List <EyouSoft.Model.TourStructure.TourPriceCustomerLevelInfo>();


                string[] crPrice = Utils.GetFormValues("txt_cr_price");


                for (int i = 0; i < kkk; i++)
                {
                    int levId = Utils.GetInt(Utils.GetFormValues("hd_cusStandId")[i]);
                    if (levId == 0)
                    {
                        continue;
                    }
                    EyouSoft.Model.TourStructure.TourPriceCustomerLevelInfo level = new EyouSoft.Model.TourStructure.TourPriceCustomerLevelInfo();
                    level.AdultPrice    = Utils.GetDecimal(Utils.GetFormValues("txt_cr_price")[i + kkk * k]);
                    level.ChildrenPrice = Utils.GetDecimal(Utils.GetFormValues("txt_rt_price")[i + kkk * k]);
                    level.LevelType     = EyouSoft.Model.EnumType.CompanyStructure.CustomLevType.其他;
                    level.LevelName     = Utils.GetFormValues("hd_cusStandName")[i];
                    level.LevelId       = levId;
                    listLevels.Add(level);
                }
                price.CustomerLevels = listLevels;
                pricelist.Add(price);
            }
            IList <EyouSoft.Model.TourStructure.TourPriceCustomerLevelInfo> levelList = new List <EyouSoft.Model.TourStructure.TourPriceCustomerLevelInfo>();
            info.OperatorId     = SiteUserInfo.ID;
            info.PriceStandards = pricelist;
            EyouSoft.Model.TourStructure.TourQuickPrivateInfo qinfo = new EyouSoft.Model.TourStructure.TourQuickPrivateInfo();
            qinfo.QuickPlan    = Utils.EditInputText(txt_xinchen.Text);
            qinfo.Service      = Utils.EditInputText(txt_fuwu.Text);
            qinfo.Remark       = Utils.GetFormValue(txt_remark.UniqueID);
            info.TourQuickInfo = qinfo;

            IList <EyouSoft.Model.TourStructure.TourAttachInfo> listAttachs = new List <EyouSoft.Model.TourStructure.TourAttachInfo>();
            EyouSoft.Model.TourStructure.TourAttachInfo         attInfo     = new EyouSoft.Model.TourStructure.TourAttachInfo();
            string fileAtt    = "";
            string oldfileAtt = "";
            if (EyouSoft.Common.Function.UploadFile.FileUpLoad(FileUpload1.PostedFile, "sanping", out fileAtt, out oldfileAtt))
            {
                attInfo.FilePath = fileAtt;
            }
            else
            {
                EyouSoft.Common.Function.MessageBox.Show(this.Page, "上传附件失败!");
                return;
            }
            if (attInfo.FilePath.Length < 1)
            {
                attInfo.FilePath = hd_img.Value;
            }
            listAttachs.Add(attInfo);

            info.Attachs = listAttachs;
            //info.TourDays = createTea1.getDays();
            info.Coordinator = new EyouSoft.Model.TourStructure.TourCoordinatorInfo();
            info.Coordinator.CoordinatorId = Utils.GetInt(Utils.GetFormValue("sel_oprator"));
            info.TourCityId = Utils.GetInt(Utils.GetFormValue(ddl_city.UniqueID));

            #endregion
            #region 添加
            if (actType == 0 || actType == 2)
            {
                info.ReleaseType  = EyouSoft.Model.EnumType.TourStructure.ReleaseType.Quick;
                info.Status       = EyouSoft.Model.EnumType.TourStructure.TourStatus.正在收客;
                info.TourType     = EyouSoft.Model.EnumType.TourStructure.TourType.散拼计划;
                info.TicketStatus = EyouSoft.Model.EnumType.PlanStructure.TicketState.None;
                IList <EyouSoft.Model.TourStructure.TourChildrenInfo> listChild = new List <EyouSoft.Model.TourStructure.TourChildrenInfo>();
                string[] childTeamNum = Utils.GetFormValue("hidToursNumbers").Split(',');
                string[] tourcodes    = new string[childTeamNum.Length];
                for (int i = 0; i < childTeamNum.Length; i++)
                {
                    ///子团
                    EyouSoft.Model.TourStructure.TourChildrenInfo child = new EyouSoft.Model.TourStructure.TourChildrenInfo();
                    child.TourCode = childTeamNum[i].Split('}')[1];
                    child.LDate    = Utils.GetDateTime(childTeamNum[i].Split('{')[0]);
                    listChild.Add(child);
                    tourcodes[i] = child.TourCode;
                }
                info.Childrens = listChild;

                if (!CheckGrant(TravelPermission.散拼计划_散拼计划_新增计划))
                {
                    Utils.ResponseNoPermit(TravelPermission.散拼计划_散拼计划_新增计划, false);
                }

                IList <string> list_tourCode = tour.ExistsTourCodes(SiteUserInfo.CompanyID, null, tourcodes);
                if (list_tourCode.Count > 0)
                {
                    Response.Write("<script>alert('" + string.Join(",", list_tourCode.ToArray()) + "团号已经存在!');location.href=location.href;</script>");
                    return;
                }
                int ii = tour.InsertTourInfo(info);
                if (ii > 0)
                {
                    Response.Write("<script>alert('添加成功!');location.href='default.aspx';</script>");
                }
            }
            #endregion
            else
            #region 修改
            {
                if (!Utils.PlanIsUpdateOrDelete(info.Status.ToString()))
                {
                    Response.Write("<script>alert('该团已提交财务,不能对它操作!');location.href=location.href;</script>");
                    return;
                }
                info.TourId    = Request.QueryString["id"];
                info.Childrens = null;
                info.TourCode  = txt_teamNum.Value;
                if (!CheckGrant(TravelPermission.散拼计划_散拼计划_修改计划))
                {
                    Utils.ResponseNoPermit(TravelPermission.散拼计划_散拼计划_修改计划, false);
                }

                IList <string> list_tourCode = tour.ExistsTourCodes(SiteUserInfo.CompanyID, info.TourId, info.TourCode);
                if (list_tourCode.Count > 0)
                {
                    Response.Write("<script>alert('团号已经存在!');location.href=location.href;</script>");
                    return;
                }
                int ii = tour.UpdateTourInfo(info);
                if (ii > 0)
                {
                    Response.Write("<script>alert('修改成功!');location.href='default.aspx';</script>");
                }
                else
                {
                    Response.Write("<script>alert('修改失败!');location.href=location.href;</script>");
                }
            }
            #endregion
        }
示例#4
0
        /// <summary>
        /// 绑定所有信息    用于修改或复制
        /// </summary>
        /// <returns></returns>
        void BindAllInfo(string id)
        {
            #region 基础信息绑定
            selectXl.Id   = "1";
            selectXl.Name = "";
            selectXl.Bind();
            EyouSoft.BLL.TourStructure.Tour       tour  = new EyouSoft.BLL.TourStructure.Tour();
            EyouSoft.Model.TourStructure.TourInfo binfo = new EyouSoft.Model.TourStructure.TourInfo();
            binfo = (EyouSoft.Model.TourStructure.TourInfo)tour.GetTourInfo(id.ToString());
            if (binfo.Coordinator != null)
            {
                hdOprator = binfo.Coordinator.CoordinatorId.ToString();
            }
            if (ddl_area.Items.FindByValue(binfo.AreaId.ToString()) != null)
            {
                ddl_area.SelectedItem.Selected = false;
                ddl_area.Items.FindByValue(binfo.AreaId.ToString()).Selected = true;
            }
            selectXl.Name = binfo.RouteName;
            selectXl.Id   = binfo.RouteId.ToString();
            txt_Days.Text = binfo.TourDays.ToString();
            //txt_pepoleNum.Text = binfo.PlanPeopleNumber.ToString();
            TrafficStr = GetTrafficList(binfo.TourTraffic);
            if (actType == 1)
            {
                trgz.Visible      = false;
                trteamNum.Visible = true;
                txt_teamNum.Value = binfo.TourCode;
            }
            txt_startTraffic.Text = binfo.LTraffic;
            txt_endTraffic.Text   = binfo.RTraffic;
            txt_remark.Text       = binfo.TourQuickInfo.Remark;
            DiJieControl1.SetList = binfo.LocalAgencys;
            #region 绑定价格信息
            IList <EyouSoft.Model.TourStructure.TourPriceStandardInfo> listStand = binfo.PriceStandards;


            IList <EyouSoft.Model.CompanyStructure.CustomStand> list = new List <EyouSoft.Model.CompanyStructure.CustomStand>();
            EyouSoft.BLL.CompanyStructure.CompanyCustomStand    bll  = new CompanyCustomStand();

            list = bll.GetCustomStandByCompanyId(CurrentUserCompanyID);
            int kkk = list.Count;
            //for (int i = 0; i < listStand.Count; i++)
            //{
            //    for (int j = 0; j < listStand[i].CustomerLevels.Count; j++)
            //    {
            //        //if(listStand[i].CustomerLevels[i].LevelId == list.sel)
            //        var vn= list.Where(x => x.Id == listStand[i].CustomerLevels[j].LevelId).FirstOrDefault();
            //        if(vn!=null)
            //        listStand[i].CustomerLevels[j].LevelName = vn.CustomStandName;
            //    }
            //}

            //    sinfo = listStand;

            IList <EyouSoft.Model.TourStructure.TourPriceStandardInfo> plist = new List <EyouSoft.Model.TourStructure.TourPriceStandardInfo>();
            plist = binfo.PriceStandards;
            for (int i = 0; i < listStand.Count; i++)
            {
                int cc = listStand[i].CustomerLevels.Count;
                for (int j = 0; j < list.Count; j++)
                {
                    //if(listStand[i].CustomerLevels[i].LevelId == list.sel)
                    if (cc > j)
                    {
                        var vn = list.Where(x => x.Id == listStand[i].CustomerLevels[j].LevelId).FirstOrDefault();
                        if (vn != null)
                        {
                            listStand[i].CustomerLevels[j].LevelName = vn.CustomStandName;
                        }
                        else
                        {
                            //plist[i].CustomerLevels.RemoveAt(j);
                            listStand[i].CustomerLevels[j].LevelId = 0;
                        }
                    }
                    var xn = listStand[i].CustomerLevels.Where(x => x.LevelId == list[j].Id).FirstOrDefault();
                    if (xn == null)
                    {
                        listStand[i].CustomerLevels.Add(new EyouSoft.Model.TourStructure.TourPriceCustomerLevelInfo()
                        {
                            LevelId = list[j].Id, LevelType = list[j].LevType, LevelName = list[j].CustomStandName, AdultPrice = 0, ChildrenPrice = 0
                        });
                    }
                }
            }
            sinfo = plist;
            #endregion
            //List<EyouSoft.Model.TourStructure.TourPlanInfo> planInfo = binfo.TourNormalInfo.Plans.ToList();
            //xingcheng1.Bind(planInfo);
            //ConProjectControl1.SetList = binfo.TourNormalInfo.Services;
            //txt_noProject.Value = binfo.TourNormalInfo.BuHanXiangMu;
            //txt_buy.Value = binfo.TourNormalInfo.GouWuAnPai;
            //txt_child.Value = binfo.TourNormalInfo.ErTongAnPai;
            //txt_owner.Value = binfo.TourNormalInfo.ZiFeiXIangMu;
            //txt_Note.Value = binfo.TourNormalInfo.ZhuYiShiXiang;
            //txt_Reminded.Value = binfo.TourNormalInfo.WenXinTiXing;
            txt_xinchen.Text = binfo.TourQuickInfo.QuickPlan;
            txt_fuwu.Text    = binfo.TourQuickInfo.Service;
            #region 附件
            if (binfo.Attachs.Count > 0)
            {
                if (binfo.Attachs[0].FilePath.Length > 1)
                {
                    pnlFile.Visible         = true;
                    hypFilePath.NavigateUrl = binfo.Attachs[0].FilePath;
                    hd_img.Value            = binfo.Attachs[0].FilePath;
                }
            }
            #endregion
            ddl_city.SelectedItem.Selected = false;

            if (ddl_city.Items.FindByValue(binfo.TourCityId.ToString()) != null)
            {
                ddl_city.Items.FindByValue(binfo.TourCityId.ToString()).Selected = true;
            }
            #endregion
        }
示例#5
0
        /// <summary>
        /// 绑定所有信息    用于修改或复制
        /// </summary>
        /// <returns></returns>
        void BindAllInfo(string id)
        {
            selectXl.Id   = "1";
            selectXl.Name = "";
            selectXl.Bind();
            EyouSoft.BLL.TourStructure.TourEveryday       bl    = new EyouSoft.BLL.TourStructure.TourEveryday(SiteUserInfo);
            EyouSoft.Model.TourStructure.TourEverydayInfo model = new EyouSoft.Model.TourStructure.TourEverydayInfo();
            model = bl.GetTourEverydayInfo(id);

            #region 价格绑定
            IList <EyouSoft.Model.TourStructure.TourPriceStandardInfo> listStand = model.PriceStandards;

            IList <EyouSoft.Model.CompanyStructure.CustomStand> list = new List <EyouSoft.Model.CompanyStructure.CustomStand>();
            EyouSoft.BLL.CompanyStructure.CompanyCustomStand    bll  = new CompanyCustomStand();

            list = bll.GetCustomStandByCompanyId(CurrentUserCompanyID);
            int kkk = list.Count;

            IList <EyouSoft.Model.TourStructure.TourPriceStandardInfo> plist = model.PriceStandards;
            for (int i = 0; i < listStand.Count; i++)
            {
                for (int j = 0; j < list.Count; j++)
                {
                    //if(listStand[i].CustomerLevels[i].LevelId == list.sel)
                    if (listStand[i].CustomerLevels.Count > j)
                    {
                        var vn = list.Where(x => x.Id == listStand[i].CustomerLevels[j].LevelId).FirstOrDefault();
                        if (vn != null)
                        {
                            listStand[i].CustomerLevels[j].LevelName = vn.CustomStandName;
                        }
                        else
                        {
                            listStand[i].CustomerLevels[j].LevelId = 0;
                        }
                        //listStand[i].CustomerLevels.RemoveAt(j);
                    }
                    var xn = listStand[i].CustomerLevels.Where(x => x.LevelId == list[j].Id).FirstOrDefault();
                    if (xn == null)
                    {
                        listStand[i].CustomerLevels.Add(new EyouSoft.Model.TourStructure.TourPriceCustomerLevelInfo()
                        {
                            LevelId = list[j].Id, LevelType = list[j].LevType, LevelName = list[j].CustomStandName, AdultPrice = 0, ChildrenPrice = 0
                        });
                    }
                }
            }
            sinfo = plist;
            #endregion
            #region 基础数据绑定
            //行程
            List <EyouSoft.Model.TourStructure.TourPlanInfo> planInfo = model.TourNormalInfo.Plans.ToList();
            xingcheng1.Bind(planInfo);
            selectXl.Id   = model.RouteId.ToString();
            selectXl.Name = model.RouteName;
            selectXl.Bind();
            ddl_area.SelectedItem.Selected = false;
            ddl_area.Items.FindByValue(model.AreaId.ToString()).Selected = true;
            txt_Days.Text = model.TourDays.ToString();
            ConProjectControl1.SetList = model.TourNormalInfo.Services;
            txt_noProject.Value        = model.TourNormalInfo.BuHanXiangMu;
            txt_buy.Value      = model.TourNormalInfo.GouWuAnPai;
            txt_owner.Value    = model.TourNormalInfo.ZiFeiXIangMu;
            txt_child.Value    = model.TourNormalInfo.ErTongAnPai;
            txt_Note.Value     = model.TourNormalInfo.ZhuYiShiXiang;
            txt_Reminded.Value = model.TourNormalInfo.WenXinTiXing;
            txt_nbinfo.Value   = model.TourNormalInfo.NeiBuXingXi;
            //附件
            if (model.Attachs.Count > 0)
            {
                if (model.Attachs[0].FilePath.Length > 1)
                {
                    pnlFile.Visible         = true;
                    hypFilePath.NavigateUrl = model.Attachs[0].FilePath;
                    hd_img.Value            = model.Attachs[0].FilePath;
                }
            }
            #endregion
        }
示例#6
0
        /// <summary>
        /// 提交数据
        /// </summary>
        /// <param name="sender"></param>
        /// <param name="e"></param>
        protected void lbtn_save_Click(object sender, EventArgs e)
        {
            #region 获取基础数据
            EyouSoft.BLL.TourStructure.TourEveryday       bll   = new EyouSoft.BLL.TourStructure.TourEveryday(SiteUserInfo);
            EyouSoft.Model.TourStructure.TourEverydayInfo model = new EyouSoft.Model.TourStructure.TourEverydayInfo();
            model.AreaId     = Utils.GetInt(Utils.GetFormValue(ddl_area.UniqueID));
            model.CompanyId  = CurrentUserCompanyID;
            model.CreateTime = DateTime.Now;
            model.OperatorId = SiteUserInfo.ID;
            IList <EyouSoft.Model.TourStructure.TourPriceStandardInfo> pricelist = new List <EyouSoft.Model.TourStructure.TourPriceStandardInfo>();

            IList <EyouSoft.Model.CompanyStructure.CustomStand> listcus = new List <EyouSoft.Model.CompanyStructure.CustomStand>();
            EyouSoft.BLL.CompanyStructure.CompanyCustomStand    bllCom  = new CompanyCustomStand();
            listcus = bllCom.GetCustomStandByCompanyId(CurrentUserCompanyID);

            int kkk = listcus.Count;
            for (int k = 0; k < Utils.GetFormValues("ddl_price").Length; k++)
            {
                EyouSoft.Model.TourStructure.TourPriceStandardInfo price = new EyouSoft.Model.TourStructure.TourPriceStandardInfo();
                price.StandardId = Utils.GetInt(Utils.GetFormValues("ddl_price")[k].Split('|')[0]);
                if (price.StandardId == 0)
                {
                    continue;
                }
                price.StandardName = Utils.GetFormValues("ddl_price")[k].Split('|')[1];
                IList <EyouSoft.Model.TourStructure.TourPriceCustomerLevelInfo> listLevels = new List <EyouSoft.Model.TourStructure.TourPriceCustomerLevelInfo>();


                string[] crPrice = Utils.GetFormValues("txt_cr_price");


                for (int i = 0; i < kkk; i++)
                {
                    EyouSoft.Model.TourStructure.TourPriceCustomerLevelInfo level = new EyouSoft.Model.TourStructure.TourPriceCustomerLevelInfo();
                    level.AdultPrice    = Utils.GetDecimal(Utils.GetFormValues("txt_cr_price")[i + kkk * k]);
                    level.ChildrenPrice = Utils.GetDecimal(Utils.GetFormValues("txt_rt_price")[i + kkk * k]);
                    level.LevelType     = EyouSoft.Model.EnumType.CompanyStructure.CustomLevType.其他;
                    level.LevelName     = Utils.GetFormValues("hd_cusStandName")[i];
                    level.LevelId       = Utils.GetInt(Utils.GetFormValues("hd_cusStandId")[i]);
                    if (level.LevelId == 0)
                    {
                        continue;
                    }
                    listLevels.Add(level);
                }
                price.CustomerLevels = listLevels;
                pricelist.Add(price);
            }
            IList <EyouSoft.Model.TourStructure.TourPriceCustomerLevelInfo> levelList = new List <EyouSoft.Model.TourStructure.TourPriceCustomerLevelInfo>();
            model.PriceStandards = pricelist;

            model.ReleaseType = EyouSoft.Model.EnumType.TourStructure.ReleaseType.Normal;
            model.RouteId     = Utils.GetInt(selectXl.Id);
            model.RouteName   = selectXl.Name;
            model.TourDays    = Utils.GetInt(Utils.GetFormValue(txt_Days.UniqueID));
            EyouSoft.Model.TourStructure.TourNormalPrivateInfo privateInfo = new EyouSoft.Model.TourStructure.TourNormalPrivateInfo();
            privateInfo.BuHanXiangMu  = Utils.GetFormValue(txt_noProject.UniqueID);
            privateInfo.ErTongAnPai   = Utils.GetFormValue(txt_child.UniqueID);
            privateInfo.GouWuAnPai    = Utils.GetFormValue(txt_buy.UniqueID);
            privateInfo.NeiBuXingXi   = Utils.GetFormValue(txt_nbinfo.UniqueID);
            privateInfo.Plans         = xingcheng1.GetValues();
            privateInfo.Services      = ConProjectControl1.GetDataList();
            privateInfo.WenXinTiXing  = Utils.GetFormValue(txt_Reminded.UniqueID);
            privateInfo.ZhuYiShiXiang = Utils.GetFormValue(txt_Note.UniqueID);
            privateInfo.ZiFeiXIangMu  = Utils.GetFormValue(txt_owner.UniqueID);
            model.TourNormalInfo      = privateInfo;

            #region 附件

            IList <EyouSoft.Model.TourStructure.TourAttachInfo> listAttachs = new List <EyouSoft.Model.TourStructure.TourAttachInfo>();
            EyouSoft.Model.TourStructure.TourAttachInfo         attInfo     = new EyouSoft.Model.TourStructure.TourAttachInfo();
            string fileAtt    = "";
            string oldfileAtt = "";
            if (EyouSoft.Common.Function.UploadFile.FileUpLoad(FileUpload1.PostedFile, "dayDayPublish", out fileAtt, out oldfileAtt))
            {
                attInfo.FilePath = fileAtt;
            }
            else
            {
                EyouSoft.Common.Function.MessageBox.Show(this.Page, "上传附件失败!");
                return;
            }
            if (attInfo.FilePath.Length < 1)
            {
                attInfo.FilePath = hd_img.Value;
            }
            listAttachs.Add(attInfo);
            model.Attachs = listAttachs;
            #endregion
            #endregion
            #region 数据库修改或添加
            if (Request.QueryString["act"] == "update")
            {
                model.TourId = Utils.GetQueryStringValue("id");
                int i = bll.UpdateTourEverydayInfo(model);
                if (i > 0)
                {
                    EyouSoft.Common.Function.MessageBox.ShowAndRedirect(this.Page, "修改成功!", "DaydayPublish.aspx");
                }
                else
                {
                    EyouSoft.Common.Function.MessageBox.ShowAndRedirect(this.Page, "修改失败!", Request.Url.ToString());
                }
            }
            else
            {
                int i = bll.InsertTourEverydayInfo(model);
                if (i > 0)
                {
                    EyouSoft.Common.Function.MessageBox.ShowAndRedirect(this.Page, "添加成功!", "DaydayPublish.aspx");
                }
                else
                {
                    EyouSoft.Common.Function.MessageBox.ShowAndRedirect(this.Page, "添加失败!", Request.Url.ToString());
                }
            }
            #endregion
        }
示例#7
0
        /// <summary>
        /// 提交事件
        /// </summary>
        /// <param name="sender"></param>
        /// <param name="e"></param>
        protected void lbtn_save_Click(object sender, EventArgs e)
        {
            if (Request.QueryString["act"] == "update")
            {
                actType = 1;
            }
            if (Request.QueryString["act"] == "copy")
            {
                actType = 2;
            }
            #region 基础数据绑定
            IList <EyouSoft.Model.CompanyStructure.CustomStand> listcus = new List <EyouSoft.Model.CompanyStructure.CustomStand>();
            EyouSoft.BLL.CompanyStructure.CompanyCustomStand    bllCom  = new CompanyCustomStand();

            EyouSoft.BLL.TourStructure.Tour       tour = new EyouSoft.BLL.TourStructure.Tour();
            EyouSoft.Model.TourStructure.TourInfo info = new EyouSoft.Model.TourStructure.TourInfo();
            if (actType == 1)
            {
                info = (EyouSoft.Model.TourStructure.TourInfo)tour.GetTourInfo(Utils.GetQueryStringValue("id"));
            }
            listcus = bllCom.GetCustomStandByCompanyId(CurrentUserCompanyID);

            int      kkk = listcus.Count;
            string[] st  = Utils.GetFormValues("eat");
            List <EyouSoft.Model.TourStructure.TourPlanInfo> list = xingcheng1.GetValues();
            info.AreaId           = EyouSoft.Common.Utils.GetInt(Request.Form[ddl_area.UniqueID]);
            info.RouteName        = selectXl.Name;
            info.TourDays         = EyouSoft.Common.Utils.GetInt(txt_Days.Text);
            info.PlanPeopleNumber = 1;//EyouSoft.Common.Utils.GetInt(txt_pepoleNum.Text);
            info.TourTraffic      = GetSelectTraffic();
            EyouSoft.Model.TourStructure.TourCreateRuleInfo rule = new EyouSoft.Model.TourStructure.TourCreateRuleInfo();

            if (actType == 0 || actType == 2)
            {
                string gz = createTea1.getGuiZe();
                rule.EDate = EyouSoft.Common.Utils.GetDateTime(Utils.GetFromQueryStringByKey(gz, "end"));
                rule.SDate = EyouSoft.Common.Utils.GetDateTime(Utils.GetFromQueryStringByKey(gz, "start"));
                switch (Utils.GetFromQueryStringByKey(gz, "type"))
                {
                case "1":
                {
                    rule.Cycle = Utils.GetFromQueryStringByKey(gz, "data");
                    rule.Rule  = EyouSoft.Model.EnumType.TourStructure.CreateTourRule.星期;
                } break;

                case "2":
                {
                    rule.Cycle = Utils.GetFromQueryStringByKey(gz, "data");
                    rule.Rule  = EyouSoft.Model.EnumType.TourStructure.CreateTourRule.天数;
                } break;

                case "3":
                {
                    rule.SDate = null;
                    rule.EDate = null;
                    rule.Cycle = null;
                    rule.Rule  = EyouSoft.Model.EnumType.TourStructure.CreateTourRule.日期;
                } break;
                }
                info.CreateRule = rule;
            }
            #region 出团信息
            info.LTraffic = txt_startTraffic.Text;
            info.RTraffic = txt_endTraffic.Text;
            List <EyouSoft.Model.TourStructure.TourSentPeopleInfo> sentpepole = new List <EyouSoft.Model.TourStructure.TourSentPeopleInfo>();
            string[] strOperId = SelectgroupPepole.OperId.Split(',');
            for (int i = 0; i < strOperId.Length; i++)
            {
                EyouSoft.Model.TourStructure.TourSentPeopleInfo sent = new EyouSoft.Model.TourStructure.TourSentPeopleInfo();
                sent.OperatorId   = Utils.GetInt(strOperId[i]);
                sent.OperatorName = SelectgroupPepole.OperName.Split(',')[i];
                sentpepole.Add(sent);
            }
            info.SentPeoples = sentpepole;
            //string time = txt_jh_date.Text + " " + ddl_jh_date.SelectedValue + ":00:00";
            //info.GatheringTime = Utils.GetDateTimeNullable(time) == null ? string.Empty : time;
            info.GatheringTime  = Utils.GetFormValue(txt_jh_date.UniqueID);
            info.GatheringPlace = txt_jh_area.Text;
            info.GatheringSign  = txt_jh_logo.Text;
            #endregion
            IList <EyouSoft.Model.TourStructure.TourLocalAgencyInfo> local;
            local             = DiJieControl1.GetList;
            info.LocalAgencys = local;

            info.CompanyId = CurrentUserCompanyID;

            IList <EyouSoft.Model.TourStructure.TourPriceStandardInfo> pricelist = new List <EyouSoft.Model.TourStructure.TourPriceStandardInfo>();
            string[] ddl_price = Utils.GetFormValues("ddl_price");
            for (int k = 0; k < ddl_price.Length; k++)
            {
                EyouSoft.Model.TourStructure.TourPriceStandardInfo price = new EyouSoft.Model.TourStructure.TourPriceStandardInfo();
                price.StandardId = Utils.GetInt(Utils.GetFormValues("ddl_price")[k].Split('|')[0]);

                if (ddl_price[k] == "" || price.StandardId == 0)
                {
                    continue;
                }
                price.StandardName = Utils.GetFormValues("ddl_price")[k].Split('|')[1];
                IList <EyouSoft.Model.TourStructure.TourPriceCustomerLevelInfo> listLevels = new List <EyouSoft.Model.TourStructure.TourPriceCustomerLevelInfo>();


                string[] crPrice = Utils.GetFormValues("txt_cr_price");
                for (int i = 0; i < kkk; i++)
                {
                    int levId = Utils.GetInt(Utils.GetFormValues("hd_cusStandId")[i]);
                    if (levId == 0)
                    {
                        continue;
                    }
                    EyouSoft.Model.TourStructure.TourPriceCustomerLevelInfo level = new EyouSoft.Model.TourStructure.TourPriceCustomerLevelInfo();
                    level.AdultPrice    = Utils.GetDecimal(Utils.GetFormValues("txt_cr_price")[i + kkk * k]);
                    level.ChildrenPrice = Utils.GetDecimal(Utils.GetFormValues("txt_rt_price")[i + kkk * k]);
                    level.LevelType     = EyouSoft.Model.EnumType.CompanyStructure.CustomLevType.其他;
                    level.LevelName     = Utils.GetFormValues("hd_cusStandName")[i];
                    level.LevelId       = levId;
                    listLevels.Add(level);
                }
                price.CustomerLevels = listLevels;
                pricelist.Add(price);
            }
            IList <EyouSoft.Model.TourStructure.TourPriceCustomerLevelInfo> levelList = new List <EyouSoft.Model.TourStructure.TourPriceCustomerLevelInfo>();

            info.PriceStandards = pricelist;
            IList <EyouSoft.Model.TourStructure.TourPlanInfo> ilist = new List <EyouSoft.Model.TourStructure.TourPlanInfo>();

            ilist = xingcheng1.GetValues();
            info.TourNormalInfo       = new EyouSoft.Model.TourStructure.TourNormalPrivateInfo();
            info.TourNormalInfo.Plans = ilist;
            IList <EyouSoft.Model.TourStructure.TourAttachInfo> listAttachs = new List <EyouSoft.Model.TourStructure.TourAttachInfo>();
            EyouSoft.Model.TourStructure.TourAttachInfo         attInfo     = new EyouSoft.Model.TourStructure.TourAttachInfo();
            string fileAtt    = "";
            string oldfileAtt = "";
            if (EyouSoft.Common.Function.UploadFile.FileUpLoad(FileUpload1.PostedFile, "sanping", out fileAtt, out oldfileAtt))
            {
                attInfo.FilePath = fileAtt;
            }
            else
            {
                EyouSoft.Common.Function.MessageBox.Show(this.Page, "上传附件失败!");
                return;
            }
            if (attInfo.FilePath.Length < 1)
            {
                attInfo.FilePath = hd_img.Value;
            }
            listAttachs.Add(attInfo);

            info.TourNormalInfo.Services      = ConProjectControl1.GetDataList();
            info.TourNormalInfo.BuHanXiangMu  = txt_noProject.Value;
            info.TourNormalInfo.GouWuAnPai    = txt_buy.Value;
            info.TourNormalInfo.ErTongAnPai   = txt_child.Value;
            info.TourNormalInfo.ZiFeiXIangMu  = txt_owner.Value;
            info.TourNormalInfo.ZhuYiShiXiang = txt_Note.Value;
            info.TourNormalInfo.WenXinTiXing  = txt_Reminded.Value;
            info.Attachs = listAttachs;
            //info.TourDays = createTea1.getDays();
            info.OperatorId = SiteUserInfo.ID;
            info.TourNormalInfo.NeiBuXingXi = Utils.GetFormValue(txt_nbinfo.UniqueID);
            info.Coordinator = new EyouSoft.Model.TourStructure.TourCoordinatorInfo();
            info.Coordinator.CoordinatorId = Utils.GetInt(Utils.GetFormValue("sel_oprator"));
            info.TourCityId = Utils.GetInt(Utils.GetFormValue(ddl_city.UniqueID));

            #endregion
            #region 新增操作
            if (actType == 0 || actType == 2)
            {
                info.ReleaseType  = EyouSoft.Model.EnumType.TourStructure.ReleaseType.Normal;
                info.Status       = EyouSoft.Model.EnumType.TourStructure.TourStatus.正在收客;
                info.TourType     = EyouSoft.Model.EnumType.TourStructure.TourType.散拼计划;
                info.TicketStatus = EyouSoft.Model.EnumType.PlanStructure.TicketState.None;
                IList <EyouSoft.Model.TourStructure.TourChildrenInfo> listChild = new List <EyouSoft.Model.TourStructure.TourChildrenInfo>();
                string[] childTeamNum = Utils.GetFormValue("hidToursNumbers").Split(',');
                string[] tourcodes    = new string[childTeamNum.Length];
                for (int i = 0; i < childTeamNum.Length; i++)
                {
                    ///子团
                    EyouSoft.Model.TourStructure.TourChildrenInfo child = new EyouSoft.Model.TourStructure.TourChildrenInfo();
                    child.TourCode = childTeamNum[i].Split('}')[1];
                    child.LDate    = Utils.GetDateTime(childTeamNum[i].Split('{')[0]);
                    listChild.Add(child);
                    tourcodes[i] = child.TourCode;
                }
                info.Childrens = listChild;

                IList <string> list_tourCode = tour.ExistsTourCodes(SiteUserInfo.CompanyID, null, tourcodes);
                if (list_tourCode.Count > 0)
                {
                    Response.Write("<script>alert('" + string.Join(",", list_tourCode.ToArray()) + "团号已经存在!');location.href=location.href;</script>");
                    return;
                }
                int ii = tour.InsertTourInfo(info);

                if (ii > 0)
                {
                    Response.Write("<script>alert('添加成功!');location.href='default.aspx';</script>");
                }
                else
                {
                    EyouSoft.Common.Function.MessageBox.Show(this.Page, "添加失败!请重试");
                }
            }
            #endregion
            #region 修改操作
            else
            {
                if (!Utils.PlanIsUpdateOrDelete(info.Status.ToString()))
                {
                    Response.Write("<script>alert('该团已提交财务,不能对它操作!');location.href=location.href;</script>");
                    return;
                }
                info.TourId    = Request.QueryString["id"];
                info.Childrens = null;
                info.TourCode  = txt_teamNum.Value;
                IList <string> list_tourCode = tour.ExistsTourCodes(SiteUserInfo.CompanyID, info.TourId, info.TourCode);
                if (list_tourCode.Count > 0)
                {
                    Response.Write("<script>alert('团号已经存在!');location.href=location.href;</script>");
                    return;
                }
                int ii = tour.UpdateTourInfo(info);

                if (ii > 0)
                {
                    Response.Write("<script>alert('修改成功!');location.href='default.aspx';</script>");
                    return;
                }
                else
                {
                    EyouSoft.Common.Function.MessageBox.Show(this.Page, "修改失败!请重试");
                    return;
                }
            }
            #endregion
        }
示例#8
0
        /// <summary>
        /// 绑定所有信息    用于修改或复制
        /// </summary>
        /// <returns></returns>
        void BindAllInfo(string id)
        {
            #region 绑定价格组成begin
            //listComposition = new List<PriceComposition>();
            //List<Customers> listprice = new List<Customers>();
            //listprice.Add(new Customers(1, "门市价", 200, 100));
            //listprice.Add(new Customers(2, "同行价", 300, 150));
            //listprice.Add(new Customers(3, "客户等级", 500, 0));
            //listComposition.Add(new PriceComposition(listprice, 2));
            //listprice = new List<Customers>();
            //listprice.Add(new Customers(1, "门市价", 200, 100));
            //listprice.Add(new Customers(2, "同行价", 300, 100));
            //listprice.Add(new Customers(3, "客户等级", 500, 50));
            //listComposition.Add(new PriceComposition(listprice, 3));
            #endregion
            selectXl.Id   = "1";
            selectXl.Name = "";
            selectXl.Bind();
            EyouSoft.BLL.TourStructure.Tour       tour  = new EyouSoft.BLL.TourStructure.Tour(SiteUserInfo);
            EyouSoft.Model.TourStructure.TourInfo binfo = new EyouSoft.Model.TourStructure.TourInfo();
            binfo = (EyouSoft.Model.TourStructure.TourInfo)tour.GetTourInfo(id);
            if (binfo.Coordinator != null)
            {
                hdOprator = binfo.Coordinator.CoordinatorId.ToString();
            }
            ddl_area.SelectedItem.Selected = false;
            if (ddl_area.Items.FindByValue(binfo.AreaId.ToString()) != null)
            {
                ddl_area.Items.FindByValue(binfo.AreaId.ToString()).Selected = true;
            }
            selectXl.Name = binfo.RouteName;
            selectXl.Id   = binfo.RouteId.ToString();
            txt_Days.Text = binfo.TourDays.ToString();
            //txt_pepoleNum.Text = binfo.PlanPeopleNumber.ToString();
            TrafficStr = GetTrafficList(binfo.TourTraffic);
            if (actType == 1)
            {
                trgz.Visible      = false;
                trteamNum.Visible = true;
                txt_teamNum.Value = binfo.TourCode;
            }
            #region 送团信息
            txt_startTraffic.Text = binfo.LTraffic;
            txt_endTraffic.Text   = binfo.RTraffic;
            txt_jh_logo.Text      = binfo.GatheringSign;
            //if (Utils.GetDateTimeNullable(binfo.GatheringTime) == null)
            //{
            //    txt_jh_date.Text = string.Empty;
            //}
            //else
            //{
            //    string[] a = binfo.GatheringTime.Split(' ');
            //    string[] b = a[1].Split(':');
            //    txt_jh_date.Text = a[0];
            //    ddl_jh_date.SelectedValue = b[0];

            //}
            txt_jh_date.Text           = binfo.GatheringTime;
            txt_jh_area.Text           = binfo.GatheringPlace;
            SelectgroupPepole.OperId   = string.Join(",", binfo.SentPeoples.Select(x => x.OperatorId.ToString()).ToArray());
            SelectgroupPepole.OperName = string.Join(",", binfo.SentPeoples.Select(x => x.OperatorName.ToString()).ToArray());
            #endregion
            DiJieControl1.SetList = binfo.LocalAgencys;

            #region 价格等级
            IList <EyouSoft.Model.TourStructure.TourPriceStandardInfo> listStand = binfo.PriceStandards;

            IList <EyouSoft.Model.CompanyStructure.CustomStand> list = new List <EyouSoft.Model.CompanyStructure.CustomStand>();
            EyouSoft.BLL.CompanyStructure.CompanyCustomStand    bll  = new CompanyCustomStand();

            list = bll.GetCustomStandByCompanyId(CurrentUserCompanyID);
            //int kkk = list.Count;
            //for (int i = 0; i < listStand.Count; i++)
            //{
            //    for (int j = 0; j < list.Count; j++)
            //    {
            //        //if(listStand[i].CustomerLevels[i].LevelId == list.sel)
            //        var vn = list.Where(x => x.Id == listStand[i].CustomerLevels[j].LevelId).FirstOrDefault();
            //        if (vn != null)
            //            listStand[i].CustomerLevels[j].LevelName = vn.CustomStandName;
            //    }
            //}
            IList <EyouSoft.Model.TourStructure.TourPriceStandardInfo> plist = binfo.PriceStandards;
            for (int i = 0; i < listStand.Count; i++)
            {
                for (int j = 0; j < list.Count; j++)
                {
                    //if(listStand[i].CustomerLevels[i].LevelId == list.sel)
                    if (listStand[i].CustomerLevels.Count > j)
                    {
                        var vn = list.Where(x => x.Id == listStand[i].CustomerLevels[j].LevelId).FirstOrDefault();
                        if (vn != null)
                        {
                            listStand[i].CustomerLevels[j].LevelName = vn.CustomStandName;
                        }
                        else
                        {
                            listStand[i].CustomerLevels[j].LevelId = 0;
                        }
                    }
                    var xn = listStand[i].CustomerLevels.Where(x => x.LevelId == list[j].Id).FirstOrDefault();
                    if (xn == null)
                    {
                        listStand[i].CustomerLevels.Add(new EyouSoft.Model.TourStructure.TourPriceCustomerLevelInfo()
                        {
                            LevelId = list[j].Id, LevelType = list[j].LevType, LevelName = list[j].CustomStandName, AdultPrice = 0, ChildrenPrice = 0
                        });
                    }
                }
            }
            sinfo = plist;

            #endregion
            //sinfo = binfo.PriceStandards;
            List <EyouSoft.Model.TourStructure.TourPlanInfo> planInfo = binfo.TourNormalInfo.Plans.ToList();
            xingcheng1.Bind(planInfo);
            ConProjectControl1.SetList = binfo.TourNormalInfo.Services;
            txt_noProject.Value        = binfo.TourNormalInfo.BuHanXiangMu;
            txt_buy.Value      = binfo.TourNormalInfo.GouWuAnPai;
            txt_child.Value    = binfo.TourNormalInfo.ErTongAnPai;
            txt_owner.Value    = binfo.TourNormalInfo.ZiFeiXIangMu;
            txt_Note.Value     = binfo.TourNormalInfo.ZhuYiShiXiang;
            txt_Reminded.Value = binfo.TourNormalInfo.WenXinTiXing;
            txt_nbinfo.Value   = binfo.TourNormalInfo.NeiBuXingXi;
            #region 附件
            if (binfo.Attachs.Count > 0)
            {
                if (binfo.Attachs[0].FilePath.Length > 1)
                {
                    pnlFile.Visible         = true;
                    hypFilePath.NavigateUrl = binfo.Attachs[0].FilePath;
                    hd_img.Value            = binfo.Attachs[0].FilePath;
                }
            }
            #endregion
            ddl_city.SelectedItem.Selected = false;

            if (ddl_city.Items.FindByValue(binfo.TourCityId.ToString()) != null)
            {
                ddl_city.Items.FindByValue(binfo.TourCityId.ToString()).Selected = true;
            }
        }
示例#9
0
        /// <summary>
        /// 修改绑定信息
        /// </summary>
        /// <param name="id"></param>
        void BindAllInfo(string id)
        {
            EyouSoft.BLL.TourStructure.TourEveryday       bl    = new EyouSoft.BLL.TourStructure.TourEveryday(SiteUserInfo);
            EyouSoft.Model.TourStructure.TourEverydayInfo model = new EyouSoft.Model.TourStructure.TourEverydayInfo();
            model = bl.GetTourEverydayInfo(id);
            ddl_area.SelectedItem.Selected = false;
            ddl_area.Items.FindByValue(model.AreaId.ToString()).Selected = true;
            selectXl.Name = model.RouteName;
            selectXl.Id   = model.RouteId.ToString();
            selectXl.Bind();
            txt_Days.Text = model.TourDays.ToString();
            if (model.TourQuickInfo != null)
            {
                txt_xinchen.Text = model.TourQuickInfo.QuickPlan;
                txt_fuwu.Text    = model.TourQuickInfo.Service;
                txt_remark.Text  = model.TourQuickInfo.Remark;
            }

            #region 附件
            if (model.Attachs.Count > 0)
            {
                if (model.Attachs[0].FilePath.Length > 1)
                {
                    pnlFile.Visible         = true;
                    hypFilePath.NavigateUrl = model.Attachs[0].FilePath;
                    hd_img.Value            = model.Attachs[0].FilePath;
                }
            }
            #endregion
            #region 价格绑定
            IList <EyouSoft.Model.TourStructure.TourPriceStandardInfo> listStand = model.PriceStandards;


            IList <EyouSoft.Model.CompanyStructure.CustomStand> list = new List <EyouSoft.Model.CompanyStructure.CustomStand>();
            EyouSoft.BLL.CompanyStructure.CompanyCustomStand    bll  = new CompanyCustomStand();

            list = bll.GetCustomStandByCompanyId(CurrentUserCompanyID);
            int kkk = list.Count;
            IList <EyouSoft.Model.TourStructure.TourPriceStandardInfo> plist = model.PriceStandards;
            for (int i = 0; i < listStand.Count; i++)
            {
                for (int j = 0; j < list.Count; j++)
                {
                    //if(listStand[i].CustomerLevels[i].LevelId == list.sel)
                    if (listStand[i].CustomerLevels.Count > j)
                    {
                        var vn = list.Where(x => x.Id == listStand[i].CustomerLevels[j].LevelId).FirstOrDefault();
                        if (vn != null)
                        {
                            listStand[i].CustomerLevels[j].LevelName = vn.CustomStandName;
                        }
                        else
                        {
                            listStand[i].CustomerLevels[i].LevelId = 0;
                        }
                        //listStand[i].CustomerLevels.RemoveAt(j);
                    }
                    var xn = listStand[i].CustomerLevels.Where(x => x.LevelId == list[j].Id).FirstOrDefault();
                    if (xn == null)
                    {
                        listStand[i].CustomerLevels.Add(new EyouSoft.Model.TourStructure.TourPriceCustomerLevelInfo()
                        {
                            LevelId = list[j].Id, LevelType = list[j].LevType, LevelName = list[j].CustomStandName, AdultPrice = 0, ChildrenPrice = 0
                        });
                    }
                }
            }
            sinfo = plist;
            #endregion
        }
示例#10
0
        /// <summary>
        /// 提交数据
        /// </summary>
        /// <param name="sender"></param>
        /// <param name="e"></param>
        protected void LinkButton1_Click(object sender, EventArgs e)
        {
            EyouSoft.BLL.TourStructure.TourEveryday       bll   = new EyouSoft.BLL.TourStructure.TourEveryday(SiteUserInfo);
            EyouSoft.Model.TourStructure.TourEverydayInfo model = new EyouSoft.Model.TourStructure.TourEverydayInfo();
            #region 基础数据
            model.AreaId     = Utils.GetInt(Utils.GetFormValue(ddl_area.UniqueID));
            model.CompanyId  = CurrentUserCompanyID;
            model.CreateTime = DateTime.Now;
            model.OperatorId = SiteUserInfo.ID;
            IList <EyouSoft.Model.TourStructure.TourPriceStandardInfo> pricelist = new List <EyouSoft.Model.TourStructure.TourPriceStandardInfo>();

            IList <EyouSoft.Model.CompanyStructure.CustomStand> listcus = new List <EyouSoft.Model.CompanyStructure.CustomStand>();
            EyouSoft.BLL.CompanyStructure.CompanyCustomStand    bllCom  = new CompanyCustomStand();
            listcus = bllCom.GetCustomStandByCompanyId(CurrentUserCompanyID);

            int      kkk       = listcus.Count;
            string[] ddl_price = Utils.GetFormValues("ddl_price");
            for (int k = 0; k < ddl_price.Length; k++)
            {
                EyouSoft.Model.TourStructure.TourPriceStandardInfo price = new EyouSoft.Model.TourStructure.TourPriceStandardInfo();
                price.StandardId = Utils.GetInt(ddl_price[k].Split('|')[0]);

                if (ddl_price[k] == "" || price.StandardId == 0)
                {
                    continue;
                }
                price.StandardName = Utils.GetFormValues("ddl_price")[k].Split('|')[1];
                IList <EyouSoft.Model.TourStructure.TourPriceCustomerLevelInfo> listLevels = new List <EyouSoft.Model.TourStructure.TourPriceCustomerLevelInfo>();


                string[] crPrice = Utils.GetFormValues("txt_cr_price");

                for (int i = 0; i < kkk; i++)
                {
                    EyouSoft.Model.TourStructure.TourPriceCustomerLevelInfo level = new EyouSoft.Model.TourStructure.TourPriceCustomerLevelInfo();
                    level.AdultPrice    = Utils.GetDecimal(Utils.GetFormValues("txt_cr_price")[i + kkk * k]);
                    level.ChildrenPrice = Utils.GetDecimal(Utils.GetFormValues("txt_rt_price")[i + kkk * k]);
                    level.LevelType     = EyouSoft.Model.EnumType.CompanyStructure.CustomLevType.其他;
                    level.LevelName     = Utils.GetFormValues("hd_cusStandName")[i];
                    level.LevelId       = Utils.GetInt(Utils.GetFormValues("hd_cusStandId")[i]);
                    if (level.LevelId == 0)
                    {
                        continue;
                    }
                    listLevels.Add(level);
                }
                price.CustomerLevels = listLevels;
                pricelist.Add(price);
            }
            IList <EyouSoft.Model.TourStructure.TourPriceCustomerLevelInfo> levelList = new List <EyouSoft.Model.TourStructure.TourPriceCustomerLevelInfo>();
            model.PriceStandards = pricelist;

            model.ReleaseType = EyouSoft.Model.EnumType.TourStructure.ReleaseType.Quick;
            model.RouteId     = Utils.GetInt(selectXl.Id);
            model.RouteName   = selectXl.Name;
            model.TourDays    = Utils.GetInt(Utils.GetFormValue(txt_Days.UniqueID));
            EyouSoft.Model.TourStructure.TourQuickPrivateInfo privateInfo = new EyouSoft.Model.TourStructure.TourQuickPrivateInfo();
            privateInfo.QuickPlan = Utils.GetFormValue(txt_xinchen.UniqueID);
            privateInfo.Remark    = Utils.GetFormValue(txt_remark.UniqueID);
            privateInfo.Service   = Utils.GetFormValue(txt_fuwu.UniqueID);
            model.TourQuickInfo   = privateInfo;

            #region 附件

            IList <EyouSoft.Model.TourStructure.TourAttachInfo> listAttachs = new List <EyouSoft.Model.TourStructure.TourAttachInfo>();
            EyouSoft.Model.TourStructure.TourAttachInfo         attInfo     = new EyouSoft.Model.TourStructure.TourAttachInfo();
            string fileAtt    = "";
            string oldfileAtt = "";
            if (EyouSoft.Common.Function.UploadFile.FileUpLoad(FileUpload1.PostedFile, "sanping", out fileAtt, out oldfileAtt))
            {
                attInfo.FilePath = fileAtt;
            }
            else
            {
                EyouSoft.Common.Function.MessageBox.Show(this.Page, "上传附件失败!");
                return;
            }
            if (attInfo.FilePath.Length < 1)
            {
                attInfo.FilePath = hd_img.Value;
            }
            listAttachs.Add(attInfo);

            model.Attachs = listAttachs;
            #endregion
            #endregion
            #region 数据库操作
            if (Request.QueryString["act"] == "update")
            {
                model.TourId = Utils.GetQueryStringValue("id");
                int i = bll.UpdateTourEverydayInfo(model);
                if (i > 0)
                {
                    EyouSoft.Common.Function.MessageBox.ShowAndRedirect(this.Page, "修改成功!", "DaydayPublish.aspx");
                }
                else
                {
                    EyouSoft.Common.Function.MessageBox.ShowAndRedirect(this.Page, "修改失败!", Request.Url.ToString());
                }
            }
            else
            {
                int i = bll.InsertTourEverydayInfo(model);
                if (i > 0)
                {
                    EyouSoft.Common.Function.MessageBox.ShowAndRedirect(this.Page, "添加成功!", "DaydayPublish.aspx");
                }
                else
                {
                    EyouSoft.Common.Function.MessageBox.ShowAndRedirect(this.Page, "添加失败!", Request.Url.ToString());
                }
            }
            #endregion
        }