public void FillGrid() { FinManagement dba = new FinManagement(); DataSet ds = dba.getAll("asset"); dataGridView2.DataSource = ds.Tables["asset"].DefaultView; }
public void FillGrid() { FinManagement dba = new FinManagement(); DataSet ds = dba.getAll("fms_expenses"); dataGridView1.DataSource = ds.Tables["fms_expenses"].DefaultView; }
public void FillSpecificAID() { String passetid; passetid = textBox_assetID.Text; FinManagement dba = new FinManagement(); DataSet ds = dba.getSpecificAID("asset", passetid); dataGridView2.DataSource = ds.Tables["asset"].DefaultView; }
public void FillSpecific() { String pproperty; pproperty = comboBox_property.Text; FinManagement dba = new FinManagement(); DataSet ds = dba.getSpecific("asset", pproperty); dataGridView2.DataSource = ds.Tables["asset"].DefaultView; }
public void FillSpecific() { String pbudgetyear; pbudgetyear = textBox_budgetyear.Text; FinManagement dba = new FinManagement(); DataSet ds = dba.getSpecificBID("fms_expenses", pbudgetyear); dataGridView1.DataSource = ds.Tables["fms_expenses"].DefaultView; }
public void FillSpecificRepair() { String prepairid; prepairid = textBox_repairid.Text; FinManagement dba = new FinManagement(); DataSet ds = dba.getSpecificRID("asset_repair", prepairid); dataGridView2.DataSource = ds.Tables["asset_repair"].DefaultView; }
private void button_add_Click(object sender, EventArgs e) { String message = ""; int pbudgetyear = 0; String paproved = textBox_aproved.Text; String pcategory = ""; String pspecification = textBox_specification.Text; double pamount = 0; String pdate = dateTimePicker1.Value.ToString("yyyy-MM-dd"); String pdescription = richTextBox_description.Text; if (IsDigit(textBox_budgetyear.Text)) { pbudgetyear = Convert.ToInt32(textBox_budgetyear.Text); if ((pbudgetyear > 1900) && (pbudgetyear < 2100)) { } else { message += "Valid Budget Year\n"; } } else { message += "Valid Budget Year\n"; } if (String.IsNullOrWhiteSpace(paproved) || (IsDigit(paproved)) || paproved == "" || paproved == " ") { message += "Approved\n"; } if (comboBox_category.SelectedIndex == -1) { message += "Category\n"; } else { pcategory = comboBox_category.SelectedItem.ToString(); } if (IsDigit(pspecification) || String.IsNullOrWhiteSpace(pspecification) || pspecification == " " || pspecification == "") { message += "Specification\n"; } if (IsDigit(textBox_amount.Text)) { if (Convert.ToDouble(textBox_amount.Text) == 0) { message += "Amount\n"; } else { pamount = Convert.ToDouble(textBox_amount.Text); } } else { message += "Amount\n"; } if (String.IsNullOrWhiteSpace(richTextBox_description.Text) || richTextBox_description.Text == "Type all other wanted details here") { message += "Description\n"; } else { pdescription = richTextBox_description.Text; } if (message == "") { DialogResult result; result = MetroMessageBox.Show(this, "You wish to Continue?", "Valid Details", MessageBoxButtons.YesNo, MessageBoxIcon.Question); if (result == DialogResult.Yes) { FinManagement fin = new FinManagement(); fin.addExpenses(pbudgetyear, paproved, pcategory, pspecification, pamount, pdate, pdescription); MetroMessageBox.Show(this, "New Expense added to the database"); } } else { MetroMessageBox.Show(this, "" + message, "Please Provide", MessageBoxButtons.OK, MessageBoxIcon.Warning); } FillGrid(); }
private void button_add_Click_1(object sender, EventArgs e) { String message = ""; //variable declaration to get the entered values String pproperty = " "; String passetID = " "; String pserial = "Not rated"; String pownership = " "; double pvalue = 0; int plifeTime = 0; int pusage = 0; String pdescription = " "; String pinsurance = "No"; String pwarranty = "No"; String pstatus = "Inactive"; try { passetID = textBox_assetID.Text; if ((String.IsNullOrWhiteSpace(passetID)) || (passetID == " ") || (passetID[0] != 'A') || (passetID[1] != 'I') || (passetID[2] != 'D')) { message += "Valid Asset ID\n"; } if (comboBox_property.SelectedIndex == -1) { message += "Property\n"; } else { pproperty = comboBox_property.SelectedItem.ToString(); } if (textBox_serialnumber.ReadOnly == false) { if (String.IsNullOrWhiteSpace(textBox_serialnumber.Text)) { message += "Serial Number\n"; } else { pserial = textBox_serialnumber.Text; } } else { pserial = "Not rated"; } if (String.IsNullOrWhiteSpace(textBox_ownership.Text) || (IsDigit(textBox_ownership.Text))) { message += "Ownership\n"; } else { pownership = textBox_ownership.Text; } if (String.IsNullOrWhiteSpace(textBox_value.Text) || (!IsDigit(textBox_value.Text))) { message += "Value\n"; } else { pvalue = Convert.ToDouble(textBox_value.Text); } if (checkBox_insurance.Checked) { pinsurance = "Yes"; } if (checkBox_warranty.Checked) { pwarranty = "Yes"; } if (checkBox_status.Checked) { pstatus = "Active"; } if (String.IsNullOrWhiteSpace(textBox_lifetime.Text) || (!IsDigit(textBox_lifetime.Text))) { message += "Life-Time\n"; } else { plifeTime = Convert.ToInt16(textBox_lifetime.Text); } if (String.IsNullOrWhiteSpace(textBox_usage.Text) || (!IsDigit(textBox_usage.Text))) { message += "Usage\n"; } else { pusage = Convert.ToInt16(textBox_usage.Text); } if (String.IsNullOrWhiteSpace(richTextBox_description.Text) || richTextBox_description.Text == "Type all other wanted details here") { message += "Description"; } else { pdescription = richTextBox_description.Text; } if (message == "") { DialogResult result; result = MetroMessageBox.Show(this, "You wish to Continue?", "Valid Details", MessageBoxButtons.YesNo, MessageBoxIcon.Question); if (result == DialogResult.Yes) { FinManagement add = new FinManagement(); add.addAsset(passetID, pproperty, pserial, pownership, pvalue, pinsurance, pwarranty, pstatus, plifeTime, pusage, pdescription); FillGrid(); } } else { MetroMessageBox.Show(this, "" + message, "Please Provide", MessageBoxButtons.OK, MessageBoxIcon.Warning); } } catch (Exception ex) { MetroMessageBox.Show(this, ex.Message); } }
private void button_add_Click_1(object sender, EventArgs e) { String message = ""; String prepairid; String passetid; String pjobdate; String pserial = " "; String pstatus = " "; String pinsurance = "No"; String pwarranty = "No"; String pproblem = " "; try { prepairid = textBox_repairid.Text; if ((String.IsNullOrWhiteSpace(prepairid)) || (prepairid == " ") || (prepairid[0] != 'R') || (prepairid[1] != 'I') || (prepairid[2] != 'D')) { message += "Valid Repair ID\n"; } passetid = textBox_assetID.Text; if ((String.IsNullOrWhiteSpace(passetid)) || (passetid == " ") || (passetid[0] != 'A') || (passetid[1] != 'I') || (passetid[2] != 'D')) { message += "Valid Asset ID\n"; } pjobdate = dateTimePicker_repair.Value.ToString("yyyy-MM-dd"); if (String.IsNullOrWhiteSpace(textBox_serialnumber.Text)) { message += "Serial Number\n"; } else { pserial = textBox_serialnumber.Text; } if (radioButton_pending.Checked) { pstatus = radioButton_pending.Text; } else if (radioButton_done.Checked) { pstatus = radioButton_done.Text; } else if (radioButton_cannot.Checked) { pstatus = radioButton_cannot.Text; } else { message += "Job Status\n"; } if (checkBox_insurance.Checked) { pinsurance = "Yes"; } if (checkBox_warranty.Checked) { pwarranty = "Yes"; } if (String.IsNullOrWhiteSpace(richTextBox_problem.Text) || richTextBox_problem.Text == "Please enter the problem specified") { message += "Problem Specified\n"; } else { pproblem = richTextBox_problem.Text; } if (message == "") { DialogResult result; result = MetroMessageBox.Show(this, "You wish to Continue?", "Valid Details", MessageBoxButtons.YesNo, MessageBoxIcon.Question); if (result == DialogResult.Yes) { FinManagement add = new FinManagement(); if (add.addAssetRepair(prepairid, passetid, pjobdate, pstatus, pproblem, pserial, pwarranty, pinsurance)) { textBox_repairid.Clear(); textBox_assetID.Clear(); textBox_serialnumber.Clear(); checkBox_insurance.Checked = false; checkBox_warranty.Checked = false; richTextBox_problem.Clear(); radioButton_pending.Checked = false; radioButton_done.Checked = false; radioButton_cannot.Checked = false; FillGrid(); } } } else { MetroMessageBox.Show(this, "" + message, "Please Provide", MessageBoxButtons.OK, MessageBoxIcon.Warning); } FillGrid(); } catch (Exception ex) { MetroMessageBox.Show(this, ex.Message); } }
private void button_add_Click_1(object sender, EventArgs e) { String message = ""; try { int pbudgetYear = 0; pemployee = Convert.ToDouble(textBox_employee.Text); pmaintanance = Convert.ToDouble(textBox_maintanance.Text); pmarketing = Convert.ToDouble(textBox_marketing.Text); ptransport = Convert.ToDouble(textBox_transport.Text); String pdescription = ""; String pstartdate = dateTimePicker_Budget.Value.ToString("yyyy-MM-dd"); String penddate = dateTimePicker1.Value.ToString("yyyy-MM-dd"); if (IsDigit(textBox_budgetid.Text)) { pbudgetYear = Convert.ToInt32(textBox_budgetid.Text); if ((pbudgetYear > 1900) && (pbudgetYear < 2100)) { } else { message += "Valid Budget Year\n"; } } else { message += "Valid Budget Year\n"; } if (!IsDigit(textBox_employee.Text)) { message += "Employee Cost\n"; } if (!IsDigit(textBox_maintanance.Text)) { message += "Maintanance Cost\n"; } if (!IsDigit(textBox_transport.Text)) { message += "Transport Cost\n"; } if (!IsDigit(textBox_marketing.Text)) { message += "Marketing Cost\n"; } if (String.IsNullOrWhiteSpace(richTextBox_description.Text) || richTextBox_description.Text == "Type all other wanted details here") { message += "Description\n"; } else { pdescription = richTextBox_description.Text; } /* if (IsDigit(textBox_total.Text)) * pamount = Convert.ToDouble(textBox_total.Text); * else * message += "Total\n";*/ ptot = pemployee + pmaintanance + pmarketing + ptransport; textBox_total.Text = ptot.ToString(); if (message == "") { DialogResult result; result = MessageBox.Show("You wish to Continue?", "Valid Details", MessageBoxButtons.YesNo, MessageBoxIcon.Question); if (result == DialogResult.Yes) { FinManagement fin = new FinManagement(); fin.addBudget(pbudgetYear, pstartdate, penddate, pemployee, pmaintanance, pmarketing, ptransport, pdescription, ptot); } } else { MessageBox.Show("" + message, "Please Provide", MessageBoxButtons.OK, MessageBoxIcon.Warning); } FillGrid(); } catch (Exception ex) { MessageBox.Show(ex.Message); } }