Esempio n. 1
0
 protected void FillHistoricView(IEditView view)
 {
     FillBaseView(view);
     view.editUserId   = 4;
     view.createUserId = 3;
     view.editDate     = DateTime.Now;
 }
Esempio n. 2
0
        public EditPresenter(IEditView view, IUsersRepository userRepository)
        {
            this.view           = view;
            this.userRepository = userRepository;

            view.AddUser  += AddUser;
            view.EditUser += EditUser;
        }
Esempio n. 3
0
 public EditPresenter(IEditView view)
 {
     _view                 = view;
     _view.Storage         = _model.GetIngredients();
     _view.menu            = _model.GetMenu(DateTime.Parse(closeTime));
     _view.AddingDish     += new EventHandler <DishEventArgs>(OnAddingDish);
     _view.RefreshingMenu += new EventHandler <EventArgs>(OnRefreshingMenu);
     _view.RemovingDish   += new EventHandler <EventArgs>(OnRemovingDish);
 }
Esempio n. 4
0
        private void OnFilmsViewEditRequested(object sender, FormLocationWithFilmInfo info)
        {
            EditForm form = new EditForm();

            if (ShowForm(form, info.Location))
            {
                editView = form;
                editView.SetFilmInfo(info.FilmName, info.FilmCountry, info.FilmYear);
                editView.EditStarted += OnEditViewEditStarted;
            }
        }
Esempio n. 5
0
        // Edit vview applications

        public void ApplyToEditView(EntityPackage package, IEditView view)
        {
            ApplyToBaseView(package.Entity, view);

            //History has a creator and an editor. The create date comes from base
            var creatorRelation = package.GetRelation(Keys.CreatorRelation);

            view.editDate     = (DateTime)creatorRelation.createDateProper();
            view.createUserId = creatorRelation.entityId1;
            view.editUserId   = long.Parse(creatorRelation.value);
        }
Esempio n. 6
0
 public EditVideoViewModel(ILibraryService libraryService, IEditView view, IEventAggregator eventAggregator)
     : base(view)
 {
     this._libraryService = libraryService;
     this._eventAggregator = eventAggregator;
     this.CategoryViewModels = new ObservableCollection<CategoryViewModel>();
     this.Tags = new ObservableCollection<Tag>();
     this.CreateCategories(libraryService);
     this.CreateTags(libraryService);
     eventAggregator.GetEvent<VideoEditing>().Subscribe(v => { this.Video = v; });
     //eventAggregator.GetEvent<VideoEdited>().Subscribe(this.VideoEdited);
     this.CreateCategoryCommand = new DelegateCommand(this.CreateCategory);
 }
Esempio n. 7
0
        public EditPresenter(IEditView ve, BindingList <Valute> LVal, BindingList <Valute> RVal)
        {
            EditValuteList1 = LVal;
            bufList         = RVal;
            EditView        = ve;
            EditView.Value  = "1";
            EditView.ListBoxValuteLeft_Add(EditValuteList1);

            EditView.TextChangedValue   += View_TextChangeValue;
            EditView.SelectedEditValute += View_SelectedValuteEdit;

            EditView.Show();
        }
Esempio n. 8
0
        public void Edit()
        {
            IEditView editView = (IEditView)_viewFactory.Create("EditView");
            if (_view.SelectedConfiguration != null)
            {
                editView.Configuration = _view.SelectedConfiguration;
                editView.EditMode = EditMode.Edit;
                editView.ShowDialog();
            }
            else
                _view.ShowMessage(MessageType.Error,
                    LocalizableStringHelper.GetLocalizableString("InvalidConfigurationError_Tittle"),
                    LocalizableStringHelper.GetLocalizableString("InvalidConfigurationError_Text"));

        }
Esempio n. 9
0
        //ctor
        public EditPresenter(IEditView editView, Person person)
        {
            _editView = editView ?? throw new ArgumentNullException(nameof(editView));

            //редактируемый
            _editView.CurrentPerson = person ?? throw new ArgumentNullException(nameof(person));

            //кнопка
            _editView.OkPerson = new SimpleButtonEventHandler(OnOk, CanOk);
            _editView.OkPerson.CheckEnabled();

            //событие изменений свойств у редактируемого
            _editView.PropertyChanged = new SimpleEventHandler(OnPropertyChanged);

            //правила для проверки
            SetCheckRules();
        }
Esempio n. 10
0
        public void ApplyFromEditView(IEditView view, EntityPackage package, string type)
        {
            ApplyFromBaseView(view, package.Entity);

            package.Entity.type = type;

            var relation = new EntityRelation()
            {
                entityId1  = view.createUserId,
                entityId2  = view.id,
                type       = Keys.CreatorRelation,
                value      = view.editUserId.ToString(),
                createDate = view.editDate
            };

            package.Add(relation);
        }
Esempio n. 11
0
        private void ShowEdit(IEditView editView, User user)
        {
            if (user == null)
            {
                user = new User()
                {
                    Id   = 0,
                    Name = string.Empty,
                    Age  = 30
                };
            }

            var editPresenter = new EditPresenter(editView, usersRepository);

            editPresenter.MainPresenter = this;
            editPresenter.Edit(user);
        }
Esempio n. 12
0
 protected virtual void AttachEditEvents(IEditView <T> editView)
 {
 }
Esempio n. 13
0
 public void SetView(IEditView view)
 {
     _view = view;
 }
 /// <summary>
 /// The <see cref="EditPresenter"/> constructor will receive the <see cref="IEditView"/> interface from the
 /// <see cref="Views.Windows.Dialogs.EditWindow"/> and couple together with the view.
 /// </summary>
 /// <param name="view"></param>
 public EditPresenter(IEditView view)
 {
     _view = view;
 }
Esempio n. 15
0
 public void New()
 {
     IEditView editView = (IEditView)_viewFactory.Create("EditView");
     editView.EditMode = EditMode.New;
     if (editView.ShowDialog() == DialogResult.OK) UpdateView();
 }