protected void LnkBtnNuevo_Click(object sender, EventArgs e)
 {
     if (LnkBtnNuevo.Text == "Nuevo")
     {
         TxtComunidad.Text        = "";
         DropDownListCOM.Visible  = false;
         DropDownListPROV.Enabled = true;
         DropDownListMUN.Enabled  = true;
         TxtComunidad.Visible     = true;
         LnkBtnNuevo.Text         = "Registrar";
     }
     else
     {
         DB_AP_Comunidad ic = new DB_AP_Comunidad();
         AP_Comunidad    c  = new AP_Comunidad();
         c.Id_Municipio = Convert.ToInt32(DropDownListMUN.SelectedValue);
         c.Nombre       = TxtComunidad.Text;
         ic.DB_Registrar_COMUNIDAD(c);
         LnkBtnNuevo.Text     = "Nuevo";
         TxtComunidad.Visible = false;
         DB_AP_Comunidad mun = new DB_AP_Comunidad();
         this.DropDownListCOM.Enabled = true;
         this.DropDownListCOM.Items.Clear();
         mun.DB_Desplegar_COMUNIDAD_DROPDOWNLIST(Convert.ToInt32(this.DropDownListMUN.SelectedValue), DropDownListCOM);
         DropDownListCOM.Visible = true;
     }
 }
示例#2
0
        public void DB_Registrar_COMUNIDAD(AP_Comunidad c)
        {
            DA_AP_Comunidad insert = new DA_AP_Comunidad();

            insert.DA_Registrar_COMUNIDAD(c);
        }