public IHttpActionResult UpdateFAQ(FAQ faq) { try { var mng = new FAQManagement(); mng.Update(faq); 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 GetUnvailableFaqs() { try { apiResp = new ApiResponse(); var mng = new FAQManagement(); apiResp.Data = mng.RetrieveUnavailable(); 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(string id) { try { var mng = new FAQManagement(); var faq = new FAQ { ID = id }; faq = mng.RetrieveById(faq); apiResp = new ApiResponse(); apiResp.Data = faq; 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))); } }