private void fill() { accessDb ad = new accessDb(); DataSet ds = ad.getData("payment"); metroGrid1.DataSource = ds.Tables["payment"].DefaultView; }
private void viewAll_Load(object sender, EventArgs e) { // TODO: This line of code loads data into the 'itpDataSet.buyer' table. You can move, or remove it, as needed. //this.buyerTableAdapter.Fill(this.itpDataSet.buyer); accessDb ad = new accessDb(); DataSet ds = ad.getData("buyer"); viewTable.DataSource = ds.Tables["buyer"].DefaultView; }
private void comboBox1_SelectedIndexChanged(object sender, EventArgs e) { accessDb adb = new accessDb(); this.ptotal = adb.getData("invoice", "invoiceNo", comboBox1.Text, "netTotal"); label15.Visible = true; label15.Text = this.ptotal; string tempOut = adb.getData("invoice", "invoiceNo", comboBox1.Text, "buyerId"); this.pcredit = adb.getData("buyer", "buyerId", tempOut, "creditLimit"); label17.Visible = true; label17.Text = this.pcredit; string due = adb.getData("due", "invoiceNo", comboBox1.Text, "totalPaid"); //MessageBox.Show("Total = "+ this.ptotal+"\n totalPaid= "+tempOut+ "\n Credit = "+this.pcredit +"\n due ="+due); if (double.Parse(this.ptotal) - double.Parse(due) == 0) { radioButton1.Enabled = false; radioButton2.Enabled = false; groupBox1.Enabled = false; groupBox2.Enabled = false; } else { radioButton1.Enabled = true; radioButton2.Enabled = true; } if (string.IsNullOrEmpty(due) || due == "0") { label16.Text = this.ptotal; } else { label16.Text = (double.Parse(this.ptotal) - double.Parse(due)).ToString(); } }