示例#1
0
        private string ValidaDatos()
        {
            StringBuilder mensaje = new StringBuilder();

            if (datos.Count == 0)
            {
                mensaje.Append("- No Existe Data Para Procesar" + Environment.NewLine);
            }
            else
            {
                if (!EntryListBusiness.ValidateEuids(datos))
                {
                    btnProcesar.Enabled = true;
                    grpSplit.Enabled    = true;
                }
                else
                {
                    mensaje.Append("- Euid(s) Ya Existe(n)");
                    grdOpciones.Enabled = true;
                    btnProcesar.Enabled = false;
                }
            }

            return(mensaje.ToString());
        }
示例#2
0
        private void CargaArchivo()
        {
            OpenFileDialog openFileDialog = new OpenFileDialog();

            openFileDialog.Filter = "xlsx files (*.xlsx)|*.xlsx";
            if (openFileDialog.ShowDialog() == DialogResult.OK)
            {
                pathFile = openFileDialog.FileName;
            }

            if (pathFile != "")
            {
                datos = FuncionesExcel.GetSplitFile(pathFile);
                var resumen = (from splits in datos
                               select splits).OrderBy(e => e.Euid).ToList();

                grdResumen.AutoGenerateColumns = false;
                grdResumen.DataSource          = resumen;
                grdResumen.ClearSelection();

                var listaV = (from splits in datos
                              select new EntryList {
                    Euid = splits.Euid
                }).ToList();

                var existe = EntryListBusiness.ValidateEuids(listaV);
                if (!existe)
                {
                    btnProcesar.Enabled = false;
                    MessageBox.Show("Euid No Existe ", "Módulo Split", MessageBoxButtons.OK, MessageBoxIcon.Error, MessageBoxDefaultButton.Button1);
                }
                else
                {
                    btnProcesar.Enabled = true;
                }
                lblEuids.Text = resumen.Count.ToString();
            }
        }