//Get all Captions public List <CaptionMaster> GetAllCaptions() { try { using (EstimateDBEntities context = new EstimateDBEntities()) { var query = context.CaptionMasters.Select(c => c).ToList(); return(query); } } catch (Exception) { throw; } }
//Get Brand By Id public BrandMaster GetBrandById(int brandID) { try { using (EstimateDBEntities context = new EstimateDBEntities()) { var query = context.BrandMasters.Where(b => b.BrandID == brandID).Select(b => b).FirstOrDefault(); return(query); } } catch (Exception) { throw; } }
//Get all Brands public List <BrandMaster> GetAllBrands() { try { using (EstimateDBEntities context = new EstimateDBEntities()) { var query = context.BrandMasters.Select(b => b).ToList(); return(query); } } catch (Exception) { throw; } }
//Get Client By Id public ClientMaster GetClientById(int clientID) { try { using (EstimateDBEntities context = new EstimateDBEntities()) { var query = context.ClientMasters.Where(c => c.ClientID == clientID).Select(c => c).FirstOrDefault(); return(query); } } catch (Exception) { throw; } }
//Get by Id public EstimateHeader GetEstimateById(int estimateID) { try { using (EstimateDBEntities context = new EstimateDBEntities()) { var query = context.EstimateHeaders.Where(e => e.EST_ID == estimateID).Select(e => e).FirstOrDefault(); return(query); } } catch (Exception) { throw; } }
//Get All public List <EstimateHeader> GetAllEstimates() { try { using (EstimateDBEntities context = new EstimateDBEntities()) { var query = context.EstimateHeaders.Select(e => e).ToList(); return(query); } } catch (Exception) { throw; } }