public IHttpActionResult GetContactType([FromBody] ContactType contactType)
        {
            var contacttypeRepo = new ContactTypeRepository();
            var getcontacttype  = contacttypeRepo.GetContactType(contactType);

            if (getcontacttype == null)
            {
                return(NotFound());
            }
            return(Ok(getcontacttype));
        }
Exemple #2
0
        // GET: /Edit
        public ActionResult Edit(int id)
        {
            ContactType contactType = new ContactType();

            contactType = contactTypeRepository.GetContactType(id);

            if (contactType == null)
            {
                ViewData["ActionMethod"] = "EditGet";
                return(View("RecordDoesNotExistError"));
            }

            //AccessRights
            RolesRepository rolesRepository = new RolesRepository();

            if (!rolesRepository.HasWriteAccessToReferenceInfo())
            {
                ViewData["Message"] = "You do not have access to this item";
                return(View("Error"));
            }


            return(View(contactType));
        }