Exemple #1
0
        private void Form_Load(object sender, EventArgs e)
        {
            textBoxCount.Text = APS.count.ToString();
            APS newAbstractAPS = new APS("Наша станция", 12345, "ул. Рождественского, 51", 1100, 35.50, "Стандартный", 900);

            collect.Add(newAbstractAPS);
            textBoxIndex.Text = (collect.Count - 1).ToString();
            buttonSelect_Click(null, null);
            textBoxCount.Text = APS.count.ToString();
        }
Exemple #2
0
 /// <summary>
 /// Задает для узла подузлы, содержащие значения свойств
 /// </summary>
 /// <param name="node"> Коллекция дочерних элементов узла</param>
 /// <param name="item"> Объект, из которого берутся значения свойств</param>
 private void assignValue(TreeNodeCollection node, APS item)
 {
     node.Clear();
     node.Add(item.name);
     node.Add(item.number.ToString());
     node.Add(item.addres);
     node.Add(item.countUsers.ToString());
     node.Add(item.usersPay.ToString());
     node.Add(item.tarif);
     node.Add(item.freeLines.ToString());
 }
Exemple #3
0
        /// <summary>
        ///
        /// </summary>
        /// <param name="sender"></param>
        /// <param name="e"></param>
        private void buttonAdd_Click(object sender, EventArgs e)
        {
            // Форма для ввода имени
            InputBox.InputBox inputBox = new InputBox.InputBox();
            String            s        = inputBox.getString(); // Строка, введенная пользователем

            if (s != null)
            {
                APS newAbstractAPS = new APS(s);
                collect.Add(newAbstractAPS);
                textBoxIndex.Text = (collect.Count - 1).ToString();
                buttonSelect_Click(null, null);
            }
            textBoxCount.Text = APS.count.ToString();
        }
Exemple #4
0
 private void buttonSelect_Click(object sender, EventArgs e)
 {
     if (int.TryParse(textBoxIndex.Text, out int index) && (index >= 0) && (index < collect.Count))
     {
         textBoxIndex.BackColor = Color.White;
         //selectingObject = RandomAcces.randomAcces(collect, index);
         selectingObject = collect[index];
         textBox1.Text   = selectingObject.name;
         textBox2.Text   = selectingObject.number.ToString();
         textBox3.Text   = selectingObject.addres;
         textBox4.Text   = selectingObject.countUsers.ToString();
         textBox5.Text   = selectingObject.usersPay.ToString();
         textBox6.Text   = selectingObject.tarif;
         textBox7.Text   = selectingObject.freeLines.ToString();
     }
     else
     {
         textBoxIndex.Focus();
         textBoxIndex.BackColor = Color.Red;
     }
 }
Exemple #5
0
        private void buttonGener_Click(object sender, EventArgs e)
        {
            int count;

            if (int.TryParse(textBoxGener.Text, out count) && (count >= 0) && (count + collect.Count < int.MaxValue - 100))
            {
                int newCount = collect.Count + count;
                textBoxIndex.BackColor = Color.White;
                for (int i = collect.Count; i < newCount; i++)
                {
                    APS newObject = new APS("name" + i.ToString(), i);
                    collect.Add(newObject);
                }
            }
            else
            {
                textBoxGener.Focus();
                textBoxGener.BackColor = Color.Red;
            }
            textBoxCount.Text = APS.count.ToString();
        }