Пример #1
0
        public List <CertificateType> GetAll()
        {
            DataContext dc = new DataContext(this.DbString);
            ICertificateTypeRepository certfRep = new CertificateTypeRepository(dc);

            return(certfRep.GetAll());
        }
Пример #2
0
        public bool Update(CertificateType certf)
        {
            DataContext dc = new DataContext(this.DbString);
            ICertificateTypeRepository certfRep = new CertificateTypeRepository(dc);

            return(certfRep.Update(certf));
        }
Пример #3
0
        public IQueryable <CertificateType> Search(CertificateTypeSearchModel searchModel)
        {
            DataContext dc = new DataContext(this.DbString);
            ICertificateTypeRepository certfRep = new CertificateTypeRepository(dc);

            return(certfRep.Search(searchModel));
        }
Пример #4
0
        public CertificateType FindById(int id)
        {
            DataContext dc = new DataContext(this.DbString);
            ICertificateTypeRepository certfRep = new CertificateTypeRepository(dc);

            return(certfRep.FindById(id));
        }
Пример #5
0
        public CertificateTypeInfoModel GetCertificateTypeInfo(CertificateTypeSearchModel searchModel)
        {
            CertificateTypeInfoModel info = new CertificateTypeInfoModel();
            DataContext dc = new DataContext(this.DbString);
            ICertificateTypeRepository   certfRep = new CertificateTypeRepository(dc);
            IQueryable <CertificateType> certfs   = certfRep.Search(searchModel);

            info.certfCount = dc.Context.GetTable <CertificateType>().Where(c => c.id.Equals(certfs.Count() > 0 ? certfs.First().id : -1)).Count();

            return(info);
        }