private void RefreshWarr() { try { DataSet data = new DataSet(); db.selectDB(ref data, "SELECT * FROM warrnity WHERE bill_id='" + id + "'"); if (data.Tables[0].Rows.Count > 0) { DataSet data2 = new DataSet(); db.selectDB(ref data2, "SELECT c.cust_name,c.cust_type from customer c,bill b WHERE b.cust_id=c.cust_id and b.id=" + id); patient = data.Tables[0].Rows[0][0].ToString(); patient_label.Text = patient; customer_show_label.Text = "اسم ال" + data2.Tables[0].Rows[0][1]; customer_label.Text = data2.Tables[0].Rows[0][0].ToString(); bill_label.Text = db.SelectStr("SELECT bill_id FROM bill WHERE id='" + id + "'"); delv_label.Text = FormatDate(db.SelectDate("SELECT bill_delv_date from bill WHERE bill_id=" + id)); period = Convert.ToInt32(data.Tables[0].Rows[0][1].ToString()); if (period == 1) { warr_period_label.Text = " سنه"; } else if (period == 2) { warr_period_label.Text = " سنتين"; } else { warr_period_label.Text = period + " سنوات"; } } else { this.Close(); MessageBox.Show("لا توجد كفاله"); } } catch { this.Close(); } }