Пример #1
0
        public List <object> RetrieveAll()
        {
            DataTable     tabla = new DataTable();
            List <object> lista = new List <object>();

            tabla = DALSqlHelper.instancia.EjecutarConsulta("PERMISOS_LISTAR");

            foreach (DataRow registro in tabla.Rows)
            {
                if (registro["COMPUESTO"].ToString() == "X")
                {
                    BECompuesto result = new BECompuesto();
                    //result.IdPermiso = registro["IDPERMISO"];
                    result.IdPermiso = Convert.ToInt32(registro["IDPERMISO"].ToString());
                    // result.Posicion = registro("POSICION")
                    lista.Add(result);
                    result = null /* TODO Change to default(_) if this is not a reference type */;
                }
                else
                {
                    BEHoja result2 = new BEHoja();
                    //result2.IdPermiso = registro("IDPERMISO");
                    result2.IdPermiso = Convert.ToInt32(registro["IDPERMISO"].ToString());

                    // result2.Posicion = registro("POSICION")
                    result2.Formulario = registro["FORMULARIO"].ToString();
                    lista.Add(result2);
                    result2 = null /* TODO Change to default(_) if this is not a reference type */;
                }
            }

            return(lista);
        }
Пример #2
0
        public List <BEHoja> ListarFormularios()
        {
            DataTable     tabla = new DataTable();
            List <BEHoja> lista = new List <BEHoja>();

            tabla = DALSqlHelper.instancia.EjecutarConsulta("FORMULARIOS_LISTAR");

            foreach (DataRow registro in tabla.Rows)
            {
                BEHoja result2 = new BEHoja();


                if (registro["FORMULARIO"] == DBNull.Value)
                {
                    result2.Formulario = "";
                }
                else
                {
                    result2.Formulario = registro["FORMULARIO"].ToString();
                }

/*                if (IsDBNull(registro("FORMULARIO")) == true)
 *                  result2.Formulario = "";
 *              else
 *                  result2.Formulario = registro("FORMULARIO");
 */


                lista.Add(result2);
                result2 = null /* TODO Change to default(_) if this is not a reference type */;
            }

            return(lista);
        }
Пример #3
0
        // Dim ngbitacora As New BLLBitacora


        public int Crear(List <BEComponente> Permisos)
        {
            List <BEComponente> lista = new List <BEComponente>();
            int res;

            foreach (BEComponente t in Permisos)
            {
                if (t is BEHoja)
                {
                    BEHoja res2 = new BEHoja();
                    // res2.Posicion = t.Posicion
                    res2.Formulario = t.Formulario;

                    lista.Add(res2);
                    res2 = null /* TODO Change to default(_) if this is not a reference type */;
                }
                else if (t is BECompuesto)
                {
                    BECompuesto res1 = new BECompuesto();

                    // res1.Posicion = t.Posicion


                    lista.Add(res1);
                    res1 = null /* TODO Change to default(_) if this is not a reference type */;
                }
            }

            res = mppermisos.Create(lista);

            return(res);
        }