|
|
@ -11,19 +11,19 @@ namespace eCompanies |
|
|
|
/// </summary>
|
|
|
|
public partial class App : Application |
|
|
|
{ |
|
|
|
private void addCompany(Companies c) |
|
|
|
private void addCompany(Company c) |
|
|
|
{ |
|
|
|
using (var db = new CompaniesDBContext()) |
|
|
|
{ |
|
|
|
db.Companies.Add(c); |
|
|
|
db.Company.Add(c); |
|
|
|
var count = db.SaveChanges(); |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
public static ObservableCollection<Companies> getCompanies() |
|
|
|
public static ObservableCollection<Company> getCompanies() |
|
|
|
{ |
|
|
|
using (var db = new CompaniesDBContext()) |
|
|
|
return new ObservableCollection<Companies>(db.Companies.AsEnumerable()); |
|
|
|
return new ObservableCollection<Company>(db.Company.AsEnumerable()); |
|
|
|
} |
|
|
|
|
|
|
|
public static HashSet<Users> getUsers(int id) |
|
|
@ -32,11 +32,11 @@ namespace eCompanies |
|
|
|
return new HashSet<Users>(db.Users.Where(b => b.CompanyId.Equals(id))); |
|
|
|
} |
|
|
|
|
|
|
|
public static void updateCompany(Companies c) |
|
|
|
public static void updateCompany(Company c) |
|
|
|
{ |
|
|
|
using (var db = new CompaniesDBContext()) |
|
|
|
{ |
|
|
|
db.Companies.Update(c); |
|
|
|
db.Company.Update(c); |
|
|
|
db.SaveChanges(); |
|
|
|
} |
|
|
|
} |
|
|
|