private void Search_Click(object sender, EventArgs e) { ServCon mngout; mngout = new ServCon(); string command = ""; if (Fullreport.Checked == true) { command = "select * from sale"; string[] results = mngout.query(command); int i = 0; while (results[i] != null) { Dataoutput.Items.Add(results[i]); i++; } } else if (YearSal.Checked == true) { if (Qbox.Text == null) { command = "select empusername, empsalary from employee"; } else { command = "select empusername, empsalary from employee where empusername = '******'"; } string[] results = mngout.query(command); int i = 0; while (results[i] != null) { Dataoutput.Items.Add(results[i]); i++; } } else if (Names.Checked == true) { command = "select distinct empname from employee"; string[] results = mngout.query(command); int i = 0; while (results[i] != null) { Dataoutput.Items.Add(results[i]); i++; } } else { MessageBox.Show("No searches selected.\nPlease select a search type.", "Search Error"); } }
private void Cquery_Click(object sender, EventArgs e) { ServCon custout; custout = new ServCon(); string command = ""; if (cSale.Checked) { command = "select * from sale, customer where sale.cstID = customer.cstID and cstusername = '******'"; } else if (cScript.Checked) { command = "select * from perscription, sale, customer where perscription.saleid = sale.saleid and sale.cstID = customer.cstID and customer.cstusername = '******'"; } else if (cDrug.Checked) { command = "select * from drug, perscription, sale, customer where drug.drugID = perscription.drugID and perscription.saleID = sale.saleID and sale.cstid = customer.cstid and customer.cstusername = '******'"; } string[] results = custout.query(command); int i = 0; while (results[i] != null) { //results[i] += '\n'; custdat.Items.Add(results[i]); i++; } }
private void CustomerData_Load(object sender, EventArgs e) { Cname.Text = User.person(); ServCon custout; int check = User.clrnce(); custout = new ServCon(); //if(User.clrnce() == 3) //{ string command = "select * from customer where cstusername = '******'"; string[] results = custout.query(command); int i = 0; while (results[i] != null) { custdat.Items.Add(results[i]); i++; } //} }