예제 #1
0
        private void btnCall_Click(object sender, EventArgs e)
        {
            TextBox        tBoxNumber      = (TextBox)Controls.Find("tBoxNumber", true)[0];
            ListBox        listLocalities  = (ListBox)Controls.Find("listLocalities", true)[0];
            DateTimePicker dtpCallDuration = (DateTimePicker)Controls.Find("dtpCallDuration", true)[0];

            bool success = false;

            Client client = baseSystem.GetClientByNumber(tBoxNumber.Text);

            if (client != null)
            {
                success = client.Call(BaseSystem.currentDateTime, (Locality)listLocalities.SelectedItem, new TimeSpan(dtpCallDuration.Value.Hour, dtpCallDuration.Value.Minute, dtpCallDuration.Value.Second));
            }

            if (success)
            {
                MessageBox.Show("Дзвінок виконаний успішно");
            }
            else
            {
                MessageBox.Show("Дзвінок не виконано");
            }
        }
예제 #2
0
        private void btnReplenish_Click(object sender, EventArgs e)
        {
            TextBox tBoxNumber = (TextBox)Controls.Find("tBoxNumber", true)[0];
            TextBox tBoxSum    = (TextBox)Controls.Find("tBoxSum", true)[0];

            bool success = false;

            Client client = baseSystem.GetClientByNumber(tBoxNumber.Text);

            if (client != null)
            {
                client.money += int.Parse(tBoxSum.Text);
                success       = true;
            }

            if (success)
            {
                MessageBox.Show("Поповнення пройшло успішно");
            }
            else
            {
                MessageBox.Show("Помилка поповнення");
            }
        }