示例#1
0
        public Task <string> AddTeacherStep1(TeacherStep1 addingTeacher)
        {
            return(Task.Run(() =>
            {
                try
                {
                    List <TeacherStep1> listofteacher = new List <TeacherStep1>();
                    if (RefreshTeacherStep1().Result != null)
                    {
                        listofteacher = RefreshTeacherStep1().Result.ToList();
                    }

                    listofteacher.Add(addingTeacher);
                    String json = JsonConvert.SerializeObject(listofteacher);
                    File.WriteAllText(default_path + target_path + @"\teacherstep1.txt", string.Empty);
                    File.WriteAllText(default_path + target_path + @"\teacherstep1.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;
                }
            }));
        }
示例#2
0
 public Task <string> AddTeacherStep1(TeacherStep1 addingTeacher)
 {
     throw new NotImplementedException();
 }