private async void Register() { var profiles = Connectivity.ConnectionProfiles; //if (profiles.Contains(ConnectionProfile.Ethernet)) //{ // если активно подключение через Wi-Fi if (!(String.IsNullOrWhiteSpace(FirstName) && String.IsNullOrWhiteSpace(LastName) && String.IsNullOrWhiteSpace(GroupNumber) && String.IsNullOrWhiteSpace(Login) && String.IsNullOrWhiteSpace(Password))) { await studentsService.Add(new Student(Login, Password, new StudentProfile(FirstName, LastName, GroupNumber))); await Application.Current.MainPage.Navigation.PushAsync(new MainPage()); } //} }
public async Task <IActionResult> Add([FromBody] StudentEditDto model) { if (!ModelState.IsValid) { return(BadRequest(this.GetErrors(model))); } OperationResult result = await _service.Add(model); if (result.HasError) { return(this.Unprocessable(result)); } return(Ok(result)); }
public void Add_NewStudent_StudentAdded() { var student = new StudentItem { Name = "John", PersonalIdentifier = 7, Gender = 'M', Type = "University" }; _subject.Add(student); var actualStudentAdded = _subject.Get(7); var expectedStudentAdded = new Student("John", 7, 'F', "University", DateTime.UtcNow); Assert.Equal(expectedStudentAdded, actualStudentAdded); }
public void Add(StudentDAL std) { StudentsSVC.Add(std); }
public void Add(Student std) { studentsService.Add(std); }