Exemplo n.º 1
0
        public IList<DJ_ProductRoute> CreateRouteFromNameList(int dayNo, Dictionary<EnterpriseType, IList<string>> entDicts, out string errMsg)
        {
            IList<DJ_ProductRoute> routes = new List<DJ_ProductRoute>();
            errMsg = string.Empty;

            foreach (EnterpriseType type in entDicts.Keys)
            {
               IList<string> entNames = entDicts[type];

                foreach (string entName in entNames)
                {
                    if (string.IsNullOrEmpty(entName)) continue;
                    DJ_TourEnterprise ent = bllEnt.GetEntByName(entName);
                    if (ent == null)
                    {
                        ///创建新企业,只有名称
                        // errMsg = "企业名称有误:" + entName;
                        ent = new DJ_TourEnterprise();
                        ent.Name = entName;
                        ent.Type = type;

                        // continue;
                    }
                    DJ_Route newRoute = new DJ_Route();
                    newRoute.DayNo = dayNo;

                    newRoute.Enterprise = ent;
                    newRoute.RD_EnterpriseName = entName;
                    routes.Add(newRoute);
                }
            }
            return routes;
        }
Exemplo n.º 2
0
 protected void Page_Load(object sender, EventArgs e)
 {
     string strParam = Request["rid"];
     string strParamProduct = Request["pid"];
     Guid routeId;
     Guid productId;
     if (!Guid.TryParse(strParamProduct, out productId))
     {
         ErrHandler.Redirect(ErrType.ParamIllegal);
     }
     if (Guid.TryParse(strParam, out routeId))
     {
         CurrentRoute = bllRoute.GetById(routeId);
         CurrentProduct = bllProduct.GetById(productId);
     }
     else
     {
         IsNew = true;
     }
     if (!IsPostBack)
     {
         if (!IsNew)
         {
             LoadForm();
         }
     }
 }
Exemplo n.º 3
0
 public static DJ_Route GenerateRoute()
 {
     DJ_Route route = new DJ_Route();
     route.DayNo = 1;
     //route.
     return null;
 }
Exemplo n.º 4
0
        public static List<DJ_Route> ConvertToModel(DJ_TourGroup group, IList<UIRoute> uiRoutes, out string errMsg)
        {
            errMsg = string.Empty;
            BLLDJEnterprise bllEnt = new BLLDJEnterprise();
            List<DJ_Route> routes = new List<DJ_Route>();

            foreach (UIRoute uiroute in uiRoutes)
            {
                int dayNo = uiroute.DayNo;
                IList<DJ_TourEnterprise> scenics = uiroute.Scenics;
                IList<DJ_TourEnterprise> hotels = uiroute.Hotels;

                IList<DJ_TourEnterprise> enterprises = scenics.Concat(hotels).ToList();
                foreach (DJ_TourEnterprise ent in enterprises)
                {

                    DJ_Route route = new DJ_Route();
                    route.Enterprise = ent;
                    route.DayNo = dayNo;
                    route.DJ_TourGroup = group;
                    routes.Add(route);
                }
            }
            return routes;
        }
Exemplo n.º 5
0
 public virtual void CopyTo(DJ_Route newRoute)
 {
     newRoute.DayNo = DayNo;
     newRoute.Enterprise = Enterprise;
     newRoute.Description = Description;
     newRoute.RD_EnterpriseName = RD_EnterpriseName;
 }
Exemplo n.º 6
0
        public void RedundancyTest()
        {
            DJ_TourEnterprise ent = Builder<DJ_TourEnterprise>.CreateNew().With(x => x.Name = "EntOriginal").Build();
             DJ_Route r = new DJ_Route();
             r.Enterprise = ent;
             r.RD_EnterpriseName = "EntOriginal";

             ent.Name = "EntModified";

             Assert.AreEqual(ent.Name,r.Enterprise.Name);
             Assert.AreEqual("EntOriginal", r.RD_EnterpriseName);
        }
Exemplo n.º 7
0
 public virtual void CopyToGroup(DJ_TourGroup group)
 {
     group.Routes.Clear();
     foreach (DJ_ProductRoute pr in Routes)
     {
         DJ_Route r = new DJ_Route();
         r.DJ_TourGroup = group;
         r.DayNo = pr.DayNo;
         r.Description = pr.Description;
         r.Enterprise = pr.Enterprise;
         r.RD_EnterpriseName = pr.RD_EnterpriseName;
         group.Routes.Add(r);
     }
 }
Exemplo n.º 8
0
 public void Save(DJ_TourEnterprise Enterprise, DJ_Route route, DateTime consumtime, int AdultsAmount, int ChildrenAmount, int LiveDay, int roomNum, int AppendBed)
 {
     DJ_GroupConsumRecord dj_group = new DJ_GroupConsumRecord();
     dj_group.AdultsAmount = AdultsAmount;
     dj_group.ChildrenAmount = ChildrenAmount;
     dj_group.ConsumeTime = consumtime;
     dj_group.Enterprise = Enterprise;
     dj_group.Route = route;
     dj_group.LiveDay = LiveDay;
     dj_group.RoomNum = roomNum;
     dj_group.No = "Lv" + new Random((int)DateTime.Now.Ticks).Next(100000, 999999);
     dj_group.AppendBed = AppendBed;
     if (IDjgroup.GetGroupConsumRecordByRouteId(route.Id) == null)
         IDjgroup.Save(dj_group);
 }
Exemplo n.º 9
0
 /// <summary>
 /// 获得需求天数的route
 /// </summary>
 /// <param name="MaxLiveDay">最大的天数</param>
 /// <param name="WLiveDay">需求的天数</param>
 /// <param name="ent">住宿企业</param>
 /// <param name="route">行程信息</param>
 /// <returns>route的List</returns>
 public List<Model.DJ_Route> GetLiveRouteByDay(out int MaxLiveDay, int WLiveDay, DJ_TourEnterprise ent, DJ_Route route)
 {
     List<Model.DJ_Route> ListRoute = new List<DJ_Route>();
     MaxLiveDay = 0;
     if (WLiveDay > 0)
     {
         for (int i = route.DayNo; ; i++)
         {
             List<DJ_Route> list = new BLLDJRoute().GetRouteByDayNoandGroupid(i, route.DJ_TourGroup.Id, route.Enterprise.Id).ToList();
             if (list.Count > 0)
             {
                 ListRoute.AddRange(list);
             }
             else
             {
                 MaxLiveDay = i - route.DayNo;
                 break;
             }
         }
     }
     return ListRoute;
 }
Exemplo n.º 10
0
        public virtual void CopyTo(DJ_TourGroup newGroup, bool copyMember)
        {
            newGroup.Name = Name + "[复制]";
            newGroup.BeginDate = BeginDate;
            newGroup.DaysAmount = DaysAmount;
            newGroup.EndDate = BeginDate.AddDays(DaysAmount - 1);
            newGroup.DijiesheEditor = DijiesheEditor;
            newGroup.DJ_DijiesheInfo = DJ_DijiesheInfo;
            foreach (DJ_Route r in Routes)
            {
                DJ_Route newRoute = new DJ_Route();
                r.CopyTo(newRoute);
                newRoute.DJ_TourGroup = newGroup;
                newGroup.Routes.Add(newRoute);
            }
            //foreach (DJ_Group_Worker worker in Workers)
            //{
            //    newGroup.Workers.Add(worker);
            //}
            if (copyMember)
            {
                foreach (DJ_TourGroupMember member in Members)
                {
                    DJ_TourGroupMember newMember = new DJ_TourGroupMember();
                    member.CopyTo(newMember);
                    newGroup.Members.Add(newMember);

                }
            }
        }
Exemplo n.º 11
0
    private DJ_TourGroup CreateDemoGroup(DateTime beginTime)
    {
        DJ_TourGroup group = new DJ_TourGroup();
        group.BeginDate = beginTime;
        group.DJ_DijiesheInfo = (Model.DJ_DijiesheInfo)demoDjs1;

        group.DaysAmount =2;
        group.EndDate = beginTime.AddDays(group.DaysAmount);

        DJ_TourGroupMember member1 = new DJ_TourGroupMember();
        member1.DJ_TourGroup = group;
        member1.IdCardNo = "210905197807210546";
        member1.MemberType = MemberType.成;
        member1.PhoneNum = "13280008000";
        member1.RealName = "张三";

        DJ_TourGroupMember member2 = new DJ_TourGroupMember();
        member2.DJ_TourGroup = group;
        member2.IdCardNo = "210905197807210546";
        member2.MemberType = MemberType.儿;
        member2.PhoneNum = "13280008000";
        member2.RealName = "张小明";

        DJ_TourGroupMember member3 = new DJ_TourGroupMember();
        member3.DJ_TourGroup = group;
        member3.SpecialCardNo = "证件号:HK0930234";
        member3.MemberType = MemberType.港澳台;
        member3.PhoneNum = "13280008000";
        member3.RealName = "张学友";

        DJ_TourGroupMember member4 = new DJ_TourGroupMember();
        member4.DJ_TourGroup = group;
        member4.SpecialCardNo = "证件号:019203493l";
        member4.MemberType = MemberType.外;
        member4.PhoneNum = "13280008000";
        member4.RealName = "Carl Smith";

          //  group.Workers.Add(gwmembersiji);
           // group.Workers.Add(gwmemberdaoyou);
        group.Members.Add(member1);
        group.Members.Add(member2);
        group.Members.Add(member3);
        group.Members.Add(member4);

        group.Name = demoGroupNamePrefix+ Math.Abs(Guid.NewGuid().GetHashCode()).ToString().Substring(0, 6);

        DJ_Route route1 = new DJ_Route();
        route1.DayNo = 1;
        route1.Description = "住宿";
        route1.DJ_TourGroup = group;
        route1.Enterprise = demoHotel1;

        DJ_Route route11 = new DJ_Route();
        route11.DayNo = 1;
        route11.Description = "景点";
        route11.DJ_TourGroup = group;
        route11.Enterprise = demoScenic1;

        DJ_Route route111 = new DJ_Route();
        route111.DayNo = 1;
        route111.Description = "景点";
        route111.DJ_TourGroup = group;
        route111.Enterprise = demoScenic2;

        DJ_Route route2 = new DJ_Route();
        route2.DayNo = 2;
        route2.Description = "景点";
        route2.DJ_TourGroup = group;
        route2.Enterprise = demoScenic3;
        //group.Routes

        group.Routes.Add(route1);
        group.Routes.Add(route2);
        group.Routes.Add(route11);
        group.Routes.Add(route111);

        group.DijiesheEditor =(DJ_User_TourEnterprise) new BLLMembership().GetMember(dijiesheAdminAcount1);
        return group;
    }