Exemple #1
0
        internal static void ListarCargo(DropDownList ddlcargo)
        {
            CargoDAO db = new CargoDAO();

            ddlcargo.DataSource     = db.Listar();
            ddlcargo.DataTextField  = "Nombre";
            ddlcargo.DataValueField = "Codigo";
            ddlcargo.DataBind();
            ddlcargo.Items.Insert(0, new ListItem("Seleccione", "0"));
        }
 public IActionResult Index()
 {
     ViewBag.ListaCargo = _cargoDAO.Listar();
     return(View());
 }
 public IActionResult Cadastrar()
 {
     ViewBag.Cargos = new SelectList(_cargoDAO.Listar(), "CargoId", "Nome");
     return(View());
 }