Ejemplo n.º 1
0
        private void Button_DodajModel_Click(object sender, RoutedEventArgs e)
        {
            frmModel prozor = new frmModel();

            prozor.ShowDialog();
            Button_Click_Modeli(sender, e);
        }
Ejemplo n.º 2
0
        private void btnIzmeniModel_Click(object sender, RoutedEventArgs e)
        {
            try
            {
                azuriraj = true;
                frmModel prozor = new frmModel();

                konekcija.Open();
                DataRowView red = (DataRowView)CentralniGrid.SelectedItems[0];
                selektovan = red;
                string upit = "Select Model from tblModel where ModelID=" + red["ID"];

                SqlCommand    komanda = new SqlCommand(upit, konekcija);
                SqlDataReader citac   = komanda.ExecuteReader();

                while (citac.Read())
                {
                    prozor.txtNazivModela.Text = citac["Model"].ToString();
                }
                prozor.ShowDialog();
            }
            catch (ArgumentOutOfRangeException)
            {
                MessageBox.Show("Potrebno je selektovati odgovarajuci red!");
            }
            finally
            {
                if (konekcija != null)
                {
                    konekcija.Close();
                }
                Button_Click_Modeli(sender, e);
                azuriraj = false;
            }
        }
Ejemplo n.º 3
0
        private void Tvi_Selected(object sender, RoutedEventArgs e)
        {
            timer.Stop();
            TreeViewItem tvi = (TreeViewItem)sender;

            if (tvi.IsSelected)
            {
                dynamic data = tvi.Tag;
                if (_showModel)
                {
                    frmModel frm = new frmModel();
                    frm.Owner    = _main;
                    _show_answer = frm.ShowDialog() == true ? true : false;
                }
                if (!_show_answer)
                {
                    labTime.Visibility = Visibility.Visible;
                    string t = data["testTime"].ToString();
                    _testTime = double.Parse(t);
                    var time = DateTime.Parse(DateTime.Now.ToString("1970-01-01 00:00:00")).AddMilliseconds(_testTime);
                    labTime.Text = "考试时间:" + time.ToString("HH:mm:ss");
                    timer.Start();
                }
                else
                {
                    labTime.Visibility = Visibility.Hidden;
                }

                Selected_App(data);
            }
        }
Ejemplo n.º 4
0
        private void miCreateDM_Click(object sender, EventArgs e)
        {
            frmModel frm = new frmModel();

            frm.Show();
        }