public List <CertificateType> GetAll() { DataContext dc = new DataContext(this.DbString); ICertificateTypeRepository certfRep = new CertificateTypeRepository(dc); return(certfRep.GetAll()); }
public bool Update(CertificateType certf) { DataContext dc = new DataContext(this.DbString); ICertificateTypeRepository certfRep = new CertificateTypeRepository(dc); return(certfRep.Update(certf)); }
public IQueryable <CertificateType> Search(CertificateTypeSearchModel searchModel) { DataContext dc = new DataContext(this.DbString); ICertificateTypeRepository certfRep = new CertificateTypeRepository(dc); return(certfRep.Search(searchModel)); }
public CertificateType FindById(int id) { DataContext dc = new DataContext(this.DbString); ICertificateTypeRepository certfRep = new CertificateTypeRepository(dc); return(certfRep.FindById(id)); }
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); }