Ejemplo n.º 1
0
Archivo: mSeat.cs Proyecto: itiki/Board
 public mSeatHistory(SeatHistory s)
 {
     Id        = s.id;
     SeatName  = s.seatName;
     Cache     = s.cache;
     StartTime = s.startTime;
     EndTime   = s.endTime;
     UserName  = s.userName;
 }
Ejemplo n.º 2
0
Archivo: mSeat.cs Proyecto: itiki/Board
 public SeatHistory ToDb(SeatHistory upseathis)
 {
     if (!string.IsNullOrEmpty(Cache))
     {
         upseathis.cache = Cache;
     }
     upseathis.seatName = SeatName;
     upseathis.userName = UserName;
     if (StartTime.HasValue)
     {
         upseathis.startTime = StartTime.Value;
     }
     if (EndTime.HasValue)
     {
         upseathis.endTime = EndTime.Value;
     }
     return(upseathis);
 }
Ejemplo n.º 3
0
        public mSeat SeatUpdateByuser(mSeat upseat, int userId)
        {
            Seat seat = seat_repo.Get(d => d.id == upseat.Id);

            upseat.ToDb(seat);
            var seathistory = seathist_repo.GetMulti(d => d.seatName == seat.name && d.endTime == null);

            foreach (SeatHistory item in seathistory)
            {
                item.endTime = DateTime.Now;
            }
            SeatHistory seathist = new SeatHistory {
                seatName  = seat.name,
                startTime = DateTime.Now,
                userName  = user_repo.Get(d => d.id == userId).name,
                cache     = seat.cache
            };

            seathist_repo.Add(seathist);
            SubmitChanges();
            return(new mSeat(seat));
        }
Ejemplo n.º 4
0
        public mSeatHistory SeatHistoryGet(int id)
        {
            SeatHistory seath = seathist_repo.Get(d => d.id == id);

            return(new mSeatHistory(seath));
        }