Ejemplo n.º 1
0
 public void CreateNewItem(object item)
 {
     _formState    = AddEditFormState.Add;
     _editableItem = item;
     CreateControls();
     DisplayEditableItem();
 }
Ejemplo n.º 2
0
 /// <summary>
 /// Метод устанавливающий редактируемый объект
 /// </summary>
 /// <param name="editItem"></param>
 public virtual void SetItemForEditing(object editItem)
 {
     CheckPresenter();
     EditableItem = editItem;
     _formState   = AddEditFormState.Edit;
     //(Presenter as BaseAddEditPresenter).SetItemForEditing(editItem);
 }
Ejemplo n.º 3
0
 public void SetItemForEditing(object item)
 {
     _formState    = AddEditFormState.Edit;
     _editableItem = item;
     CreateControls();
     DisplayEditableItem();
 }
Ejemplo n.º 4
0
 public void SetItemForEditing(object item)
 {
     _formState = AddEditFormState.Edit;
     _editableItem = item;
     CreateControls();
     DisplayEditableItem();
 }
Ejemplo n.º 5
0
 public void CreateNewItem(object item)
 {
     _formState = AddEditFormState.Add;
     _editableItem = item;
     CreateControls();
     DisplayEditableItem();
 }
        public AddEditIssuedBookForm(IssuedBook issuedBook, Book book, Reader reader,
                                     IssuedBooksRepository issuedBooksRepository)
        {
            InitializeComponent();

            this.issuedBooksRepository = issuedBooksRepository;
            if (issuedBook == null)
            {
                this.Text   = "Выдача книги";
                state       = AddEditFormState.Add;
                this.book   = book;
                this.reader = reader;
                issuedBook  = new IssuedBook
                {
                    IdBook     = book.Id,
                    IdReader   = reader.Id,
                    DateIssue  = DateTime.Now.Date,
                    DateReturn = DateTime.Now.Date
                };

                this.issuedBook = issuedBook;
            }
            else
            {
                this.Text     = String.Format("Изменение выдачи (ID = {0})", issuedBook.Id);
                buttonOK.Text = "ОК";
                state         = AddEditFormState.Edit;
                dateTimeIssuePicker.Enabled = true;
                this.book       = book;
                this.reader     = reader;
                this.issuedBook = issuedBook;
            }

            BindDataToControls();
        }
 public AddEditReaderForm(Reader reader, ReadersRepository readersRepository)
 {
     InitializeComponent();
     this.readersRepository = readersRepository;
     if (reader == null)
     {
         this.reader = new Reader();
         state       = AddEditFormState.Add;
         Text        = "Добавление нового читателя";
     }
     else
     {
         this.reader = reader;
         state       = AddEditFormState.Edit;
         Text        = String.Format("Изменение читателя (ID = {0})", this.reader.Id);
         BindDataToControls();
     }
 }
 public AddEditBookForm(Book book, BooksRepository booksRepository)
 {
     InitializeComponent();
     this.booksRepository = booksRepository;
     if (book == null)
     {
         this.book = new Book();
         state     = AddEditFormState.Add;
         Text      = "Добавление новой книги";
     }
     else
     {
         this.book = book;
         state     = AddEditFormState.Edit;
         Text      = String.Format("Изменение книги (ID = {0})", this.book.Id);
         BindDataToControls();
     }
     SetupControls();
 }
Ejemplo n.º 9
0
 public virtual void CreateNewItem()
 {
     CheckPresenter();
     _formState = AddEditFormState.Add;
     (Presenter as BaseAddEditPresenter).CreateNewItem();
 }
Ejemplo n.º 10
0
 public virtual void SetFormState(AddEditFormState state)
 {
     _formState = state;
 }
Ejemplo n.º 11
0
 /// <summary>
 /// Метод устанавливающий редактируемый объект
 /// </summary>
 /// <param name="editItem"></param>
 public virtual void SetItemForEditing(object editItem)
 {
     CheckPresenter();
     EditableItem = editItem;
     _formState = AddEditFormState.Edit;
     //(Presenter as BaseAddEditPresenter).SetItemForEditing(editItem);
 }
Ejemplo n.º 12
0
 public virtual void SetFormState(AddEditFormState state)
 {
     _formState = state;
 }
Ejemplo n.º 13
0
 public virtual void CreateNewItem()
 {
     CheckPresenter();
     _formState = AddEditFormState.Add;
     (Presenter as BaseAddEditPresenter).CreateNewItem();
 }
Ejemplo n.º 14
0
 public void SetFormState(AddEditFormState formState)
 {
     _formState = formState;
 }