public HttpResponseMessage Put(WorkflowCategory workflowCategory)
        {
            if (_repository.EditWorkflowCategory(workflowCategory))
            {
                DataSourceResult result = new DataSourceResult
                {
                    Data = new[] { workflowCategory },
                    Total = 1
                };

                HttpResponseMessage response = Request.CreateResponse(HttpStatusCode.OK, result);
                response.Headers.Location = new Uri(Url.Link("DefaultApi", new { id = workflowCategory.WorkflowCategoryID }));
                return response;
            }
            else
                return Request.CreateResponse(HttpStatusCode.BadRequest, ModelState);
        }
        public bool EditWorkflowCategory(WorkflowCategory toUpdate)
        {
            int rowAffected = 0;

            using (var connection = new SqlConnection(PrescienceRxConnectionString))
            {
                connection.Open();

                using (SqlCommand command = connection.CreateCommand())
                {
                    command.CommandText = @"UPDATE dbo.WorkflowCategory SET CategoryName = @CategoryName WHERE WorkflowCategoryID = @WorkflowCategoryID";
                    command.Parameters.AddWithValue("@WorkflowCategoryID", toUpdate.WorkflowCategoryID);
                    command.Parameters.AddWithValue("@CategoryName", toUpdate.CategoryName);
                    rowAffected = command.ExecuteNonQuery();
                }

                connection.Dispose();
            }

            return rowAffected == 1 ? true : false;
        }
        public int AddWorkflowCategory(WorkflowCategory toInsert)
        {
            int rowAffected = 0;

            using (var connection = new SqlConnection(PrescienceRxConnectionString))
            {
                connection.Open();

                using (SqlCommand command = connection.CreateCommand())
                {
                    command.CommandText = @"INSERT INTO dbo.WorkflowCategory VALUES (@CategoryName, @CompanyId); SELECT CAST(SCOPE_IDENTITY() AS INT);";
                    command.Parameters.AddWithValue("@CategoryName", toInsert.CategoryName);
                    command.Parameters.AddWithValue("@CompanyId", toInsert.CompanyId);
                    rowAffected = (int)command.ExecuteScalar();
                }

                connection.Dispose();
            }

            return rowAffected;
        }