private void modificarToolStripMenuItem_Click(object sender, EventArgs e)
        {
            History.frmEppPercentage frm = new History.frmEppPercentage(_TypeofEEPName, _Percentage);
            frm.ShowDialog();

            if (frm.DialogResult == System.Windows.Forms.DialogResult.OK)
            {
                if (_objTypeOfEEPamc.i_RecordType == (int)RecordType.Temporal)
                {
                    _objTypeOfEEPamc.i_RecordStatus = (int)RecordStatus.Agregado;
                }
                else if (_objTypeOfEEPamc.i_RecordType == (int)RecordType.NoTemporal)
                {
                    _objTypeOfEEPamc.i_RecordStatus = (int)RecordStatus.Modificado;
                }
                _objTypeOfEEPamc.r_Percentage = frm._Porcentage;

                _TempTypeOfEEPList[_IndexListEPP] = _objTypeOfEEPamc;

                // Cargar grilla
                grdDataEPP.DataSource = new TypeOfEEPList();
                grdDataEPP.DataSource = _TempTypeOfEEPList;
                grdDataEPP.Refresh();
            }
        }
        private void btnMoveEPP_Click(object sender, EventArgs e)
        {
            OperationResult     objOperationResult     = new OperationResult();
            SystemParameterBL   objSystemParameterBL   = new SystemParameterBL();
            SystemParameterList objSystemParameterList = new SystemParameterList();
            TypeOfEEPList       objTypeOfEEP           = new TypeOfEEPList();

            if (treeViewEPP.SelectedNode == null)
            {
                return;
            }

            //Si la lista temporal es null se la setea con una lista vacia
            if (_TempTypeOfEEPList == null)
            {
                _TempTypeOfEEPList = new List <TypeOfEEPList>();
            }

            int ParameterId = int.Parse(treeViewEPP.SelectedNode.Name.ToString());

            History.frmOtroEPP frmOtroEpp = new History.frmOtroEPP();
            string             OtroEpp    = "";

            if (ParameterId == 16)
            {
                frmOtroEpp.ShowDialog();

                OtroEpp = frmOtroEpp.EppName;
                objSystemParameterList = objSystemParameterBL.GetParentNameSystemParameter(ref objOperationResult, frmOtroEpp.ParameterId);
            }
            else
            {
                objSystemParameterList = objSystemParameterBL.GetParentNameSystemParameter(ref objOperationResult, ParameterId);
            }


            History.frmEppPercentage frm = new History.frmEppPercentage(objSystemParameterList.v_Value1, 0);
            frm.ShowDialog();

            if (frm.DialogResult == System.Windows.Forms.DialogResult.OK)
            {
                if (objSystemParameterList != null)
                {
                    TypeOfEEPList findResult = new TypeOfEEPList();
                    //Busco en la lista temporal si ya se agrego el item seleccionado
                    if (ParameterId == 16)
                    {
                        findResult = _TempTypeOfEEPList.Find(p => p.i_TypeofEEPId == frmOtroEpp.ParameterId);
                    }
                    else
                    {
                        findResult = _TempTypeOfEEPList.Find(p => p.i_TypeofEEPId == ParameterId);
                    }



                    if (findResult == null)
                    {
                        objTypeOfEEP.v_TypeofEEPId = Guid.NewGuid().ToString();

                        if (ParameterId == 16)
                        {
                            objTypeOfEEP.i_TypeofEEPId   = frmOtroEpp.ParameterId;
                            objTypeOfEEP.v_TypeofEEPName = OtroEpp;
                        }
                        else
                        {
                            objTypeOfEEP.i_TypeofEEPId   = ParameterId;
                            objTypeOfEEP.v_TypeofEEPName = objSystemParameterList.v_Value1;
                        }


                        objTypeOfEEP.r_Percentage   = frm._Porcentage;
                        objTypeOfEEP.i_RecordStatus = (int)RecordStatus.Agregado;
                        objTypeOfEEP.i_RecordType   = (int)RecordType.Temporal;
                        _TempTypeOfEEPList.Add(objTypeOfEEP);
                    }
                    else
                    {
                        if (findResult.i_RecordStatus == (int)RecordStatus.EliminadoLogico)
                        {
                            if (findResult.i_RecordType == (int)RecordType.NoTemporal)// El registro Tiene in ID de BD
                            {
                                findResult.i_TypeofEEPId   = ParameterId;
                                findResult.v_TypeofEEPName = objSystemParameterList.v_Value1;
                                findResult.r_Percentage    = frm._Porcentage;
                                findResult.i_RecordStatus  = (int)RecordStatus.Grabado;
                            }
                            else if (findResult.i_RecordType == (int)RecordType.Temporal) // El registro tiene un ID temporal [GUID]
                            {
                                findResult.i_TypeofEEPId   = ParameterId;
                                findResult.v_TypeofEEPName = objSystemParameterList.v_Value1;
                                findResult.r_Percentage    = frm._Porcentage;
                                findResult.i_RecordStatus  = (int)RecordStatus.Agregado;
                            }
                        }
                        else
                        {
                            MessageBox.Show("Por favor seleccione otro item. ya existe", "Error de validación", MessageBoxButtons.OK, MessageBoxIcon.Warning);
                            return;
                        }
                    }
                    var dataList = _TempTypeOfEEPList.FindAll(p => p.i_RecordStatus != (int)RecordStatus.EliminadoLogico);

                    // Cargar grilla
                    grdDataEPP.DataSource = new TypeOfEEPList();
                    grdDataEPP.DataSource = dataList;
                    grdDataEPP.Refresh();
                }
            }
        }