예제 #1
0
        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)));
            }
        }
예제 #2
0
        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)));
            }
        }
예제 #3
0
        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)));
            }
        }