private void cust_gridview_CellClick(object sender, DataGridViewCellEventArgs e) { if (e.ColumnIndex == 4) { int id = Convert.ToInt32(cust_gridview.Rows[e.RowIndex].Cells[0].Value); LinkedList <string> phones = db.ListOF("select number from phones where cust_id=" + id); string str = ""; foreach (string s in phones) { str += s + "\n"; } MessageBox.Show(str); } }
private void AddBillForm_Load(object sender, EventArgs e) { foreach (string s in db.ListOF("select * from teeth_type")) { type_combo.Items.Add(s); } foreach (string s in db.ListOF("select * from color_type")) { color_combo.Items.Add(s); } if (cases == 2) { DataSet data1 = new DataSet(); db.selectDB(ref data1, "SELECT * FROM bill WHERE id='" + bill_id + "'"); DataSet data2 = new DataSet(); db.selectDB(ref data2, "SELECT cust_name,cust_type from customer WHERE cust_id='" + data1.Tables[0].Rows[0][2] + "'"); LinkedList <string> teethes_data = db.ListOF("SELECT number from teeth where bill_id='" + bill_id + "'"); teethes.Text = "تعديل الاسنان"; save.Text = "تعديل"; id_txt.Text = data1.Tables[0].Rows[0][1].ToString(); cust_type_combo.SelectedItem = data2.Tables[0].Rows[0][1].ToString(); customer_combo.SelectedItem = data2.Tables[0].Rows[0][0].ToString(); teethes_list = new bool[49]; for (int i = 0; i < teethes_list.Length; i++) { teethes_list[i] = false; } foreach (string s in teethes_data) { int index = Convert.ToInt32(s); teethes_list[index] = true; } teethes_txt.Text = data1.Tables[0].Rows[0][3].ToString(); color_combo.SelectedItem = data1.Tables[0].Rows[0][4].ToString(); type_combo.SelectedItem = data1.Tables[0].Rows[0][5].ToString(); price_txt.Text = data1.Tables[0].Rows[0][9].ToString(); delv_state_combo.SelectedItem = data1.Tables[0].Rows[0][6].ToString(); price = Convert.ToDouble(price_txt.Text); notes_txt.Text = data1.Tables[0].Rows[0][10].ToString(); warrnity.Visible = false; warr_txt.Visible = false; } }