コード例 #1
0
ファイル: EducationService.cs プロジェクト: Medved177/122345
        public int Update(DbEducation education)
        {
            var rem = _context.Find <DbEducation>(education.Id);

            if (rem == null)
            {
                return(0);
            }
            if (education.Type != null)
            {
                rem.Type = education.Type;
            }
            if (education.University != null)
            {
                rem.University = education.University;
            }
            if (education.Specialty != null)
            {
                rem.Specialty = education.Specialty;
            }
            if (education.View != null)
            {
                rem.View = education.View;
            }
            if (education.Employee != null)
            {
                rem.Employee = education.Employee;
            }
            var b = _context.Update(rem);

            return(b);
        }
コード例 #2
0
        public ActionResult Put(DbEducation Education)
        {
            var result = _service.Update(Education);

            if (result > 0)
            {
                return(Ok());
            }
            return(BadRequest());
        }
コード例 #3
0
        public ActionResult Add(DbEducation Education)
        {
            var result = _service.Add(Education);

            if (result > 0)
            {
                return(Ok());
            }
            return(BadRequest());
        }
コード例 #4
0
ファイル: HomeController.cs プロジェクト: Medved177/122345
        public async Task <bool> AddEducation(DbEducation education)
        {
            var client   = _clientFactory.CreateClient("api");
            var response = await client.PostAsJsonAsync("Education", education);

            if (response.IsSuccessStatusCode)
            {
                return(true);
            }
            return(false);
        }
コード例 #5
0
ファイル: EducationService.cs プロジェクト: Medved177/122345
        public int Add(DbEducation education)
        {
            var b = _context.Create(education);

            return(b);
        }