Esempio n. 1
0
 private void ToolStripMenuItem_Click(object sender, EventArgs e)
 {
     try
     {
         ToolStripMenuItem Item = (ToolStripMenuItem)sender;
         int IDTipoRegistro     = 0;
         int.TryParse(Item.Tag.ToString(), out IDTipoRegistro);
         if (IDTipoRegistro > 0)
         {
             TipoRegistro DatosAux = new TipoRegistro {
                 IDTipoRegistro = IDTipoRegistro, Descripcion = Item.Text
             };
             frmChecarEntradaSalida EntradaSalida = new frmChecarEntradaSalida(DatosAux);
             EntradaSalida.ShowDialog();
             EntradaSalida.Dispose();
             if (EntradaSalida.DialogResult == DialogResult.OK)
             {
                 this.btnMostrarResultados_Click(this.btnMostrarResultados, new EventArgs());
             }
         }
     }
     catch (Exception ex)
     {
         throw ex;
     }
 }
 public RegistroModel(TipoRegistro tipoRegistro, DateTime horarioUltimaEdicao, string razaoSocial, string cargoDiretoria,
                      string nome, string sobrenome, string CPF, string RG, string telefone, string instagram, string whatsapp, string email,
                      string CNPJ, string CEP, string estado, string cidade, string rua, string numero, string bairro, string complemento, string outros)
 {
     this.Guid = Guid.NewGuid();
     this.HorarioUltimaEdicao = horarioUltimaEdicao;
     this.TipoRegistro        = tipoRegistro;
     this.Nome           = nome;
     this.Sobrenome      = sobrenome;
     this.RazaoSocial    = razaoSocial;
     this.CargoDiretoria = cargoDiretoria;
     this.CPF            = CPF;
     this.RG             = RG;
     this.Telefone       = telefone;
     this.Instagram      = instagram;
     this.Whatsapp       = whatsapp;
     this.Email          = email;
     this.CNPJ           = CNPJ;
     this.CEP            = CEP;
     this.Estado         = estado;
     this.Cidade         = cidade;
     this.Rua            = rua;
     this.Numero         = numero;
     this.Bairro         = bairro;
     this.Complemento    = complemento;
     this.Outros         = outros;
 }
Esempio n. 3
0
        private void LlenarMenuStripChecado()
        {
            try
            {
                TipoRegistro TRAux = new TipoRegistro {
                    Conexion = Comun.Conexion, IncluirSelect = false
                };
                Catalogo_Negocio    CN    = new Catalogo_Negocio();
                List <TipoRegistro> Lista = CN.ObtenerCatTipoRegistro(TRAux);
                foreach (TipoRegistro Item in Lista)
                {
                    ToolStripMenuItem ItemMenu = new ToolStripMenuItem();
                    ItemMenu.Tag   = Item.IDTipoRegistro;
                    ItemMenu.Text  = Item.Descripcion;
                    ItemMenu.Image = global::StephSoft.Properties.Resources.checar;

                    ItemMenu.ForeColor = Color.FromArgb(64, 64, 64);
                    ItemMenu.Click    += new System.EventHandler(this.ToolStripMenuItem_Click);
                    this.MenuStripChecado.Items.Add(ItemMenu);
                }
            }
            catch (Exception ex)
            {
                throw ex;
            }
        }
        public async Task <IActionResult> Edit(Guid id, [Bind("Descricao,Cor,Guid,DataAlteracao,DataCriacao,UsuarioAlterador,UsuarioCriador")] TipoRegistro tipoRegistro)
        {
            if (id != tipoRegistro.Guid)
            {
                return(NotFound());
            }

            if (ModelState.IsValid)
            {
                try
                {
                    tipoRegistro.UsuarioCriador   = tipoRegistro.UsuarioCriador;
                    tipoRegistro.UsuarioAlterador = "";
                    tipoRegistro.DataCriacao      = tipoRegistro.DataCriacao;
                    tipoRegistro.DataAlteracao    = DateTime.Now;

                    _context.Update(tipoRegistro);
                    await _context.SaveChangesAsync();
                }
                catch (DbUpdateConcurrencyException)
                {
                    if (!TipoRegistroExists(tipoRegistro.Guid))
                    {
                        return(NotFound());
                    }
                    else
                    {
                        throw;
                    }
                }
                return(RedirectToAction(nameof(Index)));
            }
            return(View(tipoRegistro));
        }
Esempio n. 5
0
        // Insertar un nuevo registro en el historial
        #region InsertaNuevoRegistroHistorial
        public static bool InsertaNuevoRegistroHistorial(long tarjetaId, TipoRegistro tipoRegistro)
        {
            OleDbCommand selectCmd = new OleDbCommand
            {
                CommandText = String.Format("SELECT PersonalId FROM Tarjeta WHERE TarjetaId LIKE {0}", tarjetaId),
                Connection  = dbConnection
            };

            OleDbCommand insertCmd = new OleDbCommand
            {
                CommandType = CommandType.Text,
                CommandText = String.Format("INSERT INTO Historial (PersonalId, HistorialTimeStamp, HistorialTipo) " +
                                            "VALUES (X,Now(),{0})", (int)tipoRegistro),
                Connection = dbConnection
            };

            try
            {
                if (dbConnection.State != ConnectionState.Open)
                {
                    dbConnection.Open();
                }

                OleDbDataReader dataReader = selectCmd.ExecuteReader();

                if (dataReader.HasRows)
                {
                    while (dataReader.Read())
                    {
                        insertCmd.CommandText = insertCmd.CommandText.Replace("X", dataReader.GetValue(0).ToString());
                    }

                    insertCmd.ExecuteNonQuery();
                }
                else
                {
#if Debug
                    GlobalData.PrintDebug("BD", "No se ha encontrado ningún PersonalId con esa tarjeta.");
#endif
                }

                dbConnection.Close();

                return(true);
            }
            catch (OleDbException ex)
            {
                MessageBox.Show("Ha habido un problema en la escritura a la base de datos. " +
                                "No se ha podido insertar la nueva información.", "Error",
                                MessageBoxButton.OK, MessageBoxImage.Warning);

#if Debug
                GlobalData.PrintDebug("ERROR ACCESS", "Mensaje: " + ex.Message);
                GlobalData.PrintDebug("ERROR ACCESS", "StackTrace: " + ex.StackTrace);
#endif

                return(false);
            }
        }
Esempio n. 6
0
        public ActionResult Delete(int?id)
        {
            var context = HttpContext.RequestServices.GetService(typeof(inventarioContext)) as inventarioContext;

            TipoRegistro personalDetail = context.TipoRegistro.Find(id);

            return(View(personalDetail));
        }
Esempio n. 7
0
 public Registro(string usuario, TipoRegistro tipoRegistro, string sql, Exception excepcion, string observaciones)
 {
     this.Fecha        = DateTime.Now;
     this.usuario      = usuario;
     this.TipoRegistro = tipoRegistro;
     this.Sql          = sql;
     this.CargarPilaLlamados(tipoRegistro, excepcion);
     this.Observaciones = Utilidades.CambiarSaltosLinea(observaciones);
 }
Esempio n. 8
0
        public IActionResult Edit(TipoRegistro emp)
        {
            var context = HttpContext.RequestServices.GetService(typeof(inventarioContext)) as inventarioContext;

            context.TipoRegistro.Update(emp);
            context.SaveChanges();
            TempData["message"] = "La información del tipo de registro ha sido actualizada";
            return(RedirectToAction("Index"));
        }
Esempio n. 9
0
        public IActionResult Create(TipoRegistro emp)
        {
            var context = HttpContext.RequestServices.GetService(typeof(inventarioContext)) as inventarioContext;

            context.TipoRegistro.Add(emp);
            context.SaveChanges();
            TempData["message"] = "El nuevo tipo de registro ha sido agreado";
            return(RedirectToAction("Index"));
        }
Esempio n. 10
0
        public Cabecalho(int modeloId, int linha, string descricao, TipoRegistro tipoRegistro, bool ocultar)
        {
            ModeloId     = modeloId;
            Linha        = linha;
            Descricao    = descricao;
            TipoRegistro = tipoRegistro;
            Ocultar      = ocultar;

            Validar();
        }
Esempio n. 11
0
        public ActionResult DeleteConfirmed(int id)
        {
            var context = HttpContext.RequestServices.GetService(typeof(inventarioContext)) as inventarioContext;

            TipoRegistro tipoRegistro = context.TipoRegistro.Find(id);

            context.TipoRegistro.Remove(tipoRegistro);
            context.SaveChanges();
            TempData["message"] = "La información del tipo de registro ha sido Eliminada";
            return(RedirectToAction("Index"));
        }
 public frmChecarEntradaSalida(TipoRegistro TipoRegistro)
 {
     try
     {
         InitializeComponent();
         DatosTipoRegistro = TipoRegistro;
     }
     catch (Exception ex)
     {
         LogError.AddExcFileTxt(ex, "frmChecarEntradaSalida ~ frmChecarEntradaSalida");
     }
 }
Esempio n. 13
0
 public List <TipoRegistro> ObtenerCatTipoRegistro(TipoRegistro Datos)
 {
     try
     {
         Catalogo_Datos CD = new Catalogo_Datos();
         return(CD.ObtenerCatTipoRegistro(Datos));
     }
     catch (Exception ex)
     {
         throw ex;
     }
 }
Esempio n. 14
0
        public static Formatter GetNativeFormatter(TipoRegistro TipoDados, Type type, object value)
        {
            if (TipoDados == TipoRegistro.Skip)
            {
                return(new SkipFormatter());
            }
            if (TipoDados == TipoRegistro.C && type == typeof(string))
            {
                return(new StringFormatter());
            }

            if (TipoDados == TipoRegistro.C && type == typeof(int))
            {
                return(new IntFormatter());
            }
            if (TipoDados == TipoRegistro.N && type == typeof(int))
            {
                return(new IntFormatter());
            }

            if (TipoDados == TipoRegistro.N && type == typeof(decimal))
            {
                return(new DecimalFormatter());
            }

            if (TipoDados == TipoRegistro.N && type == typeof(bool))
            {
                return(new BooleanFormatter());
            }

            if (type.IsEnum)
            {
                if (TipoDados == TipoRegistro.N) // int
                {
                    return(new EnumOfIntFormatter());
                }
            }


            if (TipoDados == TipoRegistro.C && type == typeof(object))
            {
                return(new StringFormatter());
            }

            //throw new NotImplementedException();
            return(new StringFormatter());
        }
        public void registrarTipoRegistro(ObjConexion obj, TipoRegistro tipoRegistro)
        {
            conexion(obj);
            string sql = Constantes.REGISTRAR_TIPO_REGISTRO;

            // Set the Connection, CommandText and Parameters.
            cmd = new OleDbCommand(sql, con);

            cmd.Parameters.Add("descripcionTipo", OleDbType.VarWChar, 100);
            cmd.Parameters[0].Value = tipoRegistro.DescripcionTipo;

            // Call  Prepare and ExecuteNonQuery.
            cmd.Prepare();
            cmd.ExecuteNonQuery();

            closeConexion();
        }
        public async Task <IActionResult> Create([Bind("Descricao,Cor,Guid,DataAlteracao,DataCriacao,UsuarioAlterador,UsuarioCriador")] TipoRegistro tipoRegistro)
        {
            if (ModelState.IsValid)
            {
                tipoRegistro.Guid             = Guid.NewGuid();
                tipoRegistro.UsuarioCriador   = "";
                tipoRegistro.UsuarioAlterador = "";
                tipoRegistro.DataCriacao      = DateTime.Now;
                tipoRegistro.DataAlteracao    = DateTime.Now;

                _context.Add(tipoRegistro);
                await _context.SaveChangesAsync();

                return(RedirectToAction(nameof(Index)));
            }
            return(View(tipoRegistro));
        }
 private void LlenarComboTipoRegistro()
 {
     try
     {
         TipoRegistro TRAux = new TipoRegistro {
             Conexion = Comun.Conexion, IncluirSelect = true
         };
         Catalogo_Negocio    CN    = new Catalogo_Negocio();
         List <TipoRegistro> Lista = CN.ObtenerCatTipoRegistro(TRAux);
         this.cmbTipoRegistro.DataSource    = Lista;
         this.cmbTipoRegistro.DisplayMember = "Descripcion";
         this.cmbTipoRegistro.ValueMember   = "IDTipoRegistro";
     }
     catch (Exception ex)
     {
         throw ex;
     }
 }
Esempio n. 18
0
        public static SerializableValue[] ReadObject(this IFixedLenLine Object)
        {
            var myType = Object.GetType();
            IList <PropertyInfo> props = new List <PropertyInfo>(myType.GetProperties());
            var dicProps = new Dictionary <int, SerializableValue>();

            foreach (var prop in props)
            {
                if (prop.GetCustomAttributes(typeof(IgnoreAttribute), true).Any())
                {
                    continue;
                }

                TipoRegistro tipo = TipoRegistro.Skip;

                var len = checkProperty <LengthAttribute>(myType, prop);
                tipo = checkProperty <TypeAttribute>(myType, prop).Tipo;
                var index = checkProperty <IndexAttribute>(myType, prop);

                if (dicProps.ContainsKey(index.Index))
                {
                    throw new InvalidOperationException("IndexAttribute can not be duplicate " + myType.Name + "." + prop.Name + ", Index:" + index.Index);
                }
                object propVal   = prop.GetValue(Object);
                var    formatter = Formatter.GetNativeFormatter(tipo, prop.PropertyType, propVal);
                if (formatter == null)
                {
                    throw new InvalidOperationException("None Formatter matched " + myType.Name + "." + prop.Name + ", Index:" + index.Index);
                }
                dicProps.Add(index.Index, new SerializableValue()
                {
                    Name      = prop.Name,
                    Index     = index.Index,
                    Length    = len.Length,
                    Decimals  = len.Decimals,
                    Tipo      = tipo,
                    Object    = propVal,
                    Type      = prop.PropertyType,
                    Formatter = formatter,
                });
            }

            return(dicProps.OrderBy(x => x.Key).Select(x => x.Value).ToArray());
        }
Esempio n. 19
0
 private void CargarPilaLlamados(TipoRegistro tipoRegistro, Exception excepcion)
 {
     if (excepcion == null)
     {
         if (tipoRegistro == DB.TipoRegistro.Actividad)
         {
             this.PilaLLamados = string.Empty;
         }
         else
         {
             this.PilaLLamados = new StackTrace().ToString();
         }
     }
     else
     {
         this.NombreExcepcion  = excepcion.GetType().FullName;
         this.MensajeExcepcion = excepcion.Message;
         this.PilaLLamados     = new StackTrace().ToString();
     }
 }
        public void actualizarTipoRegistro(ObjConexion obj, TipoRegistro tipoRegistro)
        {
            conexion(obj);

            string sql = Constantes.ACTUALIZAR_TIPO_MERCADERIA;

            // Set the Connection, CommandText and Parameters.
            cmd = new OleDbCommand(sql, con);

            cmd.Parameters.Add("idTipoRegistro", OleDbType.Integer);
            cmd.Parameters.Add("descripcionTipo", OleDbType.VarWChar, 100);
            cmd.Parameters[0].Value = tipoRegistro.IdTipoRegistro;
            cmd.Parameters[1].Value = tipoRegistro.DescripcionTipo;

            // Call  Prepare and ExecuteNonQuery.
            cmd.Prepare();
            cmd.ExecuteNonQuery();

            closeConexion();
        }
Esempio n. 21
0
 public List <TipoRegistro> ObtenerCatTipoRegistro(TipoRegistro Datos)
 {
     try
     {
         List <TipoRegistro> Lista = new List <TipoRegistro>();
         TipoRegistro        Item;
         SqlDataReader       Dr = SqlHelper.ExecuteReader(Datos.Conexion, "spCSLDB_get_CatTipoRegistro", Datos.IncluirSelect);
         while (Dr.Read())
         {
             Item = new TipoRegistro();
             Item.IDTipoRegistro = Dr.IsDBNull(Dr.GetOrdinal("IDTipoRegistro")) ? 0 : Dr.GetInt32(Dr.GetOrdinal("IDTipoRegistro"));
             Item.Descripcion    = Dr.IsDBNull(Dr.GetOrdinal("Descripcion")) ? string.Empty : Dr.GetString(Dr.GetOrdinal("Descripcion"));
             Lista.Add(Item);
         }
         return(Lista);
     }
     catch (Exception ex)
     {
         throw ex;
     }
 }
 private Checador ObtenerDatos()
 {
     try
     {
         Checador     DatosAux = new Checador();
         Usuario      UserAux  = (Usuario)this.cmbEmpleados.SelectedItem;
         TipoRegistro TRAux    = (TipoRegistro)this.cmbTipoRegistro.SelectedItem;
         DatosAux.IDEmpleado     = UserAux.IDEmpleado;
         DatosAux.IDTipoRegistro = TRAux.IDTipoRegistro;
         DatosAux.FechaChecador  = this.dtpFecha.Value;
         DatosAux.Motivo         = this.txtMotivo.Text.Trim();
         DatosAux.DispChecador   = false;
         DatosAux.IDUsuario      = Comun.IDUsuario;
         DatosAux.Conexion       = Comun.Conexion;
         return(DatosAux);
     }
     catch (Exception ex)
     {
         throw ex;
     }
 }
Esempio n. 23
0
        /// <summary>
        /// Método Priavdo encargado de Inicializar los Atributos dado un Id de Registro
        /// </summary>
        /// <param name="tipo">Tipo</param>
        /// <param name="id_registro">Id Registro</param>
        /// <returns></returns>
        public bool cargaAtributosInstancia(TipoRegistro tipo, int id_registro)
        {
            int idConfiguracionUnidad = 0, idCompaniaEmisor = 0, idTipo = 0;

            //Validamos Tipo de Carga
            if (tipo == TipoRegistro.IdConfiguracionAsignacionRecurso)
            {
                idConfiguracionUnidad = id_registro;
                idTipo = 3;
            }
            else
            {
                idCompaniaEmisor = id_registro;
                idTipo           = 4;
            }

            //Declarando Objeto de Retorno
            bool result = false;

            //Armando Objeto de Parametros
            object[] param = { idTipo, idConfiguracionUnidad, idCompaniaEmisor, "", 0, false, "", "" };
            //Obteniendo Resultado del SP
            using (DataSet ds = CapaDatos.m_capaDeDatos.EjecutaProcAlmacenadoDataSet(_nom_sp, param))
            {         //Validando Origen de Datos
                if (TSDK.Datos.Validacion.ValidaOrigenDatos(ds, "Table"))
                {     //Recorriendo cada Fila
                    foreach (DataRow dr in ds.Tables["Table"].Rows)
                    { //Asignando Valores
                        this._id_configuracion_asignacion_recurso = Convert.ToInt32(dr["Id"]);
                        this._id_compania_emisor = Convert.ToInt32(dr["IdCompaniaEmisor"]);
                        this._descripcion        = dr["Descripcion"].ToString();
                        this._habilitar          = Convert.ToBoolean(dr["Habilitar"]);
                    }
                    //Asignando Resultado a Positivo
                    result = true;
                }
            }
            //Devolviendo Objeto de Retorno
            return(result);
        }
Esempio n. 24
0
        public static void GrabarLogs(TipoRegistro tipoRegistro, string sql, Exception excepcion, string observaciones)
        {
            string pathlogs   = ConfigurationManager.AppSettings["PathToLogs"];
            string aplicalogs = ConfigurationManager.AppSettings["AplicaLogs"];
            string usuario;
            string nombreArchivo = "Registro";

            if (HttpContext.Current != null)
            {
                usuario = HttpContext.Current.User.Identity.Name.ToString().ToLower();
            }
            else
            {
                usuario = "automatico";
            }

            bool registrarLog = false;

            if (tipoRegistro != TipoRegistro.Actividad || aplicalogs == "true")
            {
                registrarLog = true;
            }

            if (registrarLog)
            {
                if (pathlogs == "")
                {
                    throw new Exception(excepcion.ToString());                 //return;
                }
                CarpetaRegistro carpetaRegistro = new CarpetaRegistro(pathlogs, usuario, nombreArchivo);

                ArchivoRegistro archivoRegistro = AdministradorCarpetasRegistro.CargarArchivoRegistro(carpetaRegistro);

                Registro registro = new Registro(usuario, tipoRegistro, sql, excepcion, observaciones);

                archivoRegistro.AgregarRegistro(registro);

                AdministradorCarpetasRegistro.GuardarArchivoRegistro(carpetaRegistro, archivoRegistro);
            }
        }
Esempio n. 25
0
 public TypeAttribute(TipoRegistro tipo)
 {
     this.Tipo = tipo;
 }
Esempio n. 26
0
        // Lee la tarjeta e introduce el tipo de registro correspondiente en la BD,
        // con la hora y el ID del personal.
        #region LecturaTarjetaRegistroHistorial
        private async void LecturaTarjetaRegistroHistorial(TipoRegistro tipoRegistro)
        {
            LectorTarjetas.MuestraMensajeLCD("Por favor, pase la tarjeta");

            CancellationTokenSource source = new CancellationTokenSource();

            source.CancelAfter(TimeSpan.FromSeconds(10)); // Timeout de 10 segundos
            Task <long> leeTarjeta = Task.Run(() => LectorTarjetas.LecturaTarjeta(source.Token), source.Token);

            btEntrada.IsEnabled         = false;
            btSalida.IsEnabled          = false;
            btDescansoEntrada.IsEnabled = false;
            btDescansoSalida.IsEnabled  = false;
            btComidaEntrada.IsEnabled   = false;
            btComidaSalida.IsEnabled    = false;

            long numTarjeta = await leeTarjeta;

            source.Dispose();

            // Inserta los datos del registro en la BD
            if (numTarjeta != -1)
            {
                AccessHelper.InsertaNuevoRegistroHistorial(numTarjeta, tipoRegistro);
#if DEBUG
                GlobalData.PrintDebug("SistemaFichaje.cs", "[" + DateTime.Now + "] Se ha leído la tarjeta con número:" + numTarjeta + ".\n");
#endif

                string nombre = AccessHelper.NombreDePersonalConIDTarjeta(numTarjeta), msg = "";

                if (nombre == "null")
                {
                    msg = String.Format("[{0:hh:mm:ss}] No se reconoce ID.", DateTime.Now);
                }
                else
                {
                    if (tipoRegistro == TipoRegistro.Entrada)
                    {
                        msg = String.Format("[{0:hh:mm:ss}] Entrada [{1}]", DateTime.Now, nombre);
                    }
                    else if (tipoRegistro == TipoRegistro.Salida)
                    {
                        msg = String.Format("[{0:hh:mm:ss}] Salida [{1}]", DateTime.Now, nombre);
                    }
                    else if (tipoRegistro == TipoRegistro.DescansoSalida)
                    {
                        msg = String.Format("[{0:hh:mm:ss}] Salida Descanso [{1}]", DateTime.Now, nombre);
                    }
                    else if (tipoRegistro == TipoRegistro.DescansoEntrada)
                    {
                        msg = String.Format("[{0:hh:mm:ss}] Entrada Descanso [{1}]", DateTime.Now, nombre);
                    }
                }
#if DEBUG
                GlobalData.PrintDebug("SistemaFichaje.cs", msg + "\n");
#endif
                LectorTarjetas.LimpiaPantallaLCD();
                LectorTarjetas.MuestraMensajeLCD(msg);
                LectorTarjetas.TimerLimpiaPantallaLCD();
            }
            else
            {
#if DEBUG
                GlobalData.PrintDebug("SistemaFichaje.cs", "[" + DateTime.Now + "] No se ha recibido ninguna tarjeta o el formato no es válido.");
#endif
                LectorTarjetas.LimpiaPantallaLCD();
                LectorTarjetas.MuestraMensajeLCD("No se reconoce ID");
                LectorTarjetas.TimerLimpiaPantallaLCD();
            }

            btEntrada.IsEnabled         = true;
            btSalida.IsEnabled          = true;
            btDescansoEntrada.IsEnabled = true;
            btDescansoSalida.IsEnabled  = true;
            btComidaEntrada.IsEnabled   = true;
            btComidaSalida.IsEnabled    = true;
        }
 private List <Error> ValidarDatos()
 {
     try
     {
         List <Error> Errores = new List <Error>();
         int          Aux     = 0;
         if (this.cmbEmpleados.SelectedIndex == -1)
         {
             Errores.Add(new Error {
                 Numero = (Aux += 1), Descripcion = "Seleccione un empleado de la lista.", ControlSender = this.cmbEmpleados
             });
         }
         else
         {
             Usuario AuxEmp = (Usuario)this.cmbEmpleados.SelectedItem;
             if (string.IsNullOrEmpty(AuxEmp.IDEmpleado.Trim()))
             {
                 Errores.Add(new Error {
                     Numero = (Aux += 1), Descripcion = "Seleccione un empleado de la lista.", ControlSender = this.cmbEmpleados
                 });
             }
         }
         if (this.cmbTipoRegistro.SelectedIndex == -1)
         {
             Errores.Add(new Error {
                 Numero = (Aux += 1), Descripcion = "Seleccione un tipo de registro de la lista.", ControlSender = this.cmbTipoRegistro
             });
         }
         else
         {
             TipoRegistro AuxTReg = (TipoRegistro)this.cmbTipoRegistro.SelectedItem;
             if (AuxTReg.IDTipoRegistro == 0)
             {
                 Errores.Add(new Error {
                     Numero = (Aux += 1), Descripcion = "Seleccione un tipo de registro de la lista.", ControlSender = this.cmbTipoRegistro
                 });
             }
         }
         if (DateTime.Today.AddDays(1) <= this.dtpFecha.Value)
         {
             Errores.Add(new Error {
                 Numero = (Aux += 1), Descripcion = "La fecha del registro no puede ser mayor a la fecha Actual.", ControlSender = this.dtpFecha
             });
         }
         if (DateTime.Today > this.dtpFecha.Value.AddDays(5))
         {
             Errores.Add(new Error {
                 Numero = (Aux += 1), Descripcion = "Solo se pueden agregar registros con fecha mayor a " + DateTime.Today.AddDays(-5).ToShortDateString(), ControlSender = this.dtpFecha
             });
         }
         if (string.IsNullOrEmpty(this.txtMotivo.Text.Trim()))
         {
             Errores.Add(new Error {
                 Numero = (Aux += 1), Descripcion = "Ingrese el motivo por el cual se realiza el registro manual.", ControlSender = this.txtMotivo
             });
         }
         return(Errores);
     }
     catch (Exception ex)
     {
         throw ex;
     }
 }