Пример #1
0
        private void UpdateZub_Click(object sender, RoutedEventArgs e)
        {
            if (ZubText.Text == "")
            {
                string           sMessageBoxText = "Čuvanjem praznog polja, zub će se resetovati (postaće bezbojan)      Da li želite da sačuvate prazno polje ?";
                string           sCaption        = "Upozorenje";
                MessageBoxButton btnMessageBox   = MessageBoxButton.YesNo;
                MessageBoxImage  yncMessageBox   = MessageBoxImage.Warning;
                MessageBoxResult rsltMessageBox  = MessageBox.Show(sMessageBoxText, sCaption, btnMessageBox, yncMessageBox);

                switch (rsltMessageBox)
                {
                case MessageBoxResult.Yes:
                    MyZub2();
                    MyZub();
                    ZubDataGrid();
                    ZubText.Clear();
                    // Close();
                    break;

                case MessageBoxResult.No:

                    break;
                }
            }
            else
            {
                MyZub2();
                MyZub();
                ZubDataGrid();
                ZubText.Clear();
            }
        }
Пример #2
0
 private void Refresh_Click(object sender, RoutedEventArgs e)
 {
     ZubDataGrid();
     ZubText.Clear();
     UpdateZub.IsEnabled = true;
     Izmeni.IsEnabled    = false;
 }
Пример #3
0
        public void MyZubDelete()
        {
            conn.Open();
            MySqlCommand comm = conn.CreateCommand();

            comm.CommandText = "delete from zub_beleske where id=" + IDDG + " ";
            comm.ExecuteNonQuery();
            conn.Close();
            ZubText.Clear();
        }
Пример #4
0
        private void Izmeni_Click(object sender, RoutedEventArgs e)
        {
            string updz = ZubText.Text;

            conn.Open();

            MySqlCommand comm = conn.CreateCommand();

            comm.CommandText = "update zub_beleske set beleske = '" + updz + "' where id = '" + IDDG + "' ";

            comm.ExecuteNonQuery();
            conn.Close();
            ZubDataGrid();
            ZubText.Clear();
            UpdateZub.IsEnabled = true;
            Izmeni.IsEnabled    = false;
        }