示例#1
0
        /// <summary>Called when [volume number button click].
        /// Check that volume test does not match title or series text. Place volume name and or number into text box.</summary>
        /// <param name="sender">The source of the event.</param>
        /// <param name="e">The <see cref="EventArgs" /> instance containing the event data.</param>
        private void OnVolumeNumberButton_Click(object sender, EventArgs e)
        {
            var validate = new ValidationClass();

            var len = txtVolume.SelectionLength;

            if (len <= 0)
            {
                return;
            }

            GetSelectedBookVolumeText();

            if (string.IsNullOrEmpty(BookDataProperties.BookSeriesVolumeNumber))
            {
                return;
            }

            txtVolume.Enabled = true;
            txtVolume.Text    = BookDataProperties.BookSeriesVolumeNumber;

            if (validate.ValidateTitleVolumeTextDoesNotMatch())
            {
                var msgBox = new MyMessageBoxClass();

                msgBox.Msg = "The book title name can not be the same as the book volume.";
                msgBox.ShowErrorMessageBox();
                return;
            }

            if (validate.ValidateSeriesVolumeTextDoesNotMatch())
            {
                var msgBox = new MyMessageBoxClass();
                msgBox.Msg = "The book series name can not be the same as the book volume.";
                msgBox.ShowErrorMessageBox();
                return;
            }

            btnFormat.Enabled = true;
        }