Exemple #1
0
        public Task <string> AddTeacherStep2(TeacherStep2 addingTeacher)
        {
            return(Task.Run(() =>
            {
                try
                {
                    List <TeacherStep2> listofteacher = new List <TeacherStep2>();
                    if (RefreshTeacherStep2().Result != null)
                    {
                        listofteacher = RefreshTeacherStep2().Result.ToList();
                    }

                    listofteacher.Add(addingTeacher);
                    String json = JsonConvert.SerializeObject(listofteacher);
                    File.WriteAllText(default_path + target_path + @"\teacherstep2.txt", string.Empty);
                    File.WriteAllText(default_path + target_path + @"\teacherstep2.txt", json);

                    return "success";
                }
                catch (Exception ex)
                {
                    MessageBox.Show("can't interpret some values .\n\n" + ex.Message + "\n\n Please check   ", "Error", MessageBoxButton.OK, MessageBoxImage.Error);
                    return ex.Message;
                }
            }));
        }
Exemple #2
0
 public Task <string> AddTeacherStep2(TeacherStep2 addingTeacher)
 {
     throw new NotImplementedException();
 }