Example #1
0
 protected void Page_Load(object sender, EventArgs e)
 {
     id = int.Parse(Request.QueryString["id"].ToString());
     DAL.DALRota p    = new DAL.DALRota();
     Modelo.Rota rota = p.Select(id);
     if (!IsPostBack)
     {
         TextBox1.Text = rota.nome;
         DAL.DALBairro dal_bairro = new DAL.DALBairro();
         ListItem      li;
         foreach (Modelo.Bairro b in dal_bairro.SelectAll())
         {
             li       = new ListItem();
             li.Text  = b.Nome;
             li.Value = (b.Id).ToString();
             if (p.HasBairro(b.Id, rota.id))
             {
                 li.Selected = true;
             }
             ListBoxBairro.Items.Add(li);
         }
         DAL.DALPonto_referencia dal_referencia = new DAL.DALPonto_referencia();
         foreach (Modelo.Ponto_referencia ponto in dal_referencia.SelectAll())
         {
             li       = new ListItem();
             li.Text  = ponto.Nome;
             li.Value = (ponto.Id).ToString();
             if (p.HasReferencia(ponto.Id, rota.id))
             {
                 li.Selected = true;
             }
             ListBoxReferencia.Items.Add(li);
         }
     }
 }
Example #2
0
        protected void BtnSearch_Click(object sender, EventArgs e)
        {
            try
            {
                string option = DDLSearch.Text;
                string value  = valueSearch.Text;

                DAL.DALBairro aDALBairro = new DAL.DALBairro();

                Repeater1.DataSourceID = null;
                Repeater1.DataSource   = aDALBairro.SearchSelect(value, option);
                Repeater1.DataBind();
            }
            catch { }
        }
Example #3
0
        protected void getModalInfos_Click(object sender, EventArgs e)
        {
            string rname = ((Button)sender).CommandArgument.ToString();

            DAL.DALBairro p = new DAL.DALBairro();
            Repeater2.DataSourceID = null;
            Repeater2.DataSource   = p.SelectBairros(rname);
            Repeater2.DataBind();

            DAL.DALPonto_referencia b = new DAL.DALPonto_referencia();
            Repeater3.DataSourceID = null;
            Repeater3.DataSource   = b.SelectPontos(rname);
            Repeater3.DataBind();



            modalContainer.Style.Add("visibility", "visible");
        }
Example #4
0
 protected void Page_Load(object sender, EventArgs e)
 {
     if (!IsPostBack)
     {
         /*DALBairro dal_bairro = new DALBairro();
          * ListItem li;
          * foreach (Bairro b in dal_bairro.SelectAll())
          * {
          *  li = new ListItem();
          *  li.Text = b.Nome;
          *  li.Value = (b.Id).ToString();
          *  CheckBoxListBairro.Items.Add(li);
          * }
          * DALPonto_referencia dal_referencia = new DALPonto_referencia();
          * foreach (Ponto_referencia p in dal_referencia.SelectAll())
          * {
          *  li = new ListItem();
          *  li.Text = p.Nome;
          *  li.Value = (p.Id).ToString();
          *  CheckBoxListReferencia.Items.Add(li);
          * }*/
         DAL.DALBairro dal_bairro = new DAL.DALBairro();
         ListItem      li;
         foreach (Modelo.Bairro b in dal_bairro.SelectAll())
         {
             li       = new ListItem();
             li.Text  = b.Nome;
             li.Value = (b.Id).ToString();
             ListBoxBairro.Items.Add(li);
         }
         DAL.DALPonto_referencia dal_referencia = new DAL.DALPonto_referencia();
         foreach (Modelo.Ponto_referencia ponto in dal_referencia.SelectAll())
         {
             li       = new ListItem();
             li.Text  = ponto.Nome;
             li.Value = (ponto.Id).ToString();
             ListBoxReferencia.Items.Add(li);
         }
     }
 }