Beispiel #1
0
 public async Task<RedirectToRouteResult> CreateCourse(HomeworkCreateViewModel homework)
 {
     var apiService = Session.GetApiService();
     var result = await apiService.PostAsyncWithReturn<string, HomeworkCreateViewModel>("/Homework/Add", homework);
     //var data = new RouteValueDictionary();
     //data.Add("Module", course.Course);
     return RedirectToAction("Index", "Module");
 }
Beispiel #2
0
 public async Task<RedirectToRouteResult> AddHomework(HomeworkCreateViewModel homeworkCreateViewModel)
 {
     var apiService = Session.GetApiService();
     var moduleId = ((dynamic)JsonConvert.DeserializeObject(homeworkCreateViewModel.Module)).ModuleId;
     var result = await apiService.PostAsyncWithReturn<object, object>("/Homework/Add", new
     {
         ModuleId = moduleId, homeworkCreateViewModel.Score, homeworkCreateViewModel.Text
     });
     return RedirectToAction("Index", "Module", new RouteValueDictionary() { {"Module", homeworkCreateViewModel.Module} });
 }