Ejemplo n.º 1
0
        // 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"));
        }
Ejemplo n.º 2
0
        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()));
            }
        }
Ejemplo n.º 3
0
        public IHttpActionResult GetAllClientInformation()
        {
            try
            {
                var service = new DAL.Services.ClientInformationService();

                var clientInformation = service.GetAllClientInformation();

                return(Ok(clientInformation));
            }
            catch (Exception ex)
            {
                return(BadRequest(ex.ToString()));
            }
        }
Ejemplo n.º 4
0
        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()));
            }
        }
Ejemplo n.º 5
0
        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()));
            }
        }