Beispiel #1
0
        public ActionResult confirma(FormCollection frm)
        {
            tipoAnimalDTO dto = new tipoAnimalDTO();
            tipoAnimalBLL bll = new tipoAnimalBLL();

            dto.codTipo = frm["txtCod"];
            dto.tipo    = frm["txtTipo"];

            bll.inserirTipo(dto);

            return(View());
        }
Beispiel #2
0
        public ActionResult consulta()
        {
            tipoAnimalBLL bll = new tipoAnimalBLL();

            GridView dgv = new GridView(); //mesma coisa do datagridview do windowsfrom

            dgv.DataSource = bll.consultaTipo();
            dgv.DataBind();
            StringWriter   sw  = new StringWriter();
            HtmlTextWriter htw = new HtmlTextWriter(sw);

            dgv.RenderControl(htw);
            ViewBag.GridViewString = sw.ToString();


            return(View());
        }
Beispiel #3
0
        public ActionResult resultado(FormCollection frm)
        {
            tipoAnimalDTO dto = new tipoAnimalDTO();
            tipoAnimalBLL bll = new tipoAnimalBLL();

            GridView dgv = new GridView();

            dto.codTipo = frm["txtCod"];

            dgv.DataSource = bll.buscaTipo(dto); //puxa o metodo de pesquisa e usa o termo inserido pelo usuario
            dgv.DataBind();
            StringWriter   sw  = new StringWriter();
            HtmlTextWriter htw = new HtmlTextWriter(sw);

            dgv.RenderControl(htw);
            ViewBag.GridViewString = sw.ToString();

            return(View());
        }