private void CellContentClick(object sender, DataGridViewCellEventArgs e)
 {
     if (e.RowIndex >= 0 && ((DataGridView)sender).Columns[e.ColumnIndex].GetType() == typeof(DataGridViewImageColumn))
     {
         int             rowIndex = e.RowIndex;
         DataGridViewRow row      = dgvData.Rows[rowIndex];
         PatientInvoice  p        = new PatientInvoice();
         p.PatientMedicineBillGuid = (Guid)(row.Cells[8].Value);
         p.PatientGuid             = (Guid)(row.Cells[7].Value);
         p.PatientName             = row.Cells[0].Value.ToString();
         p.Show();
     }
 }
Esempio n. 2
0
        private void CellContentClick(object sender, DataGridViewCellEventArgs e)
        {
            int rowindex = e.RowIndex;

            if (rowindex >= 0)
            {
                int columnindex = e.ColumnIndex;

                var value = dgvData.Rows[rowindex].Cells[columnindex].Value;

                if (e.RowIndex >= 0 && ((DataGridView)sender).Columns[e.ColumnIndex].GetType() == typeof(DataGridViewImageColumn))
                {
                    int             rowIndex = e.RowIndex;
                    DataGridViewRow row      = dgvData.Rows[rowIndex];
                    if (e.ColumnIndex == 15)
                    {
                        IndoorCaseReportForm p = new IndoorCaseReportForm();
                        p.PatientGuid = (Guid)(row.Cells[19].Value);
                        p.Show();
                    }
                    if (e.ColumnIndex == 14)
                    {
                        PatientInvoice p = new PatientInvoice();
                        p.PatientGuid = (Guid)(row.Cells[19].Value);
                        p.Show();
                    }
                    if (e.ColumnIndex == 16)
                    {
                        MLCReportForm p = new MLCReportForm();
                        p.PatientGuid = (Guid)(row.Cells[19].Value);
                        p.Show();
                    }
                    if (e.ColumnIndex == 17)
                    {
                        PatientDetailReportForm p = new PatientDetailReportForm();
                        p.PatientGuid = (Guid)(row.Cells[19].Value);
                        p.Show();
                    }
                    if (e.ColumnIndex == 18)
                    {
                        DischargeSummeryReport p = new DischargeSummeryReport();
                        p.PatientGuid = (Guid)(row.Cells[19].Value);
                        p.Show();
                    }
                }
            }
        }