protected async System.Threading.Tasks.Task Grid0RowSelect(CaApp.Models.ConData.Student args) { var dialogResult = await DialogService.OpenAsync <EditStudent>("Edit Student", new Dictionary <string, object>() { { "StudentID", args.StudentID } }); await grid0.Reload(); await InvokeAsync(() => { StateHasChanged(); }); }
protected async System.Threading.Tasks.Task Form0Submit(CaApp.Models.ConData.Student args) { try { var conDataUpdateStudentResult = await ConData.UpdateStudent(studentId : StudentID, student : student); DialogService.Close(student); } catch (System.Exception conDataUpdateStudentException) { NotificationService.Notify(NotificationSeverity.Error, $"Error", $"Unable to update Student"); } }
protected async System.Threading.Tasks.Task Load() { var conDataGetGendersResult = await ConData.GetGenders(); getGendersResult = conDataGetGendersResult.Value.AsODataEnumerable(); var conDataGetCountriesResult = await ConData.GetCountries(); getCountriesResult = conDataGetCountriesResult.Value.AsODataEnumerable(); student = new CaApp.Models.ConData.Student() { }; }
public async System.Threading.Tasks.Task <HttpResponseMessage> UpdateStudent(Int64?studentId = default(Int64?), Models.ConData.Student student = default(Models.ConData.Student)) { var uri = new Uri(baseUri, $"Students({studentId})"); var httpRequestMessage = new HttpRequestMessage(HttpMethod.Patch, uri); httpRequestMessage.Content = new StringContent(ODataJsonSerializer.Serialize(student), Encoding.UTF8, "application/json"); OnUpdateStudent(httpRequestMessage); return(await httpClient.SendAsync(httpRequestMessage)); }
public async System.Threading.Tasks.Task <Models.ConData.Student> CreateStudent(Models.ConData.Student student = default(Models.ConData.Student)) { var uri = new Uri(baseUri, $"Students"); var httpRequestMessage = new HttpRequestMessage(HttpMethod.Post, uri); httpRequestMessage.Content = new StringContent(ODataJsonSerializer.Serialize(student), Encoding.UTF8, "application/json"); OnCreateStudent(httpRequestMessage); var response = await httpClient.SendAsync(httpRequestMessage); return(await response.ReadAsync <Models.ConData.Student>()); }