private void button1_Click(object sender, EventArgs e) { if (checkInputs()) { ClientCommands.sendRequest("registration" + "login" + textBox1.Text + "password" + textBox2); } else { MessageBox.Show("Проверьте правильность введённых данных."); } }
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("Ошибка входных данных"); // добавить доход } }
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("Ошибка входных данных"); // добавить доход } }
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; } }
private void button1_Click(object sender, EventArgs e) { ClientCommands.sendRequest(); this.Close(); }
void refreshCategoriesGrid() { bs = ClientCommands.refreshCategories(nameField); dataGridView1.DataSource = bs.DataSource; }
private void button1_Click(object sender, EventArgs e) { ClientCommands.addCategory(textBox1.Text, textBox2.Text); refreshCategoriesGrid(); }
public void refreshCategories() { bs3 = ClientCommands.refreshCategories(nameField); comboBox1.DataSource = comboBox2.DataSource = bs3.DataSource; comboBox1.DisplayMember = comboBox2.DisplayMember = nameField; }