public Response<List<PolicyDocument>> GetAllPolicyDocuments(string filePath, string categoryName) { var repo = new PolicyDocumentRepository(); Response<List<PolicyDocument>> response = new Response<List<PolicyDocument>>(); List<PolicyDocument> policyDocs = repo.GetAllPolicyDocuments(filePath, categoryName); try { if (policyDocs != null) { if (policyDocs.Count > 0) { response.Success = true; response.Data = policyDocs; } else { response.Success = false; response.Message = "There are no files to display."; } } else { response.Success = false; response.Message = "That category does not currently exist"; } } catch (Exception ex) { response.Success = false; response.Message = ex.Message; } return response; }
public Response<List<PolicyDocument>> GetAllPolicyDocuments(string fullPath, int category) { var repo = new PolicyDocumentRepository(); Response<List<PolicyDocument>> response = new Response<List<PolicyDocument>>(); List<PolicyDocument> policyDocs = repo.GetPolicyDocumentsByCategory(fullPath, category); try { if (policyDocs.Count > 0) { response.Success = true; response.Data = policyDocs; } else { response.Success = false; response.Message = "There are no files to display."; } } catch (Exception ex) { response.Success = false; response.Message = ex.Message; } return response; }
public Response<List<Category>> GetAllCategories(string fullPath) { var repo = new PolicyDocumentRepository(); Response<List<Category>> response = new Response<List<Category>>(); List<Category> categories = repo.GetAllCategories(fullPath); try { if (categories.Count > 0) { response.Success = true; response.Data = categories; } else { response.Success = false; response.Message = "There are no categories to display."; } } catch (Exception ex) { response.Success = false; response.Message = ex.Message; } return response; }
public void GetAllCategoriesTest() { var repo = new PolicyDocumentRepository(); var folderPath = @"C:\Users\Apprentice\Desktop\GitHub\KileyDowling\SGCorpHRV2\SGCorpHR\SGCorpHR.TEST\PolicyDocuments"; var allCategories = repo.GetAllPolicyDocCategories(folderPath); Assert.AreEqual("DressCode", allCategories.First()); }
public Response<List<Category>> GetAllCategories(string folderPath) { var repo = new PolicyDocumentRepository(); Response<List<Category>> response = new Response<List<Category>>(); List<Category> allCategories = repo.GetAllPolicyDocCategories(folderPath); response.Data = allCategories; response.Success = true; return response; }
public void AddPolicyDocument(PolicyDocument policyDocument, string folderPath) { var repo = new PolicyDocumentRepository(); repo.AddNewPolicyDocument(policyDocument, folderPath); List<Category> categories = repo.GetAllPolicyDocCategories(folderPath); }
public void DeletePolicyDocument(string filePath, PolicyDocument policyDoc) { var repo = new PolicyDocumentRepository(); repo.DeletePolicyDocument(filePath, policyDoc); }
public void AddPolicyDocument(PolicyDocument document, string filePath) { var repo = new PolicyDocumentRepository(); repo.AddPolicyDocument(filePath,document); }