Example #1
0
        public Calendar getItemByIDS(int _idTeacher, int _idPupil, int _day)
        {
            DBWorker.dbCalendar dbItem = DBWCal.getItemByIDSFromDB(_idTeacher, _idPupil, ++_day);

            Calendar Item = new Calendar();

            Item.idTeacher = dbItem.idTeacher;
            Item.idPupil   = dbItem.idPupil;
            Item.day       = --dbItem.day;
            Item.timeBegin = dbItem.timeBegin;
            Item.timeEnd   = dbItem.timeEnd;
            Item.active    = dbItem.active;
            Item.comment   = dbItem.comment;
            Item.dateBegin = dbItem.dateBegin;
            Item.dateEnd   = dbItem.dateEnd;

            return(Item);
        }
Example #2
0
        public void AddItemToDB(Calendar _Item)
        {
            DBWorker.dbCalendar Item = new DBWorker.dbCalendar();

            Item.active    = _Item.active;
            Item.comment   = _Item.comment;
            Item.dateBegin = _Item.dateBegin;
            Item.dateEnd   = _Item.dateEnd;
            Item.day       = ++_Item.day;
            Item.idPupil   = _Item.idPupil;
            Item.idTeacher = _Item.idTeacher;
            Item.timeBegin = _Item.timeBegin;
            Item.timeEnd   = _Item.timeEnd;

            if (DBWCal.getItemByIDSFromDB(_Item.idTeacher, _Item.idPupil, _Item.day).idPupil == 0)
            {
                DBWCal.createCalendarInDB(Item);
            }
            else
            {
                DBWCal.updateCalendarInDB(Item);
            }
        }