private void Coefficients_Loaded(object sender, RoutedEventArgs e) { MySqlConnection conn = DBUtils.GetDBConnection(); conn.Open(); try { dbHandler db = new dbHandler(); coeffList = db.GetCoefficients(conn, id); Jun.Text = Convert.ToString(coeffList[0]); Mid.Text = Convert.ToString(coeffList[1]); Sen.Text = Convert.ToString(coeffList[2]); Ana.Text = Convert.ToString(coeffList[3]); Dep.Text = Convert.ToString(coeffList[4]); Sup.Text = Convert.ToString(coeffList[5]); DR.Text = Convert.ToString(coeffList[6]); TR.Text = Convert.ToString(coeffList[7]); CE.Text = Convert.ToString(coeffList[8]); } catch (Exception ex) { MessageBox.Show("Error: " + ex.Message); } finally { conn.Close(); conn.Dispose(); } }
private void SalaryBtn_Click(object sender, RoutedEventArgs e) { MySqlConnection conn = DBUtils.GetDBConnection(); conn.Open(); try { dbHandler db = new dbHandler(); coeffList = db.GetCoefficients(conn, id); executors = db.GetExecutors(conn, id); GetSalary(conn); } catch (Exception ex) { MessageBox.Show("Error: " + ex.Message); } finally { conn.Close(); conn.Dispose(); } }