Ejemplo n.º 1
0
        public void Attend(bool presence, StudingTheSubject pair)
        {
            DateTime  date   = DateTime.Now;
            DataTable result = TableData.SelectByRule("Presence", "StudentProgressDB", new List <string>()
            {
                "StudentID", "PairID", "[Date]"
            }, new List <string>()
            {
                this.Id.ToString(), pair.Id.ToString(), String.Format("{0}.{1}.{2}", date.Date.Month, date.Date.Day, date.Date.Year)
            });

            if (result.Rows.Count != 0)
            {
                throw new Exception("Цього студента вже відмічали!");
            }
            Presence stPresence = new Presence(this.Id, pair.Id, date.Date, presence);
            string   presenceId = stPresence.Id.ToString();
            string   studentId  = stPresence.StudentId.ToString();
            string   pairId     = stPresence.PairId.ToString();
            string   prDate     = String.Format("{0}.{1}.{2}", stPresence.Date.Month, stPresence.Date.Day, stPresence.Date.Year);
            string   presencing = stPresence.Presencing ? "1" : "0";

            TableData.InsertInto("Presence", "StudentProgressDB", new List <string>()
            {
                presenceId, studentId, pairId, prDate, presencing
            }, new List <string>()
            {
                "PresenceID", "StudentID", "PairID", "[Date]", "Presence"
            });
        }
Ejemplo n.º 2
0
 public static void Deserialize()
 {
     Teacher.DeserializeItems();
     Group.DeserializeItems();
     Student.DeserializeItems();
     Subject.DeserializeItems();
     StudingTheSubject.DeserializeItems();
     TimeTable.DeserializeItems();
 }