Esempio n. 1
0
        private void cmbSearch_SelectedIndexChanged(object sender, EventArgs e)
        {
            MarikinaOpticalEntities dbContext = new MarikinaOpticalEntities();

            switch (cmbSearch.SelectedIndex)
            {
            case 0:
                dgvListOfPatient.DataSource = dbContext.GetPatientsId();
                txtSearch.Enabled           = false;
                break;

            case 1:
                dgvListOfPatient.DataSource = dbContext.SearchSerialNoRx(txtSearch.Text);
                txtSearch.Enabled           = true;
                break;

            case 2:
                dgvListOfPatient.DataSource = dbContext.SearchNameRx(txtSearch.Text);
                txtSearch.Enabled           = true;
                break;

            default:
                break;
            }
        }
Esempio n. 2
0
        public void PatientLoad()
        {
            MarikinaOpticalEntities dbContext = new MarikinaOpticalEntities();

            cmbSearch.SelectedIndex     = 0;
            dgvListOfPatient.DataSource = dbContext.GetPatientsId();
            dgvListOfPatient.Columns[0].HeaderCell.Value = "Id";
            dgvListOfPatient.Columns[0].Visible          = false;
            dgvListOfPatient.Columns[1].HeaderCell.Value = "Patient No.";
            dgvListOfPatient.Columns[1].AutoSizeMode     = DataGridViewAutoSizeColumnMode.DisplayedCells;
            dgvListOfPatient.Columns[2].HeaderCell.Value = "Full Name";
            dgvListOfPatient.Columns[2].AutoSizeMode     = DataGridViewAutoSizeColumnMode.Fill;
        }