void GrdRegiones_ItemCommand(object sender, GridCommandEventArgs e) { if (e.CommandName == "CmdSubRegiones") { DivSubRegiones.Visible = true; GrdSubRegiones.Visible = true; TxtRegionId.Text = e.Item.OwnerTableView.DataKeyValues[e.Item.ItemIndex]["RegionId"].ToString(); TxtNoRegion.Text = e.Item.OwnerTableView.DataKeyValues[e.Item.ItemIndex]["No_Region"].ToString(); GrdSubRegiones.Rebind(); } else if (e.CommandName == "CmdPoligono") { RadWindowDetalle.Title = "Poligono de la región"; RadWindowDetalle.NavigateUrl = "~/WebForms/Wfrm_Poligno_Region.aspx?region=" + HttpUtility.UrlEncode(ClUtilitarios.Encrypt(e.Item.OwnerTableView.DataKeyValues[e.Item.ItemIndex]["Nombre"].ToString(), true)) + "®ionid=" + HttpUtility.UrlEncode(ClUtilitarios.Encrypt(e.Item.OwnerTableView.DataKeyValues[e.Item.ItemIndex]["RegionId"].ToString(), true)) + ""; ScriptManager.RegisterStartupScript(this, this.GetType(), "key", "function f(){$find('" + RadWindowDetalle.ClientID + "').show();Sys.Application.remove_load(f);}Sys.Application.add_load(f);", true); } }
void BtnGrabar_ServerClick(object sender, EventArgs e) { DivNoErr.Visible = false; DivErr.Visible = false; if (ValidaSubRegion() == true) { int PersonaId = 0; if (CboPersona.SelectedIndex > 0) { PersonaId = Convert.ToInt32(CboPersona.SelectedValue); } ClRegiones.Insert_SubRegion(TxtNoSubRegion.Text, TxtNoRegion.Text + "-" + TxtNoSubRegion.Text, TxtSubRegion.Text, PersonaId, TxtUbicacion.Text, Convert.ToInt32(TxtRegionId.Text), Convert.ToInt32(CboMunicipioSubRegion.SelectedValue)); BloqInsertRegion(); DivNoErr.Visible = true; LblMensajeNoErr.Text = "Sub región grabada"; GrdSubRegiones.Rebind(); } }
void GrdSubRegiones_ItemCommand(object sender, GridCommandEventArgs e) { if (e.CommandName == "CmdInac") { ClRegiones.Update_Estatus_SubRegion(Convert.ToInt32(e.Item.OwnerTableView.DataKeyValues[e.Item.ItemIndex]["SubRegionId"]), 2); GrdSubRegiones.Rebind(); } else if (e.CommandName == "CmdActivar") { ClRegiones.Update_Estatus_SubRegion(Convert.ToInt32(e.Item.OwnerTableView.DataKeyValues[e.Item.ItemIndex]["SubRegionId"]), 1); GrdSubRegiones.Rebind(); } else if (e.CommandName == "CmdMunicipios") { TxtSubRegionId.Text = e.Item.OwnerTableView.DataKeyValues[e.Item.ItemIndex]["SubRegionId"].ToString(); GrdMunicipios.Visible = true; DivMunicipios.Visible = true; GrdMunicipios.Rebind(); } }