// GET: Export public FileContentResult DownloadCSV() { var service = new DAL.Services.ClientInformationService(); var csv = service.ExportCSV(); return(File(Encoding.UTF8.GetBytes(csv.ToString()), "text/csv", "Client Information.csv")); }
public IHttpActionResult UpdateClientInformation(DAL.Models.ClientInformation model) { try { var service = new DAL.Services.ClientInformationService(); service.UpdateClientInformation(model); return(Ok("Success")); } catch (Exception ex) { return(BadRequest(ex.ToString())); } }
public IHttpActionResult GetAllClientInformation() { try { var service = new DAL.Services.ClientInformationService(); var clientInformation = service.GetAllClientInformation(); return(Ok(clientInformation)); } catch (Exception ex) { return(BadRequest(ex.ToString())); } }
public IHttpActionResult AddClientInformation(DAL.Models.ClientInformation model) { try { var service = new DAL.Services.ClientInformationService(); var clientInformationID = service.AddClientInformation(model); return(Ok(clientInformationID)); } catch (Exception ex) { return(BadRequest(ex.ToString())); } }
public IHttpActionResult GetClientInformation(DAL.Models.ClientInformation model) { try { var service = new DAL.Services.ClientInformationService(); var clientInformation = service.GetClientInformation(model.ClientInformationID); if (clientInformation == null) { return(NotFound()); } return(Ok(clientInformation)); } catch (Exception ex) { return(BadRequest(ex.ToString())); } }