Exemple #1
0
        /// <summary>
        /// Retorna un coleccion de registros de tipo [Tabla]..Roles
        /// </summary>
        /// <returns>Lista</returns>
        public List <BESistema> List(string prm_CodigoSistema, string prm_Nombre, string prm_Descripcion, bool?prm_Estado)
        {
            List <BESistema> lista = new List <BESistema>();

            try
            {
                using (_DBMLSeguridadSistemaDataContext SeguridadDC = new _DBMLSeguridadSistemaDataContext(conexion))
                {
                    var resul = SeguridadDC.omgc_mnt_GetAll_Sistema(prm_CodigoSistema, prm_Nombre, prm_Descripcion, prm_Estado);
                    foreach (var item in resul)
                    {
                        lista.Add(new BESistema()
                        {
                            codSistema        = item.codSistema,
                            desDescripcion    = item.desDescripcion,
                            desNombre         = item.desNombre,
                            indEstado         = item.indEstado,
                            segUsuarioCrea    = item.segUsuarioCrea,
                            segFechaHoraCrea  = Convert.ToDateTime(item.segFechaHoraCrea),
                            segUsuarioEdita   = item.segUsuarioEdita,
                            segFechaHoraEdita = item.segFechaHoraEdita,
                            segMaquinaCrea    = item.segMaquinaOrigen
                        });
                    }
                }
            }
            catch (Exception ex)
            {
                throw;
            }
            return(lista);
        }
Exemple #2
0
        public IEnumerable <ComboListItemString> GetComboSistemas()
        {
            List <ComboListItemString> lstSistema = null;

            try
            {
                using (_DBMLSeguridadSistemaDataContext SQLDC = new _DBMLSeguridadSistemaDataContext(conexion))
                {
                    lstSistema = new List <ComboListItemString>();
                    var resul = from s in SQLDC.omgc_mnt_GetAll_Sistema(string.Empty, string.Empty, string.Empty, true)
                                where s.indEstado == true
                                orderby s.desNombre
                                select s;

                    foreach (var item in resul)
                    {
                        var itemCombo = new ComboListItemString();

                        itemCombo.value = item.codSistema;
                        itemCombo.text  = item.desNombre;
                        lstSistema.Add(itemCombo);
                    }
                }
            }
            catch (Exception)
            {
                throw;
            }
            finally
            {
                if (lstSistema == null)
                {
                    lstSistema = new List <ComboListItemString>();
                }
            }
            return(lstSistema);
        }