Ejemplo n.º 1
0
        private void btnObservacion_Click(object sender, EventArgs e)
        {
            if (dgvLaptopsSeleccionados.PrimaryGrid.Rows.Count > 0)
            {
                detalleTemp.IdLC = int.Parse(((GridCell)(((GridRow)dgvLaptopsSeleccionados.PrimaryGrid.ActiveRow)[4])).Value.ToString());

                int indice = 0;
                foreach (DevolucionDetalle detalle in devolucion.Detalles)
                {
                    if (detalle.IdLC == detalleTemp.IdLC)
                    {
                        break;
                    }
                    indice++;
                }
                int    cobrar      = devolucion.Detalles[indice].Cobrar;
                int    dano        = devolucion.Detalles[indice].Danado;
                string observacion = devolucion.Detalles[indice].Observacion;
                using (frmProcesoDevolucionEvaluarEquipo frm = new frmProcesoDevolucionEvaluarEquipo(cobrar, dano, observacion))
                {
                    if (frm.ShowDialog() == System.Windows.Forms.DialogResult.OK)
                    {
                        devolucion.Detalles[indice].Cobrar             = frm.Cobrado;
                        devolucion.Detalles[indice].Danado             = frm.Dano;
                        devolucion.Detalles[indice].EstadoLC           = (frm.Dano == 1) ? 3 : 2;
                        devolucion.Detalles[indice].Observacion        = frm.Observacion;
                        dgvLaptopsSeleccionados.PrimaryGrid.DataSource = devolucion.Detalles;
                    }
                }
            }
        }
Ejemplo n.º 2
0
        private void btnObservacion_Click(object sender, EventArgs e)
        {
            bool error;

            vistaEquipos.ClearColumnsFilter();

            int equipoID = -1;
            int h        = 0;

            for (h = 0; h < vistaEquipos.RowCount; h++)
            {
                if (vistaEquipos.IsRowSelected(h) == true)
                {
                    equipoID = int.Parse(vistaEquipos.GetRowCellValue(h, "IdLC").ToString());
                    break;
                }
            }

            if (equipoID != -1)
            {
                detalleTemp.IdLC = equipoID;
                int indice = 0;
                foreach (DevolucionDetalle detalle in devolucion.Detalles)
                {
                    if (detalle.IdLC == detalleTemp.IdLC)
                    {
                        break;
                    }
                    indice++;
                }
                int    cobrar      = devolucion.Detalles[indice].Cobrar;
                int    dano        = devolucion.Detalles[indice].Danado;
                string observacion = devolucion.Detalles[indice].Observacion;
                using (frmProcesoDevolucionEvaluarEquipo frm = new frmProcesoDevolucionEvaluarEquipo(cobrar, dano, observacion))
                {
                    if (frm.ShowDialog() == System.Windows.Forms.DialogResult.OK)
                    {
                        devolucion.Detalles[indice].Cobrar      = frm.Cobrado;
                        devolucion.Detalles[indice].Danado      = frm.Dano;
                        devolucion.Detalles[indice].EstadoLC    = (frm.Dano == 1) ? 3 : 2;
                        devolucion.Detalles[indice].Observacion = frm.Observacion;
                        dgvLaptopsSeleccionados.DataSource      = devolucion.Detalles;
                        vistaEquipos.RefreshData();
                    }
                }
            }
        }