public IHttpActionResult Post(Passenger passenger) { try { var mng = new PassengerManagement(); mng.Create(passenger); var CorreoElectronico = passenger.Email; string Mensaje = "Estimado " + passenger.FirstName + " " + passenger.LastName + " <br/><br/> " + "Su contraseña de inicio es: " + passenger.Password; ToolsHelper.SendMail(CorreoElectronico, "Confirmación de cuenta", Mensaje); apiResp = new ApiResponse { Message = "Action was executed." }; return(Ok(apiResp)); } catch (BussinessException bex) { var MessageManage = new ApplicationMessageManagement(); MessageManage.Create(bex.AppMessage); return(InternalServerError(new Exception(bex.ExceptionId + "-" + bex.AppMessage.Message))); } catch (Exception ex) { ApplicationMessage msg = new ApplicationMessage { Message = ex.Message }; var MessageManage = new ApplicationMessageManagement(); MessageManage.Create(msg); return(InternalServerError(new Exception(ex.Message))); } }
public IHttpActionResult UpdateFAQ(Passenger passenger) { try { var mng = new PassengerManagement(); mng.Update(passenger); apiResp = new ApiResponse { Message = "Action was executed." }; return(Ok(apiResp)); } catch (BussinessException bex) { var MessageManage = new ApplicationMessageManagement(); MessageManage.Create(bex.AppMessage); return(InternalServerError(new Exception(bex.ExceptionId + "-" + bex.AppMessage.Message))); } catch (Exception ex) { ApplicationMessage msg = new ApplicationMessage { Message = ex.Message }; var MessageManage = new ApplicationMessageManagement(); MessageManage.Create(msg); return(InternalServerError(new Exception(ex.Message))); } }
public IHttpActionResult Get() { try { apiResp = new ApiResponse(); var mng = new PassengerManagement(); apiResp.Data = mng.RetrieveAll(); return(Ok(apiResp)); } catch (BussinessException bex) { var MessageManage = new ApplicationMessageManagement(); MessageManage.Create(bex.AppMessage); return(InternalServerError(new Exception(bex.ExceptionId + "-" + bex.AppMessage.Message))); } catch (Exception ex) { ApplicationMessage msg = new ApplicationMessage { Message = ex.Message }; var MessageManage = new ApplicationMessageManagement(); MessageManage.Create(msg); return(InternalServerError(new Exception(ex.Message))); } }