示例#1
0
        public void Deserialize(string json)
        {
            var deserializedEventList = new SignInEventList();

            using (var ms = new MemoryStream(Encoding.UTF8.GetBytes(json)))
            {
                var serializer = new DataContractJsonSerializer(deserializedEventList.GetType());
                deserializedEventList = serializer.ReadObject(ms) as SignInEventList;
                ms.Close();
            }
            EventList = deserializedEventList.EventList;
        }
示例#2
0
        public SignInEventList GetEventsByNumber(int number)
        {
            SignInEventList ret = new SignInEventList();

            foreach (SignInEvent inEvent in EventList)
            {
                if (inEvent.Number == number)
                {
                    ret.AddMember(inEvent);
                }
            }

            return(ret);
        }
示例#3
0
        public SignInEventList GetEventsByDate(DateTime date)
        {
            SignInEventList ret = new SignInEventList();

            foreach (SignInEvent inEvent in EventList)
            {
                if (inEvent.SignInYear == date.Year && inEvent.SignInMonth == date.Month && inEvent.SignInDate == date.Day)
                {
                    ret.AddMember(inEvent);
                }
            }

            return(ret);
        }
示例#4
0
 /**
  *  Returns true if tracked data is unloaded, returns false otherwise
  */
 public bool TrackAndUnloadNumber(int number, ref SignInEventList unloadList)
 {
     foreach (SignInEvent inEvent in EventList)
     {
         if (inEvent.Number == number)
         {
             inEvent.TrackTime(DateTime.Now);
             unloadList.AddMember(inEvent);
             EventList.Remove(inEvent);
             return(true);
         }
     }
     EventList.Add(new SignInEvent(number, DateTime.Now));
     return(false);
 }
示例#5
0
        public InfoForm(Member member)
        {
            //initialize properties
            Member        = member;
            SignEventList = MainProgram.AppState.SignedOut.GetEventsByNumber(Member.Number);

            //initialize components
            InitializeComponent();

            //set components
            eventList.ListViewItemSorter = eventListSorter;
            updateEventList();

            firstNameSpace.Text = Member.FirstName;
            lastNameSpace.Text  = Member.LastName;
            numberSpace.Text    = "" + Member.Number;
            hoursSpace.Text     = "" + SignEventList.SumTime().TotalHours;
        }