Пример #1
0
        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());
            }
            //}
        }
Пример #2
0
        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));
        }
Пример #3
0
        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);
        }
Пример #4
0
 public void Add(StudentDAL std)
 {
     StudentsSVC.Add(std);
 }
Пример #5
0
 public void Add(Student std)
 {
     studentsService.Add(std);
 }