Example #1
0
        public decimal GetPriceBy(int StandId, int LevelId, bool CorD)
        {
            decimal price = 0;

            for (int i = 0; i < PriceList.Count; i++)
            {
                EyouSoft.Model.TourStructure.TourPriceStandardInfo PriceStand = PriceList[i];
                if (PriceStand.StandardId == StandId)
                {
                    foreach (EyouSoft.Model.TourStructure.TourPriceCustomerLevelInfo CompanyPriceStand in PriceList[i].CustomerLevels)
                    {
                        if (CompanyPriceStand.LevelId == LevelId)
                        {
                            price = CorD ? CompanyPriceStand.AdultPrice : CompanyPriceStand.ChildrenPrice;
                        }
                    }
                }
            }
            return(price);
        }
Example #2
0
        protected void rpt_price_ItemDataBound(object sender, RepeaterItemEventArgs e)
        {
            if (list == null)
            {
                list = new List <EyouSoft.Model.CompanyStructure.CustomStand>();
                EyouSoft.BLL.CompanyStructure.CompanyCustomStand bll = new EyouSoft.BLL.CompanyStructure.CompanyCustomStand();
                int kkk = 0;
                list = bll.GetList(100, 1, ref kkk, CurrentUserCompanyID);
            }
            EyouSoft.Model.TourStructure.TourPriceStandardInfo mm = e.Item.DataItem as EyouSoft.Model.TourStructure.TourPriceStandardInfo;
            Repeater rpt = e.Item.FindControl("rpt_list") as Repeater;

            if (model != null)
            {
                //IList<EyouSoft.Model.TourStructure.TourPriceCustomerLevelInfo> plist = model.PriceStandards[e.Item.ItemIndex].CustomerLevels;


                EyouSoft.BLL.TourStructure.Tour tour = new EyouSoft.BLL.TourStructure.Tour();
                IList <EyouSoft.Model.TourStructure.TourPriceStandardInfo>      listStand = ((EyouSoft.Model.TourStructure.TourInfo)tour.GetTourInfo(Request.QueryString["tourId"])).PriceStandards;
                IList <EyouSoft.Model.TourStructure.TourPriceCustomerLevelInfo> plist     = listStand[e.Item.ItemIndex].CustomerLevels;
                //for (int j = 0; j < ilist.Count; j++)
                //{
                //    //if(listStand[i].CustomerLevels[i].LevelId == list.sel)
                //    if (list != null)
                //    {
                //        var vn = list.Where(x => x.Id == ilist[j].LevelId).FirstOrDefault();
                //        if (vn != null)
                //            ilist[j].LevelName = vn.CustomStandName;
                //    }
                //}
                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.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
                            });
                        }
                    }
                }
                rpt.DataSource = plist;
                rpt.DataBind();
            }
        }
Example #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
        }
Example #4
0
        void SaveInfo()
        {
            xlId = EyouSoft.Common.Utils.GetInt(Request.QueryString["id"]);
            EyouSoft.BLL.RouteStructure.Route       rout  = new EyouSoft.BLL.RouteStructure.Route();
            EyouSoft.Model.RouteStructure.RouteInfo model = rout.GetRouteInfo(xlId);
            EyouSoft.BLL.TourStructure.Tour         tour  = new EyouSoft.BLL.TourStructure.Tour();
            EyouSoft.Model.TourStructure.TourInfo   info  = new EyouSoft.Model.TourStructure.TourInfo();

            IList <EyouSoft.Model.CompanyStructure.CustomStand> listcus = new List <EyouSoft.Model.CompanyStructure.CustomStand>();

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

            int kkk = 0;

            listcus        = bllCom.GetList(100, 1, ref kkk, CurrentUserCompanyID);
            info.AreaId    = model.AreaId;
            info.Attachs   = null;
            info.CompanyId = CurrentUserCompanyID;

            EyouSoft.Model.TourStructure.TourCreateRuleInfo rule = new EyouSoft.Model.TourStructure.TourCreateRuleInfo();
            rule.Cycle = null;
            rule.SDate = null;
            rule.Rule  = EyouSoft.Model.EnumType.TourStructure.CreateTourRule.日期;
            IList <EyouSoft.Model.TourStructure.TourChildrenInfo> childlist = new List <EyouSoft.Model.TourStructure.TourChildrenInfo>();

            string[] childteamnumber = EyouSoft.Common.Utils.GetFormValue("hidToursNumbers").Split(',');
            for (int i = 0; i < childteamnumber.Length; i++)
            {
                EyouSoft.Model.TourStructure.TourChildrenInfo cinfo = new EyouSoft.Model.TourStructure.TourChildrenInfo();
                cinfo.LDate    = EyouSoft.Common.Utils.GetDateTime(childteamnumber[i].Split('{')[0]);
                cinfo.TourCode = childteamnumber[i].Split('}')[1];
                childlist.Add(cinfo);
            }

            info.Childrens = childlist;

            info.LTraffic   = Txt_StartTraffic.Value;
            info.OperatorId = SiteUserInfo.ID;   //用户ID

            info.PlanPeopleNumber = EyouSoft.Common.Utils.GetInt(Txt_PreControlNumber.Value);

            info.Coordinator = new EyouSoft.Model.TourStructure.TourCoordinatorInfo();
            info.Coordinator.CoordinatorId = Utils.GetInt(Utils.GetFormValue("sel_oprator"));

            IList <EyouSoft.Model.TourStructure.TourPriceStandardInfo> pricelist = new List <EyouSoft.Model.TourStructure.TourPriceStandardInfo>();

            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]);
                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]);
                    listLevels.Add(level);
                }
                price.CustomerLevels = listLevels;
                pricelist.Add(price);
            }
            info.PriceStandards = pricelist;
            info.RouteId        = Utils.GetInt(EyouSoft.Common.Utils.GetQueryStringValue("ID"));
            info.RouteName      = model.RouteName;
            info.RTraffic       = Txt_EndTraffic.Value;
            info.Status         = EyouSoft.Model.EnumType.TourStructure.TourStatus.正在收客;

            info.TicketStatus = EyouSoft.Model.EnumType.PlanStructure.TicketState.None;

            model         = rout.GetRouteInfo(info.RouteId);
            info.TourDays = model.RouteDays;

            info.TourType = EyouSoft.Model.EnumType.TourStructure.TourType.散拼计划;
            if (model.ReleaseType == EyouSoft.Model.EnumType.TourStructure.ReleaseType.Normal)
            {
                info.ReleaseType    = model.ReleaseType;
                info.TourNormalInfo = model.RouteNormalInfo;
            }
            else
            {
                info.ReleaseType   = model.ReleaseType;
                info.TourQuickInfo = model.RouteQuickInfo;
            }

            if (tour.InsertTourInfo(info) > 0)
            {
                Response.Write("<script>alert('添加成功!');window.parent.location.href=window.parent.location.href;</script>");
            }
            else
            {
                Response.Write("<script>alert('添加失败!');window.parent.location.href=window.parent.location.href;</script>");
            }
        }
Example #5
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
        }
Example #6
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
        }
Example #7
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
        }