Пример #1
0
 public IActionResult UpdateTitle([FromBody] CreateTitleModel model, int titleId)
 {
     var(update, errorMessage) = officeService.UpdateTitleInfo(titleId, model.titlename, model.startdate, model.enddate, model.departmentid);
     if (update)
     {
         return(Ok(new { status = true }));
     }
     return(BadRequest(errorMessage));
 }
Пример #2
0
        public IActionResult CreateTitle([FromBody] CreateTitleModel model)
        {
            var termId = new Random().Next();

            var(create, errorMessage) = officeService.AddTitle(termId, model.titlename, model.startdate, model.enddate, model.departmentid);
            if (create)
            {
                return(Ok(new { status = true }));
            }
            return(BadRequest(errorMessage));
        }