Example #1
0
        protected void lkbGerarSegmentos_Click(object sender, EventArgs e)
        {
            var modelo      = new VO.Modelo();
            var bizSegmento = new BLL.SegmentoBLL();

            modelo.IDModelo = Convert.ToInt32(ddlModelo.SelectedValue);
            modelo.Usuario  = ((VO.Usuario)HttpContext.Current.Session["UsuarioLogado"]);

            try
            {
                bizSegmento.GerarCodigoSegmento(modelo);
            }
            catch (BLL.Exceptions.RegraLogicaInvalida ex)
            {
                ClientScript.RegisterClientScriptBlock(this.GetType(), Guid.NewGuid().ToString(), "alert('" + ex.Message + "');", true);
            }

            PreencheGrid();
        }
Example #2
0
        public void PreencheGrid()
        {
            if (!string.IsNullOrEmpty(ddlModelo.SelectedValue))
            {
                var segmento    = new VO.Segmento();
                var bizSegmento = new BLL.SegmentoBLL();

                segmento.IDSegmento = null;
                segmento.Modelo     = new VO.Modelo()
                {
                    IDModelo = Convert.ToInt32(ddlModelo.SelectedValue)
                };

                segmento = bizSegmento.Listar(segmento);

                grvGeracaoSegmentos.DataSource = segmento.SegmentoLista;
                grvGeracaoSegmentos.DataBind();
            }
        }