Example #1
0
        /// <summary>
        /// Редактирование диска
        /// </summary>
        /// <param name="sender"></param>
        /// <param name="e"></param>
        private void buttonDiskEdit_Click(object sender, EventArgs e)
        {
            if (listBoxDiskNumber.SelectedIndex < 0)
            {
                MessageBox.Show("Диск не выделен", "Информация", MessageBoxButtons.OK, MessageBoxIcon.Information);
                return;
            }
            if (listBoxDiskNumber.SelectedIndex == 0)
            {
                MessageBox.Show("Нельзя редактировать данную запись", "Информация", MessageBoxButtons.OK, MessageBoxIcon.Information);
                return;
            }
            var editDiskForm = new AddEditDiskForm(this, AddEditState.Edit, this.mFilmotecClass, this.mSettingClass, this.mDiskInfos[listBoxDiskNumber.SelectedIndex], listBoxDiskNumber.SelectedIndex);

            editDiskForm.ShowDialog();
            this.mDiskInfos = this.mFilmotecClass.DiskInfo;
            for (int i = 0; i < this.mDiskInfos.Length; i++)
            {
                if (NewDiskNumber == this.mDiskInfos[i].Number)
                {
                    listBoxDiskNumber.SelectedIndex = i;
                    break;
                }
            }
            this.mFilmInfos = this.mFilmotecClass.GetFilmInfo(this.mDiskInfos[listBoxDiskNumber.SelectedIndex].Number, string.Empty, string.Empty);
            DisplayInfos();
        }
Example #2
0
        /// <summary>
        /// Добавление диска
        /// </summary>
        /// <param name="sender"></param>
        /// <param name="e"></param>
        private void buttonDiskAdd_Click(object sender, EventArgs e)
        {
            var addDiskForm = new AddEditDiskForm(this, AddEditState.Add, this.mFilmotecClass, this.mSettingClass, this.mDiskInfos[listBoxDiskNumber.SelectedIndex], listBoxDiskNumber.SelectedIndex);

            addDiskForm.ShowDialog();
            this.mDiskInfos = this.mFilmotecClass.DiskInfo;
            DisplayInfos();
        }