private void btnFIn1_check_Click(object sender, EventArgs e) { if (validatefitness_Year()) { try { int monthInDigit = DateTime.ParseExact(cmbFin1_month.SelectedItem.ToString(), "MMMM", CultureInfo.InvariantCulture).Month; int year = int.Parse(txtFin_fitYear.Text); Buisness_Logic.finace_repository fr = new Buisness_Logic.finace_repository(); Buisness_Logic.Finance ff = new Buisness_Logic.Finance(); if (fr.getIncome(year, monthInDigit, ff)) { double amount = ff.amount; txtFin1_income.Text = amount.ToString(); } else { MessageBox.Show("No income record found.", "Infromation", MessageBoxButtons.OK, MessageBoxIcon.Error); } } catch (Exception exf1) { throw; } } }
private void btn_os_getINcome_Click(object sender, EventArgs e) { if (validate_os()) { try { int monthInDigit = DateTime.ParseExact(cmbFin3Month.SelectedItem.ToString(), "MMMM", CultureInfo.InvariantCulture).Month; int year = int.Parse(txtos_year.Text); string service_type = cmbFin3_serviceType.SelectedItem.ToString(); Buisness_Logic.finace_repository fr = new Buisness_Logic.finace_repository(); Buisness_Logic.Finance ff = new Buisness_Logic.Finance(); double amount; bool t1 = false, t2 = false; if (fr.getIncomeOfOs(year, monthInDigit, ff, service_type)) { amount = ff.amount; txtFin3_income.Text = amount.ToString(); t1 = true; } else { MessageBox.Show("No income record found.", "Infromation", MessageBoxButtons.OK, MessageBoxIcon.Error); amount = 0; } //if (fr.getExpenseOfSales(year, monthInDigit, ff)) //{ // expens = ff.expenditure; // txtFin2_expense.Text = expens.ToString(); // t2 = true; //} //else //{ // MessageBox.Show("No expense record found.", "Infromation", MessageBoxButtons.OK, MessageBoxIcon.Error); // expens = 0; //} //if (t1 == true && t2 == true) //{ // txtFin2_revenue.Text = (amount - expens).ToString(); //} //else //{ // clearSales(); //} } catch (Exception exf1) { throw; } } }
private void btnThismonthTOto_Click(object sender, EventArgs e) { try { Buisness_Logic.finace_repository fr = new Buisness_Logic.finace_repository(); Buisness_Logic.Finance ff = new Buisness_Logic.Finance(); if (fr.getIncome_thisMonth(ff)) { double amount = ff.amount; txtFin1_income.Text = amount.ToString(); } else { MessageBox.Show("No income record found.", "Infromation", MessageBoxButtons.OK, MessageBoxIcon.Error); } } catch (Exception dfde) { throw; } }