protected virtual void OnShellContainerVmChange(IShellContainerVm value)
 {
     foreach (var ucViewModel in LstChildren)
     {
         ucViewModel.ShellContainerVm = value;
     }
 }
 public MenuItemVm(IButtonItemModel model, IShellContainerVm shellContainerVm)
     : base(shellContainerVm)
 {
     MenuItemBackgroundColor        = new SolidColorBrush(model.Color.ToRgbColor());
     MenuItemBackgroundOverColor    = new SolidColorBrush(model.Color.ToRgbLightColor(20));
     MenuItemBackgroundPressedColor = new SolidColorBrush(model.Color.ToRgbLightColor(-20));
     MenuItemLogo   = new BitmapImage(new Uri(URI_RESOURCE + model.Image));
     Title          = model.Title;
     ExecuteCommand = ReactiveCommand.Create(Observable.Return(true));
     _parameters    = model.Parameters;
     ExecuteCommand.Subscribe(_ => ShellContainerVm.ChangeCurrentView(model.Code.ToEnum(), true, false, _parameters));
 }
Example #3
0
        public FranchiseVm(IButtonItemModel model, IShellContainerVm shellContainerVm, Action <FranchiseInfoModel> onToggleButton)
            : base(shellContainerVm)
        {
            ItemBackgroundColor        = new SolidColorBrush(model.Color.ToRgbColor());
            ItemBackgroundOverColor    = new SolidColorBrush(model.Color.ToRgbLightColor(30));
            ItemBackgroundPressedColor = new SolidColorBrush(model.Color.ToRgbLightColor(-30));
            var uri = new Uri((SharedConstants.Client.URI_LOGO + model.Image).AbsolutePathRelativeToEntryPointLocation());

            ItemLogo        = new BitmapImage(uri);
            Title           = model.Title;
            Products        = model.Description;
            Code            = model.Code;
            DataInfo        = model.DataInfo;
            LastConfig      = model.LastConfig;
            StoresCoverage  = model.StoresCoverage;
            _onToggleButton = onToggleButton;
            //ExecuteCommand = ReactiveCommand.Create(Observable.Return(true));;
            //ExecuteCommand.Subscribe(_ => ShellContainerVm.ChangeCurrentView(model.Code.ToEnum(), true));
        }
Example #4
0
        private static void OnGetUnsynFilesOk(IStale <ResponseMessageData <SyncFranchiseModel> > obj, Action showWnd, IShellContainerVm vm,
                                              ConnectionInfoResponse responseAccount)
        {
            if (obj.IsStale)
            {
                OnGetUnsynFilesError(ResNetwork.ERROR_NETWORK_DOWN, showWnd);
                return;
            }

            if (obj.Data.IsSuccess == false)
            {
                OnGetUnsynFilesError(obj.Data.Message, showWnd);
                return;
            }

            var respMsg = SyncFileService.StartSyncFiles(obj.Data.LstData.ToList());

            if (respMsg.IsSuccess == false)
            {
                OnGetUnsynFilesError(respMsg.Message, showWnd);
                return;
            }

            RxApp.MainThreadScheduler.Schedule(_ =>
            {
                try
                {
                    vm.ChangeCurrentView((StatusScreen)responseAccount.NxWn, false);
                    MessageBus.Current.SendMessage(responseAccount.Msg, SharedMessageConstants.INITIALIZE_ERROR_CHECK);
                    showWnd();
                }
                catch (Exception)
                {
                    OnGetUnsynFilesError("La respuesta del servidor es incorrecta. Revise que tenga la versión correcta en el cliente o en el servidor", showWnd);
                }
            });
        }
Example #5
0
        public static void GetUnsyncFiles(IReactiveDeliveryClient reactiveDeliveryClient, Action showWnd, IShellContainerVm vm, ConnectionInfoResponse response)
        {
            var showWndSec = showWnd;

            reactiveDeliveryClient.ExecutionProxy.ExecuteRequest <ResponseMessageData <SyncFranchiseModel>, ResponseMessageData <SyncFranchiseModel> >
                (SharedConstants.Server.FRANCHISE_HUB, SharedConstants.Server.LIST_SYNC_FILES_FRANCHISE_HUB_METHOD, TransferDto.SameType)
            .ObserveOn(reactiveDeliveryClient.ConcurrencyService.Dispatcher)
            .SubscribeOn(reactiveDeliveryClient.ConcurrencyService.TaskPool)
            .Subscribe(e => OnGetUnsynFilesOk(e, showWnd, vm, response), i => OnGetUnsynFilesError(i, showWndSec));
        }
 protected override void OnShellContainerVmChange(IShellContainerVm value)
 {
     base.OnShellContainerVmChange(value);
     ShellContainerVm.AddOrUpdateFlyouts(_upsertAddress);
 }
 protected UcViewModelBase(IShellContainerVm shellContainerVm)
     : this()
 {
     ShellContainerVm = shellContainerVm;
 }
 protected override void OnShellContainerVmChange(IShellContainerVm value)
 {
     base.OnShellContainerVmChange(value);
     ShellContainerVm.AddOrUpdateFlyouts(LastOrderFo);
 }
Example #9
0
 private void InitPosServices(IReactiveDeliveryClient reactiveDeliveryClient, Action showWnd, IShellContainerVm vm,
                              ConnectionInfoResponse response)
 {
     try
     {
         PosService.DeletePosFoldersDataAndNewDataIfPosIsDown();
         SyncPosFiles.GetUnsyncFiles(reactiveDeliveryClient, showWnd, vm, response);
     }
     catch (Exception ex)
     {
         Log.Error("Error al iniciar los servicios de POS: ", ex);
     }
 }
Example #10
0
        private void OnInfoAccountOk(IReactiveDeliveryClient reactiveDeliveryClient, IStale <ResponseMessageData <string> > obj, Action showWnd, IShellContainerVm vm)
        {
            if (obj.IsStale)
            {
                OnInfoAccountError(ResNetwork.ERROR_NETWORK_DOWN, showWnd);
                return;
            }

            if (obj.Data.IsSuccess == false)
            {
                OnInfoAccountError(obj.Data.Message, showWnd);
                return;
            }

            ConnectionInfoResponse response;

            try
            {
                response = new JavaScriptSerializer().Deserialize <ConnectionInfoResponse>(Cypher.Decrypt(obj.Data.Data));
            }
            catch (Exception)
            {
                OnInfoAccountError("No fue posible obtener la respuesta del servidor. Revise que tenga la versión correcta en el cliente o en el servidor"
                                   , showWnd);
                return;
            }

            InitPosServices(reactiveDeliveryClient, showWnd, vm, response);
        }
Example #11
0
        private void ShowNextWindow(IReactiveDeliveryClient reactiveDeliveryClient, Action showWnd, IShellContainerVm vm)
        {
            var showWndSec = showWnd;

            reactiveDeliveryClient.ExecutionProxy.ExecuteRequest <ResponseMessageData <string>, ResponseMessageData <string> >
                (SharedConstants.Server.ACCOUNT_HUB, SharedConstants.Server.ACCOUNT_INFO_ACCOUNT_HUB_METHOD, TransferDto.SameType)
            .ObserveOn(reactiveDeliveryClient.ConcurrencyService.Dispatcher)
            .SubscribeOn(reactiveDeliveryClient.ConcurrencyService.TaskPool)
            .Subscribe(e => OnInfoAccountOk(reactiveDeliveryClient, e, showWnd, vm), i => OnInfoAccountError(i, showWndSec));
        }