Exemplo n.º 1
0
 private List<DJ_GroupConsumRecord> BindForeast(string groupname, string EntName, string BeginTime, string EndTime)
 {
     List<DJ_Route> ListRoute = BLLDJRoute.GetRouteByAllCondition(groupname, EntName, BeginTime, EndTime, Master.Scenic.Id).ToList();
     List<DJ_GroupConsumRecord> ListRecord = new List<DJ_GroupConsumRecord>();
     foreach (DJ_Route route in ListRoute)
     {
         DJ_GroupConsumRecord record = new DJ_GroupConsumRecord();
         int MaxLiveDay;
         List<DJ_Route> listWroute = bllrecord.GetLiveRouteByDay(out MaxLiveDay, 1, Master.Scenic, route);
         record.LiveDay = MaxLiveDay;
         record.Route = route;
         record.AdultsAmount = route.DJ_TourGroup.AdultsAmount;
         record.ChildrenAmount = route.DJ_TourGroup.ChildrenAmount;
         record.Enterprise = Master.Scenic;
         record.ConsumeTime = route.DJ_TourGroup.BeginDate.AddDays(route.DayNo - 1);
         ListRecord.Add(record);
     }
     return ListRecord;
 }
Exemplo n.º 2
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.º 3
0
    public void BuildDemoDeta()
    {
        //创建工作人员
        SaveWorkers();
         List<DJ_TourGroup> Groups = new List<DJ_TourGroup>();
        for (int i = 1; i <= 12; i++)
        {
            DateTime beginDate = DateTime.Now.AddMonths(i - 12);
            DJ_TourGroup g1 = CreateDemoGroup(beginDate);
            bllGroup.Save(g1);
            DJ_Group_Worker gwmemberdaoyou1 = new DJ_Group_Worker();
            gwmemberdaoyou1.DJ_TourGroup = g1;
            gwmemberdaoyou1.DJ_Workers = memberdaoyou;
            bllGW.Save(gwmemberdaoyou1);

            DJ_TourGroup g2 = new DJ_TourGroup();
            g1.CopyTo(g2);
            g2.DJ_DijiesheInfo =(DJ_DijiesheInfo) demoDjs2;
            g2.DijiesheEditor = (DJ_User_TourEnterprise)new BLLMembership().GetMember(dijiesheAdminAcount2);

           // g2.Workers.Add(memberdaoyou);
            g2.Name = demoGroupNamePrefix + Guid.NewGuid().GetHashCode().ToString().Substring(0, 6);
            DJ_Group_Worker gwmemberdaoyou = new DJ_Group_Worker();
            gwmemberdaoyou.DJ_TourGroup = g2;
            gwmemberdaoyou.DJ_Workers = memberdaoyou2;
           bllGroup.Save(g2);
            bllGW.Save(gwmemberdaoyou);

            Groups.Add(g2);

            Groups.Add(g1);
        }
        //刷卡.验票
        foreach (DJ_TourGroup g in Groups)
        {
            //只对过去的验票.
            if (g.BeginDate> DateTime.Now)
            {
                continue;
            }
            foreach (DJ_Route r in g.Routes)
            {
                Model.DJ_GroupConsumRecord cr = new DJ_GroupConsumRecord();
                cr.Route = r;
                cr.AdultsAmount = r.DJ_TourGroup.AdultsAmount;
                cr.ChildrenAmount = r.DJ_TourGroup.ChildrenAmount;
                cr.ConsumeTime = r.DJ_TourGroup.BeginDate.AddDays(r.DayNo);
                cr.Enterprise = r.Enterprise;
                cr.LiveDay = g.DaysAmount;
                cr.RoomNum = 2;
                bllConsum.DAL.Save(cr);
            }
        }
    }