コード例 #1
0
        public void GetItemsWorking(Appoint obj)//получаем список рабочих
        {
            if (workings.Count != 0)
            {
                workings.Clear();
            }

            try
            {
                MySqlConnection conn1 = new MySqlConnection(My_Project1.Properties.Settings.Default.CoonStringPersonal);
                conn1.Open();


                MySqlCommand command1 = new MySqlCommand("SELECT *FROM personal", conn1);

                MySqlDataReader reader1 = command1.ExecuteReader();
                while (reader1.Read())
                {
                    workings.Add(new Working(reader1[1].ToString()));
                    obj.cbWorking.Items.Add(reader1[1].ToString());
                }
                conn1.Close();
                reader1.Close();
            }
            catch (Exception exc)
            {
                MessageBox.Show(exc.Message, "ERROR", MessageBoxButton.OK, MessageBoxImage.Error);
            }
        }
コード例 #2
0
 private void dgOrder_MouseUp(object sender, System.Windows.Input.MouseButtonEventArgs e)
 {
     try
     {
         Appoint obj = new Appoint();
         obj.tbNameOrder.Text = (dgOrder.Items[dgOrder.SelectedIndex] as Order).NAME_ORDER;
         GetItemsWorking(obj);
         obj.ShowDialog();
         ShowTableOrder();
         dgOrder_Loaded(sender, e);
     }
     catch (Exception exc)
     {
         MessageBox.Show(exc.Message, "ERROR", MessageBoxButton.OK, MessageBoxImage.Error);
     }
 }