Ejemplo n.º 1
0
        public void ReloadView(Guid documentId)
        {
            Document = VfApplication.CurrentContext.GetDocument(documentId);

            tbName.DataBindings.Clear();
            tbAuthor.DataBindings.Clear();
            tbYear.DataBindings.Clear();
            tbGenre.DataBindings.Clear();
            tbGroup.DataBindings.Clear();
            tbComments.DataBindings.Clear();
            tbAudioDirectory.DataBindings.Clear();
            tbFileIndex.DataBindings.Clear();

            _documentBindingSource.DataSource = Document;

            tbName.DataBindings.Add("Text", _documentBindingSource, "Title", true, DataSourceUpdateMode.OnPropertyChanged);
            tbAuthor.DataBindings.Add("Text", _documentBindingSource, "Author", true, DataSourceUpdateMode.OnPropertyChanged);
            tbYear.DataBindings.Add("Text", _documentBindingSource, "Year", true, DataSourceUpdateMode.OnPropertyChanged);
            tbGenre.DataBindings.Add("Text", _documentBindingSource, "Genre", true, DataSourceUpdateMode.OnPropertyChanged);
            tbGroup.DataBindings.Add("Text", _documentBindingSource, "Group", true, DataSourceUpdateMode.OnPropertyChanged);
            tbComments.DataBindings.Add("Text", _documentBindingSource, "Comments", true, DataSourceUpdateMode.OnPropertyChanged);
            tbAudioDirectory.DataBindings.Add("Value", _documentBindingSource, "AudioDirectory", true, DataSourceUpdateMode.OnPropertyChanged);
            tbFileIndex.DataBindings.Add("Text", _documentBindingSource, "FileIndex", true, DataSourceUpdateMode.OnPropertyChanged);

            UpdateCover();
        }
Ejemplo n.º 2
0
        /// <summary>
        /// Updates the document entity.
        /// </summary>
        /// <param name="model">The model.</param>
        /// <param name="row">The row.</param>
        /// <returns><c>true</c> if XXXX, <c>false</c> otherwise</returns>
        public bool UpdateDocumentEntity(IVfDocumentModel model, VfSpeaker.Data.DataStore.VfDocumentRow row)
        {
            row.Title = model.Title;
            row.Author = model.Author;
            row.Genre = model.Genre;
            row.Group = model.Group;
            row.Year = model.Year;
            row.Comments = model.Comments;
            row.AudioDirectory = model.AudioDirectory;
            row.Image = Convert.ToBase64String(model.Image);
            row.FileIndex = model.FileIndex;

            return true;
        }
Ejemplo n.º 3
0
        /// <summary>
        /// Updates the document.
        /// </summary>
        /// <param name="document">The document.</param>
        /// <returns>Guid.</returns>
        public Guid UpdateDocument(IVfDocumentModel document)
        {
            Initialize();

            DataStore.VfDocumentRow row = ds.VfDocument.FindById(document.Id);

            UpdateDocumentEntity(document, row);

            UpdateDataStore(ds);

            return row.Id;
        }
Ejemplo n.º 4
0
        /// <summary>
        /// Adds the document.
        /// </summary>
        /// <param name="document">The document.</param>
        /// <returns>Guid.</returns>
        public Guid AddDocument(IVfDocumentModel document)
        {
            Initialize();

            DataStore.VfDocumentRow row = ds.VfDocument.NewVfDocumentRow();

            row.Id = Guid.NewGuid();
            row.Title = document.Title;
            ds.VfDocument.AddVfDocumentRow(row);

            UpdateDataStore(ds);

            return row.Id;
        }
Ejemplo n.º 5
0
 /// <summary>
 /// Saves the document.
 /// </summary>
 /// <param name="document">The document.</param>
 public void SaveDocument(IVfDocumentModel document)
 {
     Repository.UpdateDocument(document);
 }
Ejemplo n.º 6
0
 /// <summary>
 /// Lists the parts.
 /// </summary>
 /// <param name="document">The document.</param>
 public void ListParts(IVfDocumentModel document)
 {
 }