예제 #1
0
        void ReloadData()
        {
            if (textBox1.Text.Trim().Length > 0)
            {
                switch (comboBox1.SelectedIndex)
                {
                case 0:
                    PopulateData(
                        Doctors.Records().Get(),
                        Patients.Records().Where(Patients.COLUMNS.Surname, "LIKE", "%" + textBox1.Text + "%").Get(),
                        Servises.Records().Get(),
                        Treatments.Records().Get(),
                        Visits.Records().Get()
                        );
                    break;

                case 1:
                    PopulateData(
                        Doctors.Records().Get(),
                        Patients.Records().Get(),
                        Servises.Records().Where(Servises.COLUMNS.Servise_name, "LIKE", "%" + textBox1.Text + "%").Get(),
                        Treatments.Records().Get(),
                        Visits.Records().Get()
                        );
                    break;

                case 2:
                    PopulateData(
                        Doctors.Records().Where(Doctors.COLUMNS.Surname, "LIKE", "%" + textBox1.Text + "%").Get(),
                        Patients.Records().Get(),
                        Servises.Records().Get(),
                        Treatments.Records().Get(),
                        Visits.Records().Get()
                        );
                    break;

                default:
                    PopulateData(
                        Doctors.Records().Get(),
                        Patients.Records().Get(),
                        Servises.Records().Get(),
                        Treatments.Records().Get(),
                        Visits.Records().Get()
                        );
                    break;
                }
            }
            else
            {
                PopulateData(
                    Doctors.Records().Get(),
                    Patients.Records().Get(),
                    Servises.Records().Get(),
                    Treatments.Records().Get(),
                    Visits.Records().Get()
                    );
            }
        }