Example #1
0
 public static SelectList GetRoleList()
 {
     using (var ent = new DirectoryEntities())
     {
         return(new SelectList(ent.AspNetRoles.ToList(), "Name", "Name"));
     }
 }
Example #2
0
 public static SelectList GetAllPalika()
 {
     using (var ent = new DirectoryEntities())
     {
         return(new SelectList(ent.tblPalikas.ToList(), "PalikaId_val", "PalikaName_Nep"));
     }
 }
Example #3
0
 public static SelectList GetAllState()
 {
     using (var ent = new DirectoryEntities())
     {
         return(new SelectList(ent.tblStates.ToList(), "StateId_val", "StateName_Nep"));
     }
 }
Example #4
0
 public static SelectList GetAllDirectorySubCategory()
 {
     using (var ent = new DirectoryEntities())
     {
         return(new SelectList(ent.tblDirectorySubCategories.ToList(), "DirectorySubCategoryId", "DirectorySubCategoryName"));
     }
 }
Example #5
0
 public static SelectList GetAllDistrict()
 {
     using (var ent = new DirectoryEntities())
     {
         return(new SelectList(ent.tblDistricts.ToList(), "DistrictId_val", "DistrictName_Nep"));
     }
 }
Example #6
0
        public static SelectList GetDirectorySubCategoryById(int id)
        {
            List <SelectListItem> subCatList = new List <SelectListItem>();

            using (DirectoryEntities db = new DirectoryEntities())
            {
                return(new SelectList(db.tblDirectorySubCategories.Where(x => x.DirectoryCategoryId == id).ToList(), "DirectorySubCategoryId", "DirectorySubCategoryName"));
            }
        }
Example #7
0
 public static string GetStateName(int?id)
 {
     using (var ent = new DirectoryEntities())
     {
         var obj = ent.tblStates.Where(x => x.StateId_val == id).SingleOrDefault();
         if (obj != null)
         {
             return(obj.StateName);
         }
         else
         {
             return("");
         }
     }
 }
Example #8
0
 public static string GetDistrictById(int?id)
 {
     using (var ent = new DirectoryEntities())
     {
         var obj = ent.tblDistricts.Where(x => x.DistrictId_val == id).SingleOrDefault();
         if (obj != null)
         {
             return(obj.DistrictName_Nep);
         }
         else
         {
             return("");
         }
     }
 }
Example #9
0
 public static string GetDirectorySubCategoryName(int?id)
 {
     using (var ent = new DirectoryEntities())
     {
         var obj = ent.tblDirectorySubCategories.Where(x => x.DirectorySubCategoryId == id).SingleOrDefault();
         if (obj != null)
         {
             return(obj.DirectorySubCategoryName);
         }
         else
         {
             return("");
         }
     }
 }