Пример #1
0
 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());
     }
 }
Пример #2
0
 public static List <Company> GetCompanies()
 {
     using (var db = new LawyersEntities())
     {
         return(db.Companies.OrderBy(x => x.Name).ToList());
     }
 }
Пример #3
0
 public static List <Matter> GetMatters()
 {
     using (var db = new LawyersEntities())
     {
         return(db.Matters.OrderBy(x => x.Name).ToList());
     }
 }
Пример #4
0
 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());
     }
 }
Пример #5
0
 public static List <sp_GetAllTasks_Result> GetTasksWithInfo()
 {
     using (var db = new LawyersEntities())
     {
         return(db.sp_GetAllTasks().OrderBy(x => x.CompanyName).ToList());
     }
 }
Пример #6
0
 public static List <Task> GetTasks()
 {
     using (var db = new LawyersEntities())
     {
         return(db.Tasks.OrderBy(x => x.Date).ToList());
     }
 }
Пример #7
0
 public static List <Lawyer> GetLawyers()
 {
     try
     {
         using (var db = new LawyersEntities())
         {
             return(db.Lawyers.OrderBy(x => x.Name).ToList());
         }
     }
     catch
     {
         throw;
     }
 }
Пример #8
0
 public void Add()
 {
     try
     {
         using (var db = new LawyersEntities())
         {
             db.Companies.Attach(this);
             db.Companies.Add(this);
             db.SaveChanges();
         }
     }
     catch
     {
         throw;
     }
 }