private void modificarprecioToolStripMenuItem_Click(object sender, EventArgs e)
        {
            if (mListaSolicitudEppDetalleOrigen.Count > 0)
            {
                int xposition = 0;

                frmRegSolicitudEppDetalleEdit movDetalle = new frmRegSolicitudEppDetalleEdit();

                movDetalle.IdSolicitudEpp        = Convert.ToInt32(gvSolicitudEppDetalle.GetFocusedRowCellValue("IdSolicitudEpp"));
                movDetalle.IdSolicitudEppDetalle = Convert.ToInt32(gvSolicitudEppDetalle.GetFocusedRowCellValue("IdSolicitudEppDetalle"));
                movDetalle.intCorrelativo        = Convert.ToInt32(gvSolicitudEppDetalle.GetFocusedRowCellValue("Item"));
                movDetalle.IdEquipo              = Convert.ToInt32(gvSolicitudEppDetalle.GetFocusedRowCellValue("IdEquipo"));
                movDetalle.txtCodigo.Text        = gvSolicitudEppDetalle.GetFocusedRowCellValue("Codigo").ToString();
                movDetalle.txtDescEquipo.Text    = gvSolicitudEppDetalle.GetFocusedRowCellValue("DescEquipo").ToString();
                movDetalle.txtCantidad.EditValue = Convert.ToInt32(gvSolicitudEppDetalle.GetFocusedRowCellValue("Cantidad"));

                if (movDetalle.ShowDialog() == DialogResult.OK)
                {
                    xposition = gvSolicitudEppDetalle.FocusedRowHandle;

                    if (movDetalle.oBE != null)
                    {
                        gvSolicitudEppDetalle.SetRowCellValue(xposition, "IdEmpresa", movDetalle.oBE.IdEmpresa);
                        gvSolicitudEppDetalle.SetRowCellValue(xposition, "IdSolicitudEpp", movDetalle.oBE.IdSolicitudEpp);
                        gvSolicitudEppDetalle.SetRowCellValue(xposition, "IdSolicitudEppDetalle", movDetalle.oBE.IdSolicitudEppDetalle);
                        gvSolicitudEppDetalle.SetRowCellValue(xposition, "Item", movDetalle.oBE.Item);
                        gvSolicitudEppDetalle.SetRowCellValue(xposition, "IdEquipo", movDetalle.oBE.IdEquipo);
                        gvSolicitudEppDetalle.SetRowCellValue(xposition, "Codigo", movDetalle.oBE.Codigo);
                        gvSolicitudEppDetalle.SetRowCellValue(xposition, "DescEquipo", movDetalle.oBE.DescEquipo);
                        gvSolicitudEppDetalle.SetRowCellValue(xposition, "Cantidad", movDetalle.oBE.Cantidad);

                        if (pOperacion == Operacion.Modificar && Convert.ToDecimal(gvSolicitudEppDetalle.GetFocusedRowCellValue("TipoOper")) == Convert.ToInt32(Operacion.Nuevo))
                        {
                            gvSolicitudEppDetalle.SetRowCellValue(xposition, "TipoOper", Convert.ToInt32(Operacion.Nuevo));
                        }
                        else
                        {
                            gvSolicitudEppDetalle.SetRowCellValue(xposition, "TipoOper", Convert.ToInt32(Operacion.Modificar));
                        }
                        gvSolicitudEppDetalle.UpdateCurrentRow();

                        bNuevo = movDetalle.bNuevo;

                        AttachSummaryEPP();

                        btnNuevo.Focus();
                    }
                }
            }
        }
        private void nuevoToolStripMenuItem_Click(object sender, EventArgs e)
        {
            try
            {
                if (intIdJefe == 0)
                {
                    XtraMessageBox.Show("Debe Seleccionar un Jefe o Supervisor.", this.Text, MessageBoxButtons.OK, MessageBoxIcon.Warning);
                    return;
                }

                if (intIdPersona == 0)
                {
                    XtraMessageBox.Show("Debe Seleccionar un Responsable.", this.Text, MessageBoxButtons.OK, MessageBoxIcon.Warning);
                    return;
                }

                frmRegSolicitudEppDetalleEdit movDetalle = new frmRegSolicitudEppDetalleEdit();
                int i = 0;
                if (mListaSolicitudEppDetalleOrigen.Count > 0)
                {
                    i = mListaSolicitudEppDetalleOrigen.Max(ob => Convert.ToInt32(ob.Item));
                }
                movDetalle.intCorrelativo = Convert.ToInt32(i) + 1;
                if (movDetalle.ShowDialog() == DialogResult.OK)
                {
                    if (movDetalle.oBE != null)
                    {
                        if (mListaSolicitudEppDetalleOrigen.Count == 0)
                        {
                            gvSolicitudEppDetalle.AddNewRow();
                            gvSolicitudEppDetalle.SetRowCellValue(gvSolicitudEppDetalle.FocusedRowHandle, "IdEmpresa", movDetalle.oBE.IdEmpresa);
                            gvSolicitudEppDetalle.SetRowCellValue(gvSolicitudEppDetalle.FocusedRowHandle, "IdSolicitudEpp", movDetalle.oBE.IdSolicitudEpp);
                            gvSolicitudEppDetalle.SetRowCellValue(gvSolicitudEppDetalle.FocusedRowHandle, "IdSolicitudEppDetalle", movDetalle.oBE.IdSolicitudEppDetalle);
                            gvSolicitudEppDetalle.SetRowCellValue(gvSolicitudEppDetalle.FocusedRowHandle, "Item", movDetalle.oBE.Item);
                            gvSolicitudEppDetalle.SetRowCellValue(gvSolicitudEppDetalle.FocusedRowHandle, "IdEquipo", movDetalle.oBE.IdEquipo);
                            gvSolicitudEppDetalle.SetRowCellValue(gvSolicitudEppDetalle.FocusedRowHandle, "Codigo", movDetalle.oBE.Codigo);
                            gvSolicitudEppDetalle.SetRowCellValue(gvSolicitudEppDetalle.FocusedRowHandle, "DescEquipo", movDetalle.oBE.DescEquipo);
                            gvSolicitudEppDetalle.SetRowCellValue(gvSolicitudEppDetalle.FocusedRowHandle, "Cantidad", movDetalle.oBE.Cantidad);
                            gvSolicitudEppDetalle.SetRowCellValue(gvSolicitudEppDetalle.FocusedRowHandle, "TipoOper", Convert.ToInt32(Operacion.Nuevo));
                            gvSolicitudEppDetalle.UpdateCurrentRow();

                            bNuevo = movDetalle.bNuevo;

                            AttachSummaryEPP();

                            btnNuevo.Focus();

                            return;
                        }

                        if (mListaSolicitudEppDetalleOrigen.Count > 0)
                        {
                            var Buscar = mListaSolicitudEppDetalleOrigen.Where(oB => oB.IdEquipo == movDetalle.oBE.IdEquipo).ToList();
                            if (Buscar.Count > 0)
                            {
                                XtraMessageBox.Show("El código de producto ya existe", this.Text, MessageBoxButtons.OK, MessageBoxIcon.Error);
                                return;
                            }
                            gvSolicitudEppDetalle.AddNewRow();
                            gvSolicitudEppDetalle.SetRowCellValue(gvSolicitudEppDetalle.FocusedRowHandle, "IdEmpresa", movDetalle.oBE.IdEmpresa);
                            gvSolicitudEppDetalle.SetRowCellValue(gvSolicitudEppDetalle.FocusedRowHandle, "IdSolicitudEpp", movDetalle.oBE.IdSolicitudEpp);
                            gvSolicitudEppDetalle.SetRowCellValue(gvSolicitudEppDetalle.FocusedRowHandle, "IdSolicitudEppDetalle", movDetalle.oBE.IdSolicitudEppDetalle);
                            gvSolicitudEppDetalle.SetRowCellValue(gvSolicitudEppDetalle.FocusedRowHandle, "Item", movDetalle.oBE.Item);
                            gvSolicitudEppDetalle.SetRowCellValue(gvSolicitudEppDetalle.FocusedRowHandle, "IdEquipo", movDetalle.oBE.IdEquipo);
                            gvSolicitudEppDetalle.SetRowCellValue(gvSolicitudEppDetalle.FocusedRowHandle, "Codigo", movDetalle.oBE.Codigo);
                            gvSolicitudEppDetalle.SetRowCellValue(gvSolicitudEppDetalle.FocusedRowHandle, "DescEquipo", movDetalle.oBE.DescEquipo);
                            gvSolicitudEppDetalle.SetRowCellValue(gvSolicitudEppDetalle.FocusedRowHandle, "Cantidad", movDetalle.oBE.Cantidad);
                            gvSolicitudEppDetalle.SetRowCellValue(gvSolicitudEppDetalle.FocusedRowHandle, "TipoOper", Convert.ToInt32(Operacion.Nuevo));
                            gvSolicitudEppDetalle.UpdateCurrentRow();

                            bNuevo = movDetalle.bNuevo;

                            AttachSummaryEPP();

                            btnNuevo.Focus();
                        }
                    }
                }
            }
            catch (Exception ex)
            {
                XtraMessageBox.Show(ex.Message, this.Text, MessageBoxButtons.OK, MessageBoxIcon.Error);
            }
        }