Exemple #1
0
 protected void DataPortal_Fetch(SingleCriteria <Company, int> criteria)
 {
     using (ObjectContextManager <RolodexEntities> manager = ObjectContextManager <RolodexEF.RolodexEntities> .GetManager(DataConnection.EFConnectionName, true))
     {
         Companies company = (from oneCompany in manager.ObjectContext.Companies
                              .Include("CompanyContacts")
                              .Include("CompanyContacts.Ranks")
                              .Include("CompanyContacts.CompanyContactPhones")
                              where oneCompany.CompanyId == criteria.Value
                              select oneCompany).FirstOrDefault();
         if (company != null)
         {
             LoadProperty <int>(CompanyIdProperty, company.CompanyId);
             LoadProperty <string>(CompanyNameProperty, company.CompanyName);
             LoadProperty <SmartDate>(DateAddedProperty, company.DateAdded);
             LoadProperty(ContactsProperty, CompanyContactList.GetCompanyContactList(company));
         }
     }
     LoadProperty(RanksProperty, Rolodex.Business.BusinessClasses.Ranks.GetRanks());
 }
Exemple #2
0
 protected override void DataPortal_Create()
 {
     LoadProperty <CompanyContactList>(ContactsProperty, CompanyContactList.NewCompanyContactList());
     LoadProperty(RanksProperty, Rolodex.Business.BusinessClasses.Ranks.GetRanks());
     ValidationRules.CheckRules();
 }
Exemple #3
0
 protected override void DataPortal_Create()
 {
     LoadProperty <CompanyContactList>(ContactsProperty, CompanyContactList.NewCompanyContactList());
     LoadProperty(RanksProperty, Ranks.GetRanks());
     BusinessRules.CheckRules();
 }