예제 #1
0
        private void UploadClick(object sender, EventArgs e)
        {
            string result;

            var jsonSerializer = new System.Web.Script.Serialization.JavaScriptSerializer();

            var mySQLExams = MySQLExam.FromExamList(_repo.GetAllExamRecords());
            var wud        = new WnuUploadData {
                tableSelector = "exams", data = jsonSerializer.Serialize(mySQLExams)
            };
            string json = jsonSerializer.Serialize(wud);

            WnuUpload.UploadTableData(json);

            var MySQLlogEvents = MySQLExamLogEvent.FromLogEventList(_repo.GetAllLogEvents());

            wud = new WnuUploadData {
                tableSelector = "examsLogEvents", data = jsonSerializer.Serialize(MySQLlogEvents)
            };
            json   = jsonSerializer.Serialize(wud);
            result = WnuUpload.UploadTableData(json);
        }