public static List <Matter> GetMattersByCompanyID(int CompanyID) { using (var db = new LawyersEntities()) { return(db.Matters.Where(x => x.CompanyID == CompanyID).OrderBy(x => x.Name).ToList()); } }
public static List <Company> GetCompanies() { using (var db = new LawyersEntities()) { return(db.Companies.OrderBy(x => x.Name).ToList()); } }
public static List <Matter> GetMatters() { using (var db = new LawyersEntities()) { return(db.Matters.OrderBy(x => x.Name).ToList()); } }
public static List <Submatter> GetSubmattersByMatterID(int MatterID) { using (var db = new LawyersEntities()) { return(db.Submatters.Where(x => x.MatterID == MatterID).OrderBy(x => x.Name).ToList()); } }
public static List <sp_GetAllTasks_Result> GetTasksWithInfo() { using (var db = new LawyersEntities()) { return(db.sp_GetAllTasks().OrderBy(x => x.CompanyName).ToList()); } }
public static List <Task> GetTasks() { using (var db = new LawyersEntities()) { return(db.Tasks.OrderBy(x => x.Date).ToList()); } }
public static List <Lawyer> GetLawyers() { try { using (var db = new LawyersEntities()) { return(db.Lawyers.OrderBy(x => x.Name).ToList()); } } catch { throw; } }
public void Add() { try { using (var db = new LawyersEntities()) { db.Companies.Attach(this); db.Companies.Add(this); db.SaveChanges(); } } catch { throw; } }