コード例 #1
0
ファイル: RolData.cs プロジェクト: ocarril/gh-sgpvdlls
        /// <summary>
        /// Retorna un coleccion de registros de tipo [Tabla]..Roles
        /// </summary>
        /// <returns>Lista</returns>
        public List <BERolAux> List(string prm_Nombre, string prm_CodigoSistema, string prm_Descripcion, bool prm_Estado)
        {
            List <BERolAux> lista = new List <BERolAux>();

            try
            {
                using (_DBMLSeguridadSistemaDataContext SeguridadDC = new _DBMLSeguridadSistemaDataContext(conexion))
                {
                    var resul = SeguridadDC.omgc_mnt_GetAll_Rol(prm_Nombre, prm_CodigoSistema, prm_Descripcion, prm_Estado);
                    foreach (var item in resul)
                    {
                        lista.Add(new BERolAux()
                        {
                            codRol            = item.codRol,
                            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,
                            codSistemaNombre  = item.codSistemaNombre,
                        });
                    }
                }
            }
            catch (Exception ex)
            {
                throw ex;
            }
            return(lista);
        }
コード例 #2
0
ファイル: CommonData.cs プロジェクト: ocarril/gh-sgpvdlls
        public IEnumerable <ComboListItemString> GetComboRoles(string pcodSistema)
        {
            List <ComboListItemString> lstRoles = null;

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

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

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