private void Btn_Reset_Click(object sender, EventArgs e) { Com_Paient.DropDownStyle = ComboBoxStyle.DropDown; Btn_AddVisits.Enabled = true; Btn_Update.Enabled = false; CheckofOldvisit = 0; Btn_Symptoms.Enabled = false; Enable_Btn_Add_Chronic = true; Com_Paient.ForeColor = Color.Gray; Com_Doctors.ForeColor = Color.Gray; Com_Paient.Text = "اختيار"; Com_Paient.Focus(); Com_Doctors.Text = "اختيار"; LabCount.Text = "0"; RText_Treatment.ResetText(); RText_Implement.ResetText(); RText_TotalPaid.ResetText(); RText_Symptoms.ResetText(); RText_Approximate.ResetText(); RText_Balance.ResetText(); DGV_Visits.ClearSelection(); }
private void comboBox1_SelectedIndexChanged(object sender, EventArgs e) { if (Com_Paient.Text == "اختيار" || string.IsNullOrEmpty(Com_Paient.Text) || Enable_Btn_Add_Chronic == false) { Btn_Symptoms.Enabled = false; } else { Btn_Symptoms.Enabled = true; try { CheckofOldvisit = Convert.ToInt32(Com_Paient.SelectedValue); Com_patients = Convert.ToInt32(Com_Paient.SelectedValue); Com_Paient.ForeColor = Color.Black; DataTable dt = new DataTable(); dt = Visit.Count_Visits(Convert.ToInt32(Com_Paient.SelectedValue)); LabCount.Text = dt.Rows[0].Field <int>("COUNT").ToString(); dt = OV.Old_Visits1(VisitsForm.Com_patients); if (dt.Rows.Count > 0) { RText_Approximate.Text = dt.Rows[0][2].ToString(); } else { RText_Approximate.ResetText(); } dt = appintment.Check_Appintment(Convert.ToInt32(Com_Paient.SelectedValue)); Fill_Names_Doctors(); Com_Doctors.SelectedValue = dt.Rows[0][6]; } catch (Exception ex) { } label1.Focus(); } }