Beispiel #1
0
        private void UpdateScanButton_Click(object sender, EventArgs e)
        {
            if (NameTextBox.Text == "" || PriceTextBox.Text == "")
            {
                MessageBox.Show("Please, enter at least the scan name and price.");
            }
            else
            {
                int r = controllerObj.A_UpdateScan(Convert.ToInt32(ScansComboBox.SelectedValue),
                                                   ScansComboBox.Text.ToString(),
                                                   Convert.ToInt32(PriceTextBox.Text.ToString()));

                if (r > 0)
                {
                    MessageBox.Show("Scan updated successfully.");

                    DataTable dt1 = controllerObj.SelectScanIDsNames();
                    ScansComboBox.DataSource    = dt1;
                    ScansComboBox.DisplayMember = "Name";
                    ScansComboBox.ValueMember   = "SID";
                }
                else
                {
                    MessageBox.Show("Error in updating scan.");
                }
            }
        }