示例#1
0
        public IActionResult AddJobTitle([FromBody] CreateEditJobTitleViewModel model)
        {
            var orgListJobTitle = new OrganizationListJobtitle();

            if (model is null)
            {
                return(BadRequest("Job Title is null."));
            }
            if (!ModelState.IsValid)
            {
                return(BadRequest());
            }
            //jobTitle.OrganizationID = EncryptionHelper.DecryptUrlParam(jobTitle.OrganizationID);
            var jobTitleMapper = _mapper.Map(model, orgListJobTitle);

            orgListJobTitle.Id             = 0;
            orgListJobTitle.OrganizationId = Convert.ToInt32(model.OrganizationID);
            orgListJobTitle.BeginEff       = model.ValidFrom;
            orgListJobTitle.LastEff        = model.ValidTo;
            _organizationUnitProvider.AddJobTitle(jobTitleMapper);
            var orgID = orgListJobTitle.Id.ToString();

            return(Ok(orgID));
        }