Example #1
0
        protected void ok_Click(object sender, EventArgs e)
        {
            if (yariMediaTypeID == 0)
            {
                obj = new YariMediaType();
            }
            else
            {
                obj = new YariMediaType(yariMediaTypeID);
            }

            obj.Name = tbName.Text;

            if (editOnAdd)
            {
                yariMediaTypeID = obj.Save();
            }
            else
            {
                obj.Save();
            }

            if (resetOnAdd)
            {
                tbName.Text = string.Empty;
            }

            OnUpdated(EventArgs.Empty);
        }
Example #2
0
        protected override void OnPreRender(EventArgs e)
        {
            if (yariMediaTypeID != 0)
            {
                yariMediaType = new YariMediaType(yariMediaTypeID);

                #region Bind Default Folder

                //
                // Set Field Entries
                //

                ltName.Text = yariMediaType.Name.ToString();


                #endregion

                #region Bind _system Folder

                //
                // Set Field Entries
                //



                #endregion

                text = "View  - " + yariMediaType.ToString();
            }
        }
        protected void btOk_Click(object sender, EventArgs e)
        {
            YariMediaType yariMediaType = new YariMediaType(yariMediaTypeID);

            yariMediaType.Delete();

            yariMediaTypeID = 0;

            OnDeleted(EventArgs.Empty);
        }
 protected override void OnPreRender(EventArgs e)
 {
     if (yariMediaTypeID != 0)
     {
         yariMediaType = new YariMediaType(yariMediaTypeID);
         text          = "Delete - " + yariMediaType.ToString();
     }
     else
     {
         text = "Delete ";
     }
     EnsureWindowScripts();
 }
Example #5
0
        protected override void OnPreRender(EventArgs e)
        {
            if (yariMediaTypeID != 0 & loadFlag)
            {
                editYariMediaType = new YariMediaType(yariMediaTypeID);

                //
                // Set Field Entries
                //
                tbName.Text = editYariMediaType.Name;

                Text = "Edit  - " + editYariMediaType.ToString();
            }
            else
            {
                Text = "Add ";
            }
        }
Example #6
0
        protected override void OnPreRender(EventArgs e)
        {
            if (loadFlag)
            {
                if (yariMediaTypeID > 0)
                {
                    obj  = new YariMediaType(yariMediaTypeID);
                    text = "Edit  - " + obj.ToString();
                }
                else if (yariMediaTypeID <= 0)
                {
                    obj  = new YariMediaType();
                    text = "Add ";
                }

                //
                // Set Field Entries
                //
                tbName.Text = obj.Name;
            }
        }
Example #7
0
        protected void ok_Click(object sender, EventArgs e)
        {
            if (yariMediaRecordID == 0)
            {
                editYariMediaRecord = new YariMediaRecord();
            }
            else
            {
                editYariMediaRecord = new YariMediaRecord(yariMediaRecordID);
            }

            editYariMediaRecord.EndNoteReferenceID = int.Parse(tbEndNoteReferenceID.Text);
            editYariMediaRecord.PublishYear        = int.Parse(tbPublishYear.Text);
            editYariMediaRecord.Title             = tbTitle.Text;
            editYariMediaRecord.Pages             = int.Parse(tbPages.Text);
            editYariMediaRecord.Edition           = tbEdition.Text;
            editYariMediaRecord.Isbn              = tbIsbn.Text;
            editYariMediaRecord.Label             = tbLabel.Text;
            editYariMediaRecord.AbstractText      = ftbAbstractText.ContentHTML;
            editYariMediaRecord.ContentsText      = ftbContentsText.ContentHTML;
            editYariMediaRecord.NotesText         = tbNotesText.Text;
            editYariMediaRecord.AmazonFillDate    = deAmazonFillDate.Date;
            editYariMediaRecord.AmazonRefreshDate = deAmazonRefreshDate.Date;
            editYariMediaRecord.ImageUrlSmall     = tbImageUrlSmall.Text;
            editYariMediaRecord.ImageUrlMedium    = tbImageUrlMedium.Text;
            editYariMediaRecord.ImageUrlLarge     = tbImageUrlLarge.Text;
            editYariMediaRecord.AbstractEnabled   = cbAbstractEnabled.Checked;
            editYariMediaRecord.ContentsEnabled   = cbContentsEnabled.Checked;
            editYariMediaRecord.NotesEnabled      = cbNotesEnabled.Checked;
            editYariMediaRecord.Authors           = tbAuthors.Text;
            editYariMediaRecord.SecondaryAuthors  = tbSecondaryAuthors.Text;
            editYariMediaRecord.Publisher         = tbPublisher.Text;

            if (msMediaType.SelectedItem != null)
            {
                editYariMediaRecord.MediaType = YariMediaType.NewPlaceHolder(
                    int.Parse(msMediaType.SelectedItem.Value));
            }
            else
            {
                editYariMediaRecord.MediaType = null;
            }

            if (msKeywords.IsChanged)
            {
                editYariMediaRecord.Keywords = new YariMediaKeywordCollection();
                foreach (ListItem i in msKeywords.Items)
                {
                    if (i.Selected)
                    {
                        editYariMediaRecord.Keywords.Add(YariMediaKeyword.NewPlaceHolder(int.Parse(i.Value)));
                    }
                }
            }

            if (editOnAdd)
            {
                yariMediaRecordID = editYariMediaRecord.Save();
            }
            else
            {
                editYariMediaRecord.Save();
            }

            if (resetOnAdd)
            {
                tbEndNoteReferenceID.Text = string.Empty;
                tbPublishYear.Text        = string.Empty;
                tbTitle.Text   = string.Empty;
                tbPages.Text   = string.Empty;
                tbEdition.Text = string.Empty;
                tbIsbn.Text    = string.Empty;
                tbLabel.Text   = string.Empty;
                ftbAbstractText.ContentHTML = string.Empty;
                ftbContentsText.ContentHTML = string.Empty;
                tbNotesText.Text            = string.Empty;
                deAmazonFillDate.Date       = DateTime.Now;
                deAmazonRefreshDate.Date    = DateTime.Now;
                tbImageUrlSmall.Text        = string.Empty;
                tbImageUrlMedium.Text       = string.Empty;
                tbImageUrlLarge.Text        = string.Empty;
                cbAbstractEnabled.Checked   = false;
                cbContentsEnabled.Checked   = false;
                cbNotesEnabled.Checked      = false;
                tbAuthors.Text            = string.Empty;
                tbSecondaryAuthors.Text   = string.Empty;
                tbPublisher.Text          = string.Empty;
                msMediaType.SelectedIndex = 0;
            }

            OnUpdated(EventArgs.Empty);
        }