public Response EditCellPhoneNumber(CellPhoneNumbers cellPhoneNumber) { try { context.CellPhoneNumbers.Update(cellPhoneNumber); context.SaveChanges(); return(new Response { StatusCode = ResponseCodes.Ok, Message = ResponseMessages.SaveSuccessfully }); } catch (Exception ex) { //Log exception details here. return(new Response { StatusCode = ResponseCodes.InternalServerError, Message = ex.ToString() }); } }
public Response AddNewCustomer(Customer customer) { try { customerContext.Customers.Add(customer); customerContext.SaveChanges(); return(new Response { StatusCode = ResponseCodes.Ok, Message = ResponseMessages.SuccessfullySavedNewCustomer }); } catch (Exception ex) { //Log exception details here. return(new Response { StatusCode = ResponseCodes.InternalServerError, Message = ex.ToString() }); } }
public Response SaveEmailAddress(EmailAddress emailAddress) { try { context.EmailAddresses.Add(emailAddress); context.SaveChanges(); return(new Response { StatusCode = ResponseCodes.Ok, Message = ResponseMessages.SuccessfullySavedANewEmailAddress }); } catch (Exception ex) { //Log exception details here. return(new Response { StatusCode = ResponseCodes.InternalServerError, Message = ex.ToString() }); } }
public Response SavePostalAddress(PostalAddress postalAddress) { try { context.PostalAddresses.Add(postalAddress); context.SaveChanges(); return(new Response { StatusCode = ResponseCodes.Ok, Message = ResponseMessages.SuccessfullySavedANewPostalAddress }); } catch (Exception ex) { //Log exception details here. return(new Response { StatusCode = ResponseCodes.InternalServerError, Message = string.Format("{0} \n\n Message: {1}, \n\n StackTrace: {2}", ResponseMessages.FailedToEditPostalAddress, ex.Message, ex.StackTrace) }); } }