Exemplo n.º 1
0
 //List of Policies in a certain Policy category
 public List<Policy> ReturnListOfPoliciesInCategory(PolicyCategory category)
 {
     return _repo.GetPoliciesListInCategory(category);
 }
Exemplo n.º 2
0
 public Policy()
 {
     Category = new PolicyCategory();
 }
Exemplo n.º 3
0
        public List<PolicyCategory> GetPolicyCategories()
        {
            using (SqlConnection cn = new SqlConnection(Settings.ConnectionString))
            {
                var cmd = new SqlCommand();
                cmd.CommandText = "select * from [Categories]";
                cmd.Connection = cn;
                cn.Open();

                using (SqlDataReader dr = cmd.ExecuteReader())
                {
                    while (dr.Read())
                    {
                        var newCategory = new PolicyCategory();
                        newCategory.CategoryId = int.Parse(dr["CategoryID"].ToString());
                        newCategory.CategoryTitle = dr["CategoryTitle"].ToString();

                        ListOfPolicyCategories.Add(newCategory);
                    }
                }
            }

            return ListOfPolicyCategories.OrderBy(c => c.CategoryTitle).ToList();
        }
Exemplo n.º 4
0
 public List<Policy> GetPoliciesListInCategory(PolicyCategory category)
 {
     return ListOfPolicies.Select(p => p).Where(p => p.Category.CategoryTitle == category.CategoryTitle).ToList();
 }
Exemplo n.º 5
0
 public void AddNewPolicyInNewCategory(Policy newPolicy)
 {
     ListOfPolicies.Add(newPolicy);
     PolicyCategory newCategory = new PolicyCategory()
     {
         CategoryTitle = newPolicy.Category.CategoryTitle
     };
     ListOfPolicyCategories.Add(newCategory);
 }
Exemplo n.º 6
0
 public List<Policy> GetPoliciesListInCategory(PolicyCategory category)
 {
     throw new NotImplementedException();
 }