Beispiel #1
0
 protected void btnNovo_Click1(object sender, EventArgs e)
 {
     txtDescricaoObra.Text        = "";
     txtNumeroObra.Text           = "";
     cmbAreaNegocio.SelectedIndex = 0;
     Session["Obra"] = null;
     ModObra.Show();
 }
Beispiel #2
0
        protected void gvdWebObra_RowCommand(object sender, GridViewCommandEventArgs e)
        {
            if (e.CommandName == "Editar")
            {
                Obra = new tblObra(Global.GetConnection(), e.CommandArgument.ToString());
                txtNumeroObra.Text    = Obra.cmpNuObra;
                txtDescricaoObra.Text = Obra.cmpNoObra;
                txtNumeroObra.Text    = Obra.cmpNuObra;
                cmbAreaNegocio.ClearSelection();// esse comando é valido para a combo
                //if (string.IsNullOrEmpty(Obra.cmpCoAreaNegocio)==false)
                //{
                //    ListItem it=  cmbAreaNegocio.Items.FindByValue(Obra.cmpCoAreaNegocio);
                //    if (it != null)
                //    {

                //        it.Selected = true;
                //    }
                //}
                Session["Obra"] = Obra;
                ModObra.Show();
            }

            if (e.CommandName == "Select")
            {
                List <string> lstNavegacao;
                lstNavegacao = (List <string>)Session["Navegacao"];
                Obra         = new tblObra(Global.GetConnection(), e.CommandArgument.ToString());
                lstNavegacao.Add(Obra.cmpNoObra);
                Session["Navegacao"] = lstNavegacao;
                if (Session["cmpCoObra"] == null)
                {
                    Session.Add("cmpCoObra", e.CommandArgument);
                }
                Session["cmpCoObra"] = e.CommandArgument;
                Response.Redirect("webSistemasPrediais.aspx");
            }
        }