// POST api/<controller> public IHttpActionResult Post([FromBody] Persons persons) { var content = new ResponseContent <Persons>(null); if (persons != null) { using (var personsBusiness = new PersonsBusiness()) { content.Result = personsBusiness.InsertPerson(persons) ? "1" : "0"; return(new StandartResult <Persons>(content, Request)); } } content.Result = "0"; return(new StandartResult <Persons>(content, Request)); }
private void UpdatePerson(int personsid, string firstname, string surname, string gender, string emailaddress, string phonenumber) { try { using (var Persons = new PersonsBusiness()) { var entity = new PersonsEntity(); entity.PersonId = personsid; entity.Firstname = firstname; entity.Surname = surname; entity.Gender = gender; entity.EmailAddress = emailaddress; entity.PhoneNumber = phonenumber; var opSuccessful = Persons.InsertPerson(entity); } } catch (Exception ex) { //Log exception error _loggingHandler.LogEntry(ExceptionHandler.GetExceptionMessageFormatted(ex), true); } }