Example #1
0
        public IQueryable <StaffType> Search(StaffTypeSearchModel searchModel)
        {
            DataContext          dc           = new DataContext(this.DbString);
            IStaffTypeRepository staffTypeRep = new StaffTypeRepository(dc);

            return(staffTypeRep.Search(searchModel));
        }
Example #2
0
        public StaffTypeInfoModel GetStaffTypeInfo(StaffTypeSearchModel searchModel)
        {
            StaffTypeInfoModel     info         = new StaffTypeInfoModel();
            DataContext            dc           = new DataContext(this.DbString);
            IStaffTypeRepository   staffTypeRep = new StaffTypeRepository(dc);
            IQueryable <StaffType> staffTypes   = staffTypeRep.Search(searchModel);

            info.staffTypeCount = dc.Context.GetTable <JobTitle>().Where(c => c.id.Equals(staffTypes.Count() > 0 ? staffTypes.First().id : -1)).Count();

            return(info);
        }