Exemplo n.º 1
0
 private void RetrieveData()
 {
     using (IUnitOfWork uow = UnitOfWorkFactory.Instance.Start(DataStoreResolver.CRMDataStoreKey))
     {
         SupplierFacade facade   = new SupplierFacade(uow);
         SupplierDto    instance = facade.RetrieveOrNewSupplier(InstanceId, new SupplierConverter());
         CurrentInstance         = instance;
         ucIEdit.CurrentInstance = instance;
     }
 }
Exemplo n.º 2
0
 private void RetrieveInstances(SupplierFacade facade)
 {
     if (CurrentUserContext.IsAdmin || CurrentUserContext.IsEmployee)
     {
         CurrentInstances = facade.RetrieveAllSupplier(new SupplierConverter());
     }
     else if (CurrentUserContext.IsSupplier)
     {
         List <SupplierDto> instances = new List <SupplierDto>();
         SupplierDto        instance  = facade.RetrieveOrNewSupplier(CurrentUserContext.User.MatchId, new SupplierConverter());
         instances.Add(instance);
         CurrentInstances = instances;
     }
 }