示例#1
0
        public CustomerDetailViewModel(ISecurityService securityService, IViewModelsFactory <IPhoneNumberDialogViewModel> phoneVmFactory, IViewModelsFactory <IEmailDialogViewModel> emailVmFactory, IViewModelsFactory <ICreateUserDialogViewModel> wizardUserVmFactory, IViewModelsFactory <IAddressDialogViewModel> addressVmFactory, ICustomerEntityFactory entityFactory,
                                       IAuthenticationContext authContext, CustomersDetailViewModel parentViewModel, Contact innerContact,
                                       ICustomerRepository customerRepository, IRepositoryFactory <ISecurityRepository> securityRepositoryFactory,
                                       IRepositoryFactory <ICountryRepository> countryRepositoryFactory, IRepositoryFactory <IOrderRepository> orderRepositoryFactory, ILoginViewModel loginViewModel)
        {
            _securityService           = securityService;
            _loginViewModel            = loginViewModel;
            _parentViewModel           = parentViewModel;
            _authContext               = authContext;
            _customerRepository        = customerRepository;
            _orderRepositoryFactory    = orderRepositoryFactory;
            _securityRepositoryFactory = securityRepositoryFactory;
            _countryRepositoryFactory  = countryRepositoryFactory;
            _entityFactory             = entityFactory;
            _addressVmFactory          = addressVmFactory;
            _wizardUserVmFactory       = wizardUserVmFactory;
            _emailVmFactory            = emailVmFactory;
            _phoneVmFactory            = phoneVmFactory;
            _fileDialogService         = new FileDialogService();

            InnerItem = innerContact;

            InnerItem.PropertyChanged += _innerContact_PropertyChanged;

            CommandsInit();
            RequestInit();
            CollectionInit();

            HasCurrentContactLoginAndSuspendAccessCheck();
        }
 public CustomerCaseControlViewModel(IAssetService assetService, IViewModelsFactory <IKnowledgeBaseDialogViewModel> knowledgeBaseGroupVmFactory, IAuthenticationContext authContext, string authorId, string authorName, CustomersDetailViewModel parentViewModel)
     : base(assetService, knowledgeBaseGroupVmFactory, authorId, authorName)
 {
     _parentViewModel = parentViewModel;
     _authContext     = authContext;
     DefToolBarCommands();
     CommonConfirmRequest = new InteractionRequest <ConditionalConfirmation>();
     IsReadOnly           = !_authContext.CheckPermission(PredefinedPermissions.CustomersCreateCustomer);
 }
示例#3
0
        public CaseDetailViewModel(CustomersDetailViewModel parentViewModel, Case innerCase,
                                   ICustomerRepository customerRepository, CaseActionState caseAction,
                                   ICustomerEntityFactory entityFactory, IRepositoryFactory <ISecurityRepository> securityRepositoryFactory,
                                   IAuthenticationContext authContext, IViewModelsFactory <ICustomerViewModel> customerVmFactory)
        {
            _entityFactory             = entityFactory;
            _securityRepositoryFactory = securityRepositoryFactory;
            _parentViewModel           = parentViewModel;
            _authContext       = authContext;
            _customerVmFactory = customerVmFactory;

            InnerItem = innerCase;
            _innerCase.PropertyChanged          += _innerCase_PropertyChanged;
            _innerCase.Labels.CollectionChanged += Labels_CollectionChanged;
            _customerRepository = customerRepository;

            _caseAction = caseAction;

            CommandInits();
            CollectionInits();

            OnPropertyChanged("CaseHasTitle");
        }