예제 #1
0
        public ActionResult Index(int?page)
        {
            int pageSize  = 5;
            int pageIndex = 1;

            pageIndex = page.HasValue ? Convert.ToInt32(page) : 1;
            IPagedList <Divisions> div = null;
            DivisionsRepository    divisionsrepository = new DivisionsRepository();
            Divisions        Divisions = new Divisions();
            List <Divisions> obDivList = new List <Divisions>();

            obDivList           = divisionsrepository.ViewDivisions();
            Divisions.divisions = obDivList;
            div = obDivList.ToPagedList(pageIndex, pageSize);
            return(View(div));
        }
예제 #2
0
 public async Task <OS_OrganizationStructureTemplateDivision_Dto> GetDivisionAsync(int divId, int buId, int orgStructureId)
 {
     try
     {
         OS_OrganizationStructureTemplateDivision_Dto obj = ObjectMapper.Map <OS_OrganizationStructureTemplateDivision, OS_OrganizationStructureTemplateDivision_Dto>(DivisionsRepository.WithDetails().FirstOrDefault(x => x.Id == divId && x.OrganizationStructureTemplateBusinessUnitId == buId && x.OrganizationStructureTemplateId == orgStructureId));
         return(obj);
     }
     catch (Exception ex)
     {
         return(null);
     }
 }
예제 #3
0
 public async Task <List <OS_OrganizationStructureTemplateDivision_Dto> > GetDivisionsAsync(int osId)
 {
     try
     {
         List <OS_OrganizationStructureTemplateDivision_Dto> obj = ObjectMapper.Map <List <OS_OrganizationStructureTemplateDivision>, List <OS_OrganizationStructureTemplateDivision_Dto> >(DivisionsRepository.WithDetails().Where(x => x.OrganizationStructureTemplateId == osId).ToList());
         return(obj);
     }
     catch (Exception ex)
     {
         return(null);
     }
 }