Ejemplo n.º 1
0
        private async void OnSaveAdd()
        {
            var editingGL = Mapper.Map <EditableGL, GL>(GL);

            try
            {
                if (EditMode)
                {
                    await _gLsService.UpdateGLAsync(editingGL);
                }
                else
                {
                    await _gLsService.AddGLAsync(editingGL);
                }
                //   Done?.Invoke();
            }
            catch (Exception ex)
            {
                Failed(ex);
            }
            finally
            {
                GL = null;
            }
        }
Ejemplo n.º 2
0
        public AddEditGLViewModel(IGLsService gLsService, ISystemAccountingSettingsService systemAccountingSettingsService)
        {
            _systemAccountingSettingsService = systemAccountingSettingsService;

            _gLsService = gLsService;

            CancelCommand  = new RelayCommand(OnCancel);
            SaveCommand    = new RelayCommand(OnSave, CanSave);
            SaveAddCommand = new RelayCommand(OnSaveAdd, CanSaveAdd);
            GL             = new EditableGL();
        }
Ejemplo n.º 3
0
 public void SetGL(GL gL)
 {
     GL = Mapper.Map <GL, EditableGL>(gL);
     GL.ValidationDelegate += GL_ValidationDelegate;
     GL.ErrorsChanged      += RaiseCanExecuteChanged;
 }