private void button1_Click(object sender, EventArgs e) { itemsTableAdapter s = new itemsTableAdapter(); allitemSet.itemsDataTable d = new allitemSet.itemsDataTable(); s.Fill(d); allitem rpt = new allitem(); rpt.SetDataSource(d[0].Table); Report_Viewer vd = new Report_Viewer(); vd.crystalReportViewer1.ReportSource = rpt; vd.ShowDialog(); }
private void button3_Click(object sender, EventArgs e) { try { itemsTableAdapter1 s = new itemsTableAdapter1(); emptySet.itemsDataTable dd = new emptySet.itemsDataTable(); s.Fill(dd); empty_item rpt = new empty_item(); rpt.SetDataSource(dd[0].Table); Report_Viewer vd = new Report_Viewer(); vd.crystalReportViewer1.ReportSource = rpt; vd.ShowDialog(); } catch (Exception) { MessageBox.Show("There Is No Empty Items"); } }
private void button4_Click(object sender, EventArgs e) { try { customerTableAdapter c = new customerTableAdapter(); customerSet.customerDataTable cd = new customerSet.customerDataTable(); c.Fill(cd); allcustomer rpt = new allcustomer(); rpt.SetDataSource(cd[0].Table); Report_Viewer vd = new Report_Viewer(); vd.crystalReportViewer1.ReportSource = rpt; vd.ShowDialog(); } catch (Exception) { MessageBox.Show("There Is No Customer"); } }
private void remainningItemsToolStripMenuItem1_Click(object sender, EventArgs e) { try { itemsTableAdapter2 s = new itemsTableAdapter2(); Non_Empty_ItemSet.itemsDataTable d = new Non_Empty_ItemSet.itemsDataTable(); s.Fill(d); Non_Empty_Item rpt = new Non_Empty_Item(); rpt.SetDataSource(d[0].Table); Report_Viewer vd = new Report_Viewer(); vd.crystalReportViewer1.ReportSource = rpt; vd.ShowDialog(); } catch (Exception) { MessageBox.Show("There Is No Avilable Items"); } }
private void button5_Click(object sender, EventArgs e) { string name = comboBox1.Text; if (radioButton1.Checked == true) { try { invoice_1TableAdapter1 i = new invoice_1TableAdapter1(); All_Invoices_Set.invoice_1DataTable ai = new All_Invoices_Set.invoice_1DataTable(); i.Fill(ai, name); allinvoice rpt = new allinvoice(); rpt.SetDataSource(ai[0].Table); Report_Viewer vd = new Report_Viewer(); vd.crystalReportViewer1.ReportSource = rpt; vd.ShowDialog(); } catch (Exception) { MessageBox.Show("There Is No Invoices For " + name + " Customer"); } } else if (radioButton2.Checked == true) { try { invoice_1TableAdapter2 i = new invoice_1TableAdapter2(); allinvoicepaidSet.invoice_1DataTable ai = new allinvoicepaidSet.invoice_1DataTable(); i.Fill(ai, name); Allinvoice_paid rpt = new Allinvoice_paid(); rpt.SetDataSource(ai[0].Table); Report_Viewer vd = new Report_Viewer(); vd.crystalReportViewer1.ReportSource = rpt; vd.ShowDialog(); } catch (Exception) { MessageBox.Show("There Is No Paid Invoices For " + name + " Customer"); } } else if (radioButton3.Checked == true) { try { invoice_1TableAdapter3 i3 = new invoice_1TableAdapter3(); unpaidinvoiceset.invoice_1DataTable d = new unpaidinvoiceset.invoice_1DataTable(); i3.Fill(d, name); unpaid_invoices rpt = new unpaid_invoices(); rpt.SetDataSource(d[0].Table); Report_Viewer vd = new Report_Viewer(); vd.crystalReportViewer1.ReportSource = rpt; vd.ShowDialog(); } catch (Exception) { MessageBox.Show("There Is No Unpaid Invoices For " + name + " Customer"); } } else if (radioButton4.Checked == true) { try { invoice_1TableAdapter4 i4 = new invoice_1TableAdapter4(); invoice_change_set.invoice_1DataTable dd = new invoice_change_set.invoice_1DataTable(); i4.Fill(dd, name); change_invoice rpt = new change_invoice(); rpt.SetDataSource(dd[0].Table); Report_Viewer vd = new Report_Viewer(); vd.crystalReportViewer1.ReportSource = rpt; vd.ShowDialog(); } catch (Exception) { MessageBox.Show("There Is No Invoices For The Customer" + " " + name); } } else { MessageBox.Show("Please Choose What Any Report You want!!"); } }
private void recordWithPaymentToolStripMenuItem_Click(object sender, EventArgs e) { try { string company = comboBox1.Text; string contactperson = textBox2.Text; string address = textBox1.Text; Int64 ph = Int64.Parse(maskedTextBox1.Text); string shiptoo = ""; try { shiptoo = textBox3.Text; } catch { shiptoo = ""; } string shipbyy = ""; try { shipbyy = textBox6.Text; } catch { shipbyy = ""; } Int64 shipcost = 0; try { shipcost = Int64.Parse(maskedTextBox2.Text); } catch { shipcost = 0; } string date = dateTimePicker1.Text; Int64 payment = 0; try { payment = Int64.Parse(domainUpDown2.Text); } catch { payment = 0; } string salesperson = ""; try { salesperson = textBox5.Text; } catch { salesperson = ""; } string note = ""; try { note = textBox4.Text; } catch { note = ""; } double total = double.Parse(label9.Text) + shipcost; double paid = double.Parse(label9.Text); double change = 0; string done = "true"; int idd = 0; ado_project d = new ado_project(); d.select_id_Companyname(company, ref idd); d.insert_invoice(company, contactperson, address, ph, shiptoo, shipbyy, shipcost, date, date, payment, salesperson, note, total, paid, change, done, idd); int use_id = 0; d.select_id(company, date, ref use_id); for (int i = 0; i < dataGridView1.Rows.Count - 1; i++) { Int64 amount_num = Int64.Parse(dataGridView1.Rows[i].Cells[0].Value.ToString()); int item = int.Parse(dataGridView1.Rows[i].Cells[1].Value.ToString()); string descriiption = dataGridView1.Rows[i].Cells[2].Value.ToString(); Int64 unittprice = Int64.Parse(dataGridView1.Rows[i].Cells[3].Value.ToString()); Int64 ssuptotal = Int64.Parse(dataGridView1.Rows[i].Cells[4].Value.ToString()); //string itemm = ""; //d.select_itemmname(item,ref itemm); d.insert_invoice2(amount_num, item, ssuptotal, use_id); Int64 ref_unmber = 0; d.select_itemname(item, ref ref_unmber); Int64 new_num = ref_unmber - amount_num; d.update_numberitem(item, new_num); } DialogResult dialogResult = MessageBox.Show("Recoding With Payment Done ,Do you Want Print Invoice?", "Warning", MessageBoxButtons.YesNo, MessageBoxIcon.Question); if (dialogResult == DialogResult.Yes) { DataTable2TableAdapter d2 = new DataTable2TableAdapter(); invoiceSet1.DataTable2DataTable dd = new invoiceSet1.DataTable2DataTable(); d2.Fill(dd, use_id); testt rpt = new testt(); rpt.SetDataSource(dd[0].Table); Report_Viewer vd = new Report_Viewer(); vd.crystalReportViewer1.ReportSource = rpt; vd.ShowDialog(); } } catch (Exception) { MessageBox.Show("Try Again"); } textBox3.Text = ""; textBox6.Text = ""; maskedTextBox1.Text = ""; textBox4.Text = ""; textBox5.Text = ""; domainUpDown2.Text = ""; label9.Text = "00.00"; }