Beispiel #1
0
 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()
         });
     }
 }
Beispiel #2
0
 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()
         });
     }
 }
Beispiel #3
0
 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()
         });
     }
 }
Beispiel #4
0
 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)
         });
     }
 }