コード例 #1
0
        private void button2_Click(object sender, EventArgs e)
        {
            Mashin mashin = поиск(textBox1.Text);

            if (mashin == null)
            {
                MD[amountel].Update(textBox1.Text, textBox2.Text, textBox3.Text, textBox4.Text);

                amountel++;
                comboBox1.Items.Add(textBox1.Text);



                using (FileStream fs = new FileStream("C:\\Users\\Mifa\\Desktop\\people.dat", FileMode.OpenOrCreate))
                {
                    formatter.Serialize(fs, list);
                };
            }
            else
            {
                mashin.Num   = textBox1.Text;
                mashin.Model = textBox2.Text;

                mashin.Color = textBox3.Text;
                mashin.FIO   = textBox4.Text;
            }
            button3_Click(sender, e);
        }
コード例 #2
0
        private void button1_Click(object sender, EventArgs e)
        {
            Mashin mashin = поиск(textBox1.Text);

            if (mashin != null)
            {
                list.Remove(mashin);
                comboBox1.Items.Remove(textBox1.Text);
                button3_Click(sender, e);
            }
        }
コード例 #3
0
ファイル: CarStation.cs プロジェクト: AnnaShherbakova/Task4_5
        public void FileARepairCar(Factory Target)
        {
            FixMachine Mashin;

            lock (fixMachines)
            {
                evtObjF.WaitOne();
                //while (fixMachines.Count == 0) ;
                Mashin = fixMachines.Dequeue() as FixMachine;
                if (fixMachines.Count == 0)
                {
                    evtObjF.Reset();
                }
            }
            Mashin.Movement(Target);
        }
コード例 #4
0
 private void ComboBox1_KeyPress(object sender, System.Windows.Forms.KeyPressEventArgs e)
 {
     if (e.KeyChar == (char)Keys.Enter)
     {
         Mashin mashin = поиск(comboBox1.Text);
         if (mashin != null)
         {
             groupBox1.Visible = true;
             textBox1.Text     = mashin.Num;
             textBox2.Text     = mashin.Model;
             textBox3.Text     = mashin.Color;
             textBox4.Text     = mashin.FIO;
         }
         else
         {
             MessageBox.Show("Элемент не найден в базе");
             string str = comboBox1.Text;
             button3_Click(sender, e);
             textBox1.Text = str;
         }
         groupBox1.Visible = true;
     }
 }