Exemplo n.º 1
0
 public ClientViewModel(int Id)
 {
     using (var contex = CrmContextFactory.Get())
     {
         var _client = contex.Clients.Where(t => t.Id == Id).FirstOrDefault();
         if (_client == null)
         {
             throw new ArgumentNullException("Client");
         }
         Client   = (Client)(_client);
         Contacts = new ContactsViewModel(Client.Id);
     }
 }
Exemplo n.º 2
0
 public ClientViewModel()
 {
     Client   = new Client();
     Contacts = new ContactsViewModel();
 }