コード例 #1
0
 private void ClearForm()
 {
     TitleTextBox.Clear();
     FileNameTextBox.Clear();
     AuthorTextBox.Clear();
     AlbumTextBox.Clear();
 }
コード例 #2
0
        private void SaveButton_Click(object sender, EventArgs e)
        {
            notesTable.Rows.Add(TitleTextBox.Text, BodyTextBox.Text);

            TitleTextBox.Clear();
            BodyTextBox.Clear();
        }
コード例 #3
0
        private void SaveButton_Click(object sender, EventArgs e)
        {
            new LogController().AddLogEntry(TitleTextBox.Text, DateTimePicker.Value, StartTimeTimePicker.Value, EndTimeTimePicker.Value, HoursWorkedTimePicker.Value, DescriptionTextBox.Text, AuthorTextBox.Text);

            TitleTextBox.Clear();
            DescriptionTextBox.Clear();
            AuthorTextBox.Clear();
            MessageBox.Show("New log entry added!", "Log added!");
        }
コード例 #4
0
        private void ClearForm()
        {
            TitleTextBox.Clear();
            StartBidTextBox.Clear();
            MinStepTextBox.Clear();
            ProductComboBox.SelectedItem = null;

            EditLot.IsEnabled = false;
        }
コード例 #5
0
 /// <summary>
 /// Clears fields and sets necessary fields to prepare for
 /// save.
 /// </summary>
 /// <param name="sender"></param>
 /// <param name="e"></param>
 private void NewBookButton_Click(object sender, EventArgs e)
 {
     AuthorTextBox.Clear();
     TitleTextBox.Clear();
     ISBNTextBox.Clear();
     PriceTextBox.Clear();
     BookSelectBox.Enabled = false;
     SaveButton.Enabled    = true;
     CancelButton.Enabled  = true;
 }
コード例 #6
0
        private void RestoreDefaultValues()
        {
            TitleTextBox.Clear();
            DescriptionTextBox.Clear();
            StartDatePicker.Value = _dateTimeProvider.Today;
            DueDatePicker.Value   = _dateTimeProvider.Today;

            StatusBox.SelectedIndex   = 0;
            PriorityBox.SelectedIndex = 0;
            UsersBox.SelectedIndex    = 0;
        }
コード例 #7
0
        private void ClearButton_Click(object sender, EventArgs e)
        {
            //Clear Textboxes
            TitleTextBox.Clear();
            PriceTextBox.Clear();
            ExtendedPriceTextBox.Clear();
            DiscountedPriceTextBox.Clear();
            DiscountTextBox.Clear();
            QuantityTextBox.Clear();

            //Set focus on Quantity
            QuantityTextBox.Focus();
        }
コード例 #8
0
        private void SaveButton_Click(object sender, EventArgs e)
        {
            // Check for empty boxes.
            if (AuthorTextBox.Text == "" || TitleTextBox.Text == "" || ISBNTextBox.Text == "" || PriceTextBox.Text == "" ||
                !Regex.IsMatch(AuthorTextBox.Text, author) || !Regex.IsMatch(TitleTextBox.Text, title) || !Regex.IsMatch(ISBNTextBox.Text, isbn) ||
                !Regex.IsMatch(PriceTextBox.Text, price))
            {
                MessageBox.Show("Invalid Entry:\nAuthor must be First Last\nISBN must be digits only\nPrice must be $xxx.xx format");
                return;
            }

            // Display messagebox -> If user clicks no, cancel database update.
            if (MessageBox.Show("Confirm Update?", "", MessageBoxButtons.YesNo) == DialogResult.No)
            {
                return;
            }

            string          ConnectionString = "server=localhost;user=root;database=book store;password="******"Insert into books values(null,'{TitleTextBox.Text}','{AuthorTextBox.Text}','{ISBNTextBox.Text}','{PriceTextBox.Text}')";
                cmd.Connection  = DBConnect;
                cmd.ExecuteNonQuery();
                DBConnect.Close();

                AuthorTextBox.Clear();
                TitleTextBox.Clear();
                ISBNTextBox.Clear();
                PriceTextBox.Clear();

                // Call function to update the combobox with new book added.
                BookSelectComboBox_Click(sender, e);

                BookSelectBox.Enabled = true;
                SaveButton.Enabled    = false;
                MessageBox.Show("Book added to database.");
                return;
            }
            // Else update the currently selected book
            cmd.CommandText = $"Update books set title='{TitleTextBox.Text}', author='{AuthorTextBox.Text}',isbn='{ISBNTextBox.Text}',price='{PriceTextBox.Text}' where title='{BookSelectBox.Text}'";
            cmd.Connection  = DBConnect;
            cmd.ExecuteNonQuery();
            DBConnect.Close();
            MessageBox.Show("Book successfully updated.");
        }
コード例 #9
0
        private void ResetFormControl()
        {
            TitleTextBox.Clear();
            DescriptionTextBox.Clear();
            TitleTextBox.Focus(); //moves cursor to TitleTextBox

            // Check if form is loaded for updated process
            if (this.IsUpdate)
            {
                this.RoleId          = 0;
                this.IsUpdate        = false;
                SaveButton.Text      = "Save Information";
                DeleteButton.Enabled = false;
            }
        }
コード例 #10
0
 private void AddButton_Click(object sender, EventArgs e)
 {
     if (TitleTextBox.Text.Length < 2)
     {
         MessageBox.Show("Слишком короткое название");
     }
     else
     {
         DataRow dr = bookWorldDataSet.Tables["Тип_Товара"].NewRow();
         dr["Наименование"] = TitleTextBox.Text;
         if (Status == 0)
         {
             try
             {
                 bookWorldDataSet.Tables["Тип_Товара"].Rows.Add(dr);
                 this.Validate();
                 this.tableAdapterManager.UpdateAll(this.bookWorldDataSet);
                 MessageBox.Show("Запись успешно добавлена");
                 this.Dispose();
             }
             catch (Exception ex)
             {
                 StaticHelper.ErrorNotifier(ex);
                 TitleTextBox.Clear();
                 TitleTextBox.Focus();
             }
         }
         else
         {
             try
             {
                 тип_ТовараTableAdapter.Update(TitleTextBox.Text, ID, Title);
                 this.Validate();
                 this.tableAdapterManager.UpdateAll(bookWorldDataSet);
                 MessageBox.Show("Запись успешно изменена");
                 this.Dispose();
             }
             catch (Exception ex)
             {
                 StaticHelper.ErrorNotifier(ex);
             }
         }
     }
 }
コード例 #11
0
ファイル: FeedbackForm.cs プロジェクト: wljcom/marukotoolbox
        private void PostButton_Click(object sender, EventArgs e)
        {
            string name  = UserNameTextBox.Text;
            string qq    = QQTextBox.Text;
            string email = EmailTextBox.Text;
            string title = TitleTextBox.Text;
            string msg   = MessageTextBox.Text;
            string log   = "";

            if (!string.IsNullOrEmpty(LogPathTextBox.Text))
            {
                if (File.Exists(LogPathTextBox.Text))
                {
                    log = ReadLogFile(LogPathTextBox.Text);
                }
                else
                {
                    ShowErrorMessage("请输入正确的日志文件路径!");
                    return;
                }
            }

            if (string.IsNullOrEmpty(name) || string.IsNullOrEmpty(title) || string.IsNullOrEmpty(email) || string.IsNullOrEmpty(msg))
            {
                ShowWarningMessage("请填写以上必填项后再提交!");
                return;
            }

            ServiceReference.WebServiceSoapClient service = new ServiceReference.WebServiceSoapClient();
            bool flag = service.PostFeedback(name, qq, email, title, msg, log);

            if (flag)
            {
                ShowInfoMessage("提交成功,感谢反馈!");
            }
            else
            {
                ShowErrorMessage("提交失败!");
            }
            TitleTextBox.Clear();
            MessageTextBox.Clear();
        }
コード例 #12
0
        private void CleanUp()
        {
            TitleTextBox.Clear();
            AuthorTextBox.Clear();
            DescTextBox.Clear();
            ShortcutTextBox.Clear();

            IdTextBox.Clear();
            ToolTipTextBox.Clear();
            DefaultTextBox.Clear();

            CodeRichTextBox.Clear();
            LiteralListBox.Items.Clear();
            LiteralList.Clear();

            foreach (TreeNode tn in DllAndNamespaceTreeView.Nodes)
            {
                tn.Checked = false;
            }
        }
コード例 #13
0
        private void button_Click(object sender, RoutedEventArgs e)
        {
            Movie submittedMovie = new Movie(TitleTextBox.Text,
                                             GenreTextBox.Text,
                                             Double.Parse(ReviewScoreTextBox.Text),
                                             DirectorTextBox.Text,
                                             LengthTextBox.Text);

            movieList.Add(submittedMovie);
            //submittedMovie.Title = TitleTextBox.Text;
            //submittedMovie.Genre = GenreTextBox.Text;
            //submitedMovie.ReviewScore = Convert.ToDouble(ReviewScoreTextBox.Text);
            //submittedMovie.ReviewScore = Double.Parse(ReviewScoreTextBox.Text);

            //submittedMovie.DisplayInformation();

            TitleTextBox.Clear();
            GenreTextBox.Clear();
            ReviewScoreTextBox.Clear();
            DirectorTextBox.Clear();
            LengthTextBox.Clear();
        }
コード例 #14
0
 private void NewButton_Click(object sender, EventArgs e)
 {
     TitleTextBox.Clear();
     BodyTextBox.Clear();
 }