예제 #1
0
 private void loginButton_Click(object sender, EventArgs e)
 {
     if (conectionActive)
     {
         login();
     }
     else
     {
         if (!ConDB.openConnection())
         {
             MessageBox.Show("No se pudo conectar a la base de datos, haga click en 'solucionar problemas de coneccion' y siga los pasos",
                             "Error", MessageBoxButtons.OK, MessageBoxIcon.Error);
             conectionActive = false;
         }
         else
         {
             login();
             conectionActive = true;
         }
     }
 }
예제 #2
0
 private void MostrarButton_Click(object sender, EventArgs e)
 {
     if (ventas_radio.Checked)
     {
         MainDataGrid.DataSource = ConDB.getListOfSales(startTimePicker.Value.ToString("yyyy-MM-dd"), endTimePicker.Value.ToString("yyyy-MM-dd"));
         formatDataGrid_Sales();
         total_input.Text = ConDB.getTotalSales(startTimePicker.Value.ToString("yyyy-MM-dd"), endTimePicker.Value.ToString("yyyy-MM-dd")).ToString();
         return;
     }
     if (ingreso_radio.Checked)
     {
         MainDataGrid.DataSource = ConDB.getListOfEntries(startTimePicker.Value.ToString("yyyy-MM-dd"), endTimePicker.Value.ToString("yyyy-MM-dd"));
         formatDataGrid_entries();
         total_input.Text = ConDB.getTotalEntries(startTimePicker.Value.ToString("yyyy-MM-dd"), endTimePicker.Value.ToString("yyyy-MM-dd")).ToString();
         return;
     }
     if (producto_radio.Checked)
     {
         MainDataGrid.DataSource = ConDB.getHistoricalProducts(startTimePicker.Value.ToString("yyyy-MM-dd"), endTimePicker.Value.ToString("yyyy-MM-dd"));
         formatDataGrid_historicalProducts();
         return;
     }
 }
예제 #3
0
 private void StadisticsForm_Load(object sender, EventArgs e)
 {
     MainDataGrid.DataSource = ConDB.getStatistic();
 }
예제 #4
0
 private void LoginForm_FormClosing(object sender, FormClosingEventArgs e)
 {
     ConDB.closeConnection();
 }