Example #1
0
        /// <summary>
        /// Asigna los valores del grid que no están asociados a propiedades
        /// </summary>
        protected override void SetUnlinkedGridValues(string gridName)
        {
            switch (gridName)
            {
            case "Cuestiones_Grid":
            {
                foreach (DataGridViewRow row in Cuestiones_Grid.Rows)
                {
                    if (_tipo_auditoria == null)
                    {
                        _tipo_auditoria = _tipos_auditorias.GetItem(Entity.OidTipoAuditoria);
                    }
                    if (_tipo_auditoria != null)
                    {
                        CuestionAuditoria cuestion = (CuestionAuditoria)row.DataBoundItem;
                        if (cuestion != null)
                        {
                            CuestionInfo info = _tipo_auditoria.Cuestiones.GetItem(cuestion.OidCuestion);
                            if (info != null)
                            {
                                row.Cells["Cuestion"].Value = info.Texto;
                                row.Cells["Numero"].Value   = info.Numero;
                            }
                        }
                    }
                }
            } break;

            case "Historia_Grid":
            {
                InstructorList instructores = InstructorList.GetList(false);
                foreach (DataGridViewRow row in Historia_Grid.Rows)
                {
                    HistoriaAuditoria item = (HistoriaAuditoria)row.DataBoundItem;
                    if (item.Empleado == string.Empty)
                    {
                        InstructorInfo instructor = instructores.GetItem(item.OidEmpleado);
                        if (instructor != null)
                        {
                            row.Cells["Empleado"].Value = instructor.Nombre;
                        }
                    }
                }
            }
            break;
            }
        }
        private void Cuestion_CB_SelectedIndexChanged(object sender, EventArgs e)
        {
            if (Cuestion_CB.SelectedItem == null)
            {
                return;
            }

            CuestionAuditoria cuestion_auditoria = _auditoria.Cuestiones.GetItem(((ComboBoxSource)Cuestion_CB.SelectedItem).Oid);

            if (cuestion_auditoria != null)
            {
                CuestionInfo cuestion = _cuestiones.GetItem(cuestion_auditoria.OidCuestion);

                if (cuestion != null)
                {
                    Cuestion_TB.Text = cuestion.Texto;
                }
            }
        }