Example #1
0
 private void button1_Click(object sender, EventArgs e)
 {
     if (checkInputs())
     {
         ClientCommands.sendRequest("registration" + "login" + textBox1.Text + "password" + textBox2);
     }
     else
     {
         MessageBox.Show("Проверьте правильность введённых данных.");
     }
 }
Example #2
0
        private void button2_Click(object sender, EventArgs e)
        {
            double sum     = Convert.ToDouble(textBox4.Text);
            string cat     = comboBox2.Text;
            string comment = textBox3.Text;

            if (checkInputs(INCOME_QUERY_TYPE))                                      // если входные данные корректны
            {
                ClientCommands.addIncome(sum, cat, comment);                         // выполнить запрос
                refreshGrids(tabControl1.TabPages.IndexOf(tabControl1.SelectedTab)); // и обновить таблицу
            }
            else
            {
                MessageBox.Show("Ошибка входных данных");  // добавить доход
            }
        }
Example #3
0
        private void button1_Click(object sender, EventArgs e)
        {
            double sum     = Convert.ToDouble(textBox1.Text);
            string cat     = comboBox1.Text;
            string comment = textBox2.Text;

            if (checkInputs(CONSUMPTION_QUERY_TYPE))
            {
                ClientCommands.addСonsumption(sum, cat, comment); // добавить расход
                refreshGrids(tabControl1.TabPages.IndexOf(tabControl1.SelectedTab));
            }
            else
            {
                MessageBox.Show("Ошибка входных данных");  // добавить доход
            }
        }
Example #4
0
        void refreshGrids(int n)
        {
            //MessageBox.Show(n.ToString());
            switch (n)
            {
            case 0:
                bs1 = ClientCommands.refreshCosts();
                dataGridView1.DataSource = bs1.DataSource;
                break;

            case 1:
                bs2 = ClientCommands.refreshIncomes();
                dataGridView2.DataSource = bs2.DataSource;
                break;

            default:
                bs2 = ClientCommands.refreshIncomes();
                dataGridView2.DataSource = bs2.DataSource;
                bs1 = ClientCommands.refreshCosts();
                dataGridView1.DataSource = bs1.DataSource;
                break;
            }
        }
Example #5
0
 private void button1_Click(object sender, EventArgs e)
 {
     ClientCommands.sendRequest();
     this.Close();
 }
Example #6
0
 void refreshCategoriesGrid()
 {
     bs = ClientCommands.refreshCategories(nameField);
     dataGridView1.DataSource = bs.DataSource;
 }
Example #7
0
 private void button1_Click(object sender, EventArgs e)
 {
     ClientCommands.addCategory(textBox1.Text, textBox2.Text);
     refreshCategoriesGrid();
 }
Example #8
0
 public void refreshCategories()
 {
     bs3 = ClientCommands.refreshCategories(nameField);
     comboBox1.DataSource    = comboBox2.DataSource = bs3.DataSource;
     comboBox1.DisplayMember = comboBox2.DisplayMember = nameField;
 }