Пример #1
0
        // POST classes/values
        public void Post([FromBody] Classe data)
        {
            DatabaseOperations db      = new DatabaseOperations();
            MySqlCommand       command = new MySqlCommand("INSERT INTO Classes(TeacherId,  ClassRoomId,  Name,  CreationTime) VALUES(@TeacherId,  @ClassRoomId,  @Name,  @CreationTime)");

            command.Parameters.AddWithValue("@TeacherId", data.TeacherId);
            command.Parameters.AddWithValue("@ClassRoomId", data.ClassRoomId);
            command.Parameters.AddWithValue("@Name", data.Name);
            command.Parameters.AddWithValue("@CreationTime", DateTime.Now.ToString("yyyy-MM-dd HH:mm:ss"));

            db.ExecuteQuery(command);
        }
Пример #2
0
        public static async Task <Classe> AddClasse(Classe classe)
        {
            string data;

            data = "";

            try
            {
                data = await HttpRequestClient.PostRequest("Classes.php?cmd=addClasse", classe);

                classe = JsonConvert.DeserializeObject <Classe>(data);
            }
            catch (Exception ee)
            {
                Console.WriteLine(ee.Message);
            }

            return(classe);
        }
 public StudentClasse(int studentId, int classeId, Classe classe, Student student)
     : this(studentId, classeId)
 {
     _studentId = studentId;
     _classeId  = classeId;
 }
Пример #4
0
 public Absente(int classeId, int studentId, int teacherId, DateTime date, Teacher teacher, Student student, Classe classe)
     : this(classeId, studentId, teacherId, date)
 {
     _classeId  = classeId;
     _studentId = studentId;
     _teacherId = teacherId;
     _date      = date;
 }
Пример #5
0
 public Mark(int classeId, int studentId, int teacherId, int value, DateTime date, Teacher teacher, Student student, Classe classe)
     : this(classeId, studentId, teacherId, value, date)
 {
     _classeId  = classeId;
     _studentId = studentId;
     _teacherId = teacherId;
     _value     = value;
     _date      = date;
 }