Example #1
0
        public IOCLocator(ISQLiteConnectionDependency sqliiteConnectionDependency, IMapperDependency mapperDependency,
                          INetworkDependency networkDependency, IUserPreferences userPreferences,
                          ICUCService cucService, ILoginService logService, IValidBonusService validBonusService,
                          IBonusDataRepository bonusDataRepository, ITokenDataRepository tokenDataRepository,
                          IUserDataRepository userDataRepository, IWSLoginRepository wsLoginRepository,
                          IWSValidBonoRepository wsValidBonoRepository)
        {
            SQLiteConnectionDependency = sqliiteConnectionDependency;
            MapperDependency           = mapperDependency;
            NetworkDependency          = networkDependency;
            UserPreferences            = userPreferences;


            CUCService        = cucService;
            LogService        = logService;
            ValidBonusService = validBonusService;


            BonusDataRepository = bonusDataRepository;
            TokenDataRepository = tokenDataRepository;
            UserDataRepository  = userDataRepository;


            WSLoginRepository     = wsLoginRepository;
            WSValidBonoRepository = wsValidBonoRepository;
        }
Example #2
0
        public SellingPointPopUpViewModel()
        {
            _cucService   = FreshIOC.Container.Resolve <ICUCService>();
            _loginService = FreshIOC.Container.Resolve <ILoginService>();

            Init();

            this.WhenAny(OnSellingPointChanged, p => p.SellingPoint);
        }
Example #3
0
        public ConfirmationStatesBonusPopUpViewModel(string title, string description, int icon, string actionLabel, string noActionLabel, Action doAction)
        {
            _doAction     = doAction;
            _cucService   = FreshMvvm.FreshIOC.Container.Resolve <ICUCService>();
            _loginService = FreshMvvm.FreshIOC.Container.Resolve <ILoginService>();

            _userName = _loginService.GetUser().UserName;

            ConfigureData(title, description, icon, actionLabel, noActionLabel);
        }
Example #4
0
        public LoginViewModel(ICUCService cucService, MessageService messageService, PopUpService popUpService, NavigationService navigationService, ILoginService loginService, IFirebaseAnalyticsDependency firebaseAnalyticsDependency)
        {
            _navigationService           = navigationService;
            _loginService                = loginService;
            _popUpService                = popUpService;
            _messageService              = messageService;
            _cucService                  = cucService;
            _firebaseAnalyticsDependency = firebaseAnalyticsDependency;

            Init();
        }
Example #5
0
        public SummaryBonusesViewModel(IValidBonusService validBonusService, ILoginService loginService, ICUCService cucService, PopUpService popupService, IFirebaseAnalyticsDependency firebaseAnalyticsDependency, NavigationService navigationService, MessageService messageService)
        {
            _validBonusService           = validBonusService;
            _loginService                = loginService;
            _cucService                  = cucService;
            _navigationService           = navigationService;
            _popupService                = popupService;
            _validBonusService           = validBonusService;
            _firebaseAnalyticsDependency = firebaseAnalyticsDependency;
            _messageService              = messageService;

            LoadData();
        }
Example #6
0
        public ChoiceCucViewModel(PopUpService popUpService, NavigationService navigationService, MessageService messageService, IResourcesDependency resourcesDependency, ICUCService cucService, ILoginService loginService, IFirebaseAnalyticsDependency firebaseAnalyticsDependency, IValidBonusService validBonusService)
        {
            _popUpService                = popUpService;
            _navigationService           = navigationService;
            _messageService              = messageService;
            _resourcesDependency         = resourcesDependency;
            _cucService                  = cucService;
            _loginService                = loginService;
            _firebaseAnalyticsDependency = firebaseAnalyticsDependency;
            _validBonusService           = validBonusService;


            _userName = _loginService.GetUser().UserName;

            // Eventos de cuando cambia las propiuedades
            this.WhenAny(OnIsEnabledSellingPointChanged, p => p.IsEnabledSellingPoint);
            this.WhenAny(OnSellingPointTitleChanged, p => p.SellingPointTitle);

            Init();
        }
Example #7
0
        public ValidationBonusPopUpViewModel(ValidateBonusResponseModel validateBonusResponse, bool isValid = true, Action action = null)
        {
            _cucService            = FreshMvvm.FreshIOC.Container.Resolve <ICUCService>();
            _loginService          = FreshMvvm.FreshIOC.Container.Resolve <ILoginService>();
            _action                = action;
            _validateBonusResponse = validateBonusResponse;

            this.IsValid = isValid;

            Title       = IsValid ? "BONO VÁLIDO" : "BONO NO VÁLIDO";
            Image       = IsValid ? "icon_check" : "icon_x";
            Description = _validateBonusResponse.Descripcion;

            var userName     = _loginService.GetUser().UserName;
            var sellingPoint = _cucService.GetCurrentCUC(userName);

            SellingPointTitle       = sellingPoint.nombrePuntoventa;
            SellingPointDescription = sellingPoint.descripcion;
            SellingPointProduct     = _validateBonusResponse.tipoBono;
            SellingPointPrice       = _validateBonusResponse.valorBono;
        }