Пример #1
0
 public IActionResult AddVacancy([FromBody] Vacancy vacant)
 {
     if (_vacancyRepo.AddVacancy(vacant))
     {
         return(Ok(vacant.Id_vacancy));
     }
     return(NotFound());
 }
Пример #2
0
        public IActionResult AddVacancy([FromBody] Vacancy vacant)
        {
            TimeZoneInfo zone     = TimeZoneInfo.FindSystemTimeZoneById("SE Asia Standard Time");
            DateTime     dateTime = TimeZoneInfo.ConvertTime(DateTime.Now, zone);

            if (_vacancyRepo.AddVacancy(vacant))
            {
                Log.Information("Add vacancy {id} OK. {datetime}.", vacant.Id_vacancy, dateTime);
                return(Ok(vacant.Id_vacancy));
            }
            Log.Information("Cannot Add vacancy {id}. {datetime}.", vacant.Id_vacancy, dateTime);
            return(NotFound("Cannot add vacancy"));
        }