protected void ddlApp_SelectedIndexChanged(object sender, EventArgs e) { BLSoftware sw = new BLSoftware(); BLCatalogos objCatalogo = new BLCatalogos(); int App_Id = 0; USel.Rows.Clear(); int.TryParse(ddlApp.SelectedValue, out App_Id); pnlRel.Enabled = false; if (App_Id > 0) { pnlRel.Enabled = true; USel = sw.InformacionRelAppBD(App_Id); grdDatos.DataSource = USel; grdDatos.DataBind(); ddlBD.DataSource = MinusDT(objCatalogo.ListaBDConServerInstanciaRel(), "AppBD_Id", USel, "AppBD_Id"); ddlBD.DataBind(); } else { grdDatos.DataSource = null; grdDatos.DataBind(); ddlBD.DataSource = null; ddlBD.DataBind(); chkEsPropietaria.Checked = false; } }
protected void grdDatos_RowDeleting(object sender, System.Web.UI.WebControls.GridViewDeleteEventArgs e) { ProcesarUSel(); foreach (DataControlFieldCell cell in grdDatos.Rows[e.RowIndex].Cells) { for (int w = 0; w < USel.Rows.Count; w++) { if (USel.Rows[w][0].ToString() == cell.Text) { BLCatalogos objCatalogo = new BLCatalogos(); USel.Rows[w].Delete(); USel.AcceptChanges(); ddlBD.DataSource = MinusDT(objCatalogo.ListaBDConServerInstanciaRel(), "AppBD_Id", USel, "AppBD_Id"); ddlBD.DataBind(); grdDatos.DataSource = USel; grdDatos.DataBind(); break; } } } }
protected void btnProcesarD_Click(object sender, EventArgs e) { int Srv_Id = 0; System.Data.DataRow row; int.TryParse(ddlBD.SelectedValue, out Srv_Id); if (Srv_Id > 0) { BLCatalogos objCatalogo = new BLCatalogos(); ProcesarUSel(); row = USel.NewRow(); row[0] = Srv_Id.ToString(); row[1] = ddlBD.SelectedItem.Text; row[2] = chkEsPropietaria.Checked ? "S" : "N"; USel.Rows.Add(row); USel.AcceptChanges(); ddlBD.DataSource = MinusDT(objCatalogo.ListaBDConServerInstanciaRel(), "AppBD_Id", USel, "AppBD_Id"); ddlBD.DataBind(); grdDatos.DataSource = USel; grdDatos.DataBind(); } else { MsgBoxU.AddMessage("Debe seleccionar una BD", YaBu.MessageBox.uscMsgBox.enmMessageType.Attention); } if (ddlBD.Items.Count > 0) { ddlBD.SelectedIndex = 0; btnProcesarD.Enabled = true; } else { btnProcesarD.Enabled = false; } chkEsPropietaria.Checked = false; }