protected void btnProcesar_Click(object sender, EventArgs e) { lblNoRegs.Visible = false; if (Page.IsValid) { BLSoftware objGrupoSoftware = new BLSoftware(); switch (ddlFiltro.SelectedValue) { case "CR": grdDatos.DataSource = objGrupoSoftware.BuscarDocumentoMI(ddlFiltro.SelectedValue, Numero_Prestamo: Convert.ToInt32(txtFiltro.Text)); break; case "NJ": grdDatos.DataSource = objGrupoSoftware.BuscarDocumentoMI(ddlFiltro.SelectedValue, Numero_Jit: txtFiltro.Text); break; case "NC": grdDatos.DataSource = objGrupoSoftware.BuscarDocumentoMI(ddlFiltro.SelectedValue, Codigo_Cliente: Convert.ToInt32(txtFiltro.Text)); break; case "CL": grdDatos.DataSource = objGrupoSoftware.BuscarDocumentoMI(ddlFiltro.SelectedValue, Nombre: txtFiltro.Text); break; } grdDatos.DataBind(); if (grdDatos.Rows.Count == 0) { lblNoRegs.Visible = true; } } }
protected void btnProcesar_Click(object sender, EventArgs e) { if (Page.IsValid) { BLSoftware objGrupoSoftware = new BLSoftware(); int AppSt_Id = 0; int AppT_Id = 0; int App_Id = 0; int.TryParse(ddlEstado.SelectedValue, out AppSt_Id); int.TryParse(ddlTipo.SelectedValue, out AppT_Id); int.TryParse(ddlApp.SelectedValue, out App_Id); if (AppSt_Id > 0 && AppT_Id > 0 && App_Id > 0) { objGrupoSoftware.ActualizarApp(App_Id, AppSt_Id, AppT_Id, txtNombre.Text.Trim(), txtDescripcion.Text.Trim(), chkEnTFS.Checked, chkProductiva.Checked, txtObservaciones.Text.Trim(), txtUbicacion.Text.Trim()); } else { MsgBoxU.AddMessage("Faltan campos por seleccionar", YaBu.MessageBox.uscMsgBox.enmMessageType.Attention); } objGrupoSoftware.HistoricoApp(this.Page.ToString().Substring(4, this.Page.ToString().Substring(4).Length - 5) + ".aspx", Session["UserNameLogin"].ToString(), "U", App_Id); DatosGenerales.EnviaMensaje("Proceso finalizado", "Modificación de aplicación", DatosGenerales.TiposMensaje.Informacion); } }
protected void LlenaEquipos(int idTipoEquipo, bool CargaDesdeGrid) { BLSoftware sw = new BLSoftware(); ddlEquipo.Items.Clear(); ddlEquipo.Enabled = false; if (idTipoEquipo > 0) { ddlEquipo.Enabled = true; sw.ObtenerEquipos(ref ddlEquipo, idTipoEquipo, CargaDesdeGrid ? false : true); ddlEquipo.DataBind(); if (CargaDesdeGrid) { for (int w = 0; w < ddlEquipo.Items.Count; w++) { if (ddlEquipo.Items[w].Value == grdDiscos.SelectedRow.Cells[idItem].Text) { ddlEquipo.Items[w].Selected = true; break; } } } } else { ddlEquipo.DataSource = null; ddlEquipo.DataBind(); } }
protected void btnProcesar_Click(object sender, EventArgs e) { BLSoftware objGrupoSoftware = new BLSoftware(); int App_Id = 0; string Res = ""; int.TryParse(ddlApp.SelectedValue, out App_Id); if (App_Id > 0) { Res = objGrupoSoftware.BorrarAppRelBD(App_Id); if (Res == "OK") { ProcesarGrid(App_Id); DatosGenerales.EnviaMensaje("Proceso finalizado", "Modificación de relación App-BD", DatosGenerales.TiposMensaje.Informacion); } else { MsgBoxU.AddMessage("Error: " + Res, YaBu.MessageBox.uscMsgBox.enmMessageType.Attention); } } else { MsgBoxU.AddMessage("Debe seleccionar una aplicación", YaBu.MessageBox.uscMsgBox.enmMessageType.Attention); } }
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 btnProcesar_Click(object sender, EventArgs e) { if (Page.IsValid) { BLSoftware objGrupoSoftware = new BLSoftware(); int AppSB_Id = 0; int Srv_Id = 0; int BD_Id = 0; int.TryParse(ddlInstancia.SelectedValue, out AppSB_Id); int.TryParse(ddlServidor.SelectedValue, out Srv_Id); int.TryParse(ddlBD.SelectedValue, out BD_Id); if (Srv_Id > 0 && BD_Id > 0 && AppSB_Id > 0) { objGrupoSoftware.ActualizarInstanciaBD(AppSB_Id, Srv_Id, BD_Id, txtNombre.Text.Trim()); } else { MsgBoxU.AddMessage("Se debe seleccionar un servidor y un tipo de base de datos", YaBu.MessageBox.uscMsgBox.enmMessageType.Attention); } objGrupoSoftware.HistoricoApp(this.Page.ToString().Substring(4, this.Page.ToString().Substring(4).Length - 5) + ".aspx", Session["UserNameLogin"].ToString(), "U", AppSB_Id); DatosGenerales.EnviaMensaje("Proceso finalizado", "Modificación de instancia BD", DatosGenerales.TiposMensaje.Informacion); } }
protected void ProcesarUSel() { BLSoftware objGrupoSoftware = new BLSoftware(); bool Chk; int Srv_Id = 0; System.Data.DataRow row; USel.Rows.Clear(); foreach (GridViewRow rowG in grdDatos.Rows) { Srv_Id = 0; Chk = ((CheckBox)rowG.FindControl("chkEsProp")).Checked; int.TryParse(rowG.Cells[CeldaId].Text, out Srv_Id); row = USel.NewRow(); row[0] = Srv_Id.ToString(); row[1] = rowG.Cells[CeldaNombre].Text; row[2] = Chk ? "S" : "N"; USel.Rows.Add(row); } USel.AcceptChanges(); }
protected void Page_Load(object sender, EventArgs e) { if (!IsPostBack) { ViewState["sortOrder"] = ""; CambiaEstadoNotificacion("Info", false, string.Empty); CambiaEstadoNotificacion("Warning", false, string.Empty); BLSoftware oblSoftware = new BLSoftware(); gvwSoftware.DataSource = oblSoftware.ObtieneSoftware(); gvwSoftware.DataBind(); List <TotalesSoftware> totalesSoftware = oblSoftware.ObtieneTotalesSoftware(0); grvTotalTipo.DataSource = totalesSoftware; grvTotalTipo.DataBind(); LLenaComboNumeroLicencias(); } else { if (hdnGenerrarControles.Value.Equals("1") && !hdnCve_Software.Value.Equals("0")) { InventarioHSC.Model.Software sofware = new Model.Software(); BLSoftware bolSoftware = new BLSoftware(); sofware = bolSoftware.Software(Convert.ToInt32(hdnCve_Software.Value)); string agregarTR = string.Empty; TableDetalle.Controls[3].Visible = false; GeneraControles(sofware.NumeroLicencias); } } }
protected void grdDiscos_RowDeleting(object sender, System.Web.UI.WebControls.GridViewDeleteEventArgs e) { foreach (DataControlFieldCell cell in grdDiscos.Rows[e.RowIndex].Cells) { for (int w = 0; w < USel.Rows.Count; w++) { if (USel.Rows[w][0].ToString() == cell.Text) { BLSoftware sw = new BLSoftware(); int Srv_Id = 0; int.TryParse(ddlServidor.SelectedItem.Value, out Srv_Id); if (Srv_Id > 0) { USel.Rows[w].Delete(); USel.AcceptChanges(); ddlUnidad.DataSource = MinusDT(LetrasUnidad(), "SrvD_Unidad", USel, "SrvD_Unidad"); ddlUnidad.DataBind(); sw.BorrarDiscosServidorApp(Srv_Id, cell.Text); //CargaDiscos(Srv_Id); Response.Redirect("ModificarDiscos.aspx?Srv=" + Srv_Id.ToString()); } break; } } } }
protected void btnProcesar_Click(object sender, EventArgs e) { if (Page.IsValid) { BLSoftware objGrupoSoftware = new BLSoftware(); string Resp = ""; int App_Id = 0; int BD_Id = 0; int.TryParse(ddlAplicacion.SelectedValue, out App_Id); int.TryParse(ddlBD.SelectedValue, out BD_Id); if (App_Id > 0 && BD_Id > 0) { Resp = objGrupoSoftware.InsertarAppRelBD(App_Id, BD_Id, chkPropietaria.Checked); } else { MsgBoxU.AddMessage("Se debe seleccionar una aplicación y una base de datos", YaBu.MessageBox.uscMsgBox.enmMessageType.Attention); } objGrupoSoftware.HistoricoApp(this.Page.ToString().Substring(4, this.Page.ToString().Substring(4).Length - 5) + ".aspx", Session["UserNameLogin"].ToString(), "I", App_Id, BD_Id); if (Resp == "") { DatosGenerales.EnviaMensaje("Proceso finalizado", "Alta de Relacion Aplicación-BD", DatosGenerales.TiposMensaje.Informacion); } else { DatosGenerales.EnviaMensaje(Resp, "Alta de Relacion Aplicación-BD", DatosGenerales.TiposMensaje.Error); } } }
protected void btnAgregarDetalle_Click(object sender, EventArgs e) { LimpiaPanelDetalle(); txtNombreUsuarioD.Text = "Disponible"; hdnCve_Asignacion.Value = "0"; int cveSoftware = Convert.ToInt32(hdnCve_Software.Value); BLAsignacion_Software oblAsiganacionSoftware = new BLAsignacion_Software(); lblKeyDetalle.Enabled = false; txtKeyD.Enabled = false; rfvKeyD.Enabled = false; vceKeyD.Enabled = false; TableDetalle.Controls[3].Visible = false; TableDetalle.Controls[1].Visible = true; if (oblAsiganacionSoftware.ObtieneAsignacionSoftware(cveSoftware).Count == 0) { InventarioHSC.Model.Software sofware = new Model.Software(); BLSoftware bolSoftware = new BLSoftware(); sofware = bolSoftware.Software(cveSoftware); dplNUmeroLicencia.SelectedValue = sofware.NumeroLicencias.ToString(); hdnGenerrarControles.Value = "1"; GeneraControles(sofware.NumeroLicencias); } else { dplNUmeroLicencia.SelectedValue = "0"; } lblTituloPanelDetalle.Text = ".: Agregar Licencia :."; mpeDetalleAsignacion.Show(); }
protected void btnAgregarLicencia_Click(object sender, EventArgs e) { HttpContext.Current.Session["idSelectedSess"] = null; BLSoftware oblSoftware = new BLSoftware(); gdvSoftware.DataSource = oblSoftware.ObtenSoftwareDisponible(); gdvSoftware.DataBind(); mpeDetalleAgregarLic.Show(); }
private void CargarDatosSoftware() { BLSoftware oblSoftware = new BLSoftware(); InventarioHSC.Model.Software software = oblSoftware.Software(Convert.ToInt32(hdnCve_Software.Value)); txtNombreLicenciaU.Text = software.Descripcion; txtCantidadU.Text = software.NumeroLicencias.ToString(); txtVersionU.Text = software.Version; }
protected void gdvSoftware_PageIndexChanging(object sender, GridViewPageEventArgs e) { BLSoftware oblSoftware = new BLSoftware(); SelectionManager.KeepSelection((GridView)sender); gdvSoftware.DataSource = oblSoftware.ObtenSoftwareDisponible(); gdvSoftware.PageIndex = e.NewPageIndex; gdvSoftware.DataBind(); }
protected void btnAgregar_Click(object sender, EventArgs e) { BLSoftware objGrupoSoftware = new BLSoftware(); if (txtDescripcion.Text.Trim() != "") { MsgBox.AddMessage(objGrupoSoftware.InsertaGrupoSoftware(txtDescripcion.Text.Trim()), YaBu.MessageBox.uscMsgBox.enmMessageType.Info); } else { MsgBox.AddMessage("Debe introducir un texto válido en el campo descripción.", YaBu.MessageBox.uscMsgBox.enmMessageType.Attention); } }
protected void gvwSoftware_RowCommand(object sender, GridViewCommandEventArgs e) { if (!e.CommandName.Equals("Page")) { int index = Convert.ToInt32(e.CommandArgument); int cve_Software = Convert.ToInt32(gvwSoftware.DataKeys[index].Value); hdnCve_Software.Value = cve_Software.ToString(); if (e.CommandName.Equals("InfoGen")) { BLSoftware oblSoftware = new BLSoftware(); BLAsignacion_Software oblAsiganacionSoftware = new BLAsignacion_Software(); List <TotalesSoftware> totalesSoftware = oblSoftware.ObtieneTotalesSoftware(cve_Software); grvTotalTipo.DataSource = totalesSoftware; grvTotalTipo.DataBind(); gvwDetalle.DataSource = oblAsiganacionSoftware.ObtieneAsignacionSoftware(cve_Software); gvwDetalle.DataBind(); InventarioHSC.Model.Software software = oblSoftware.Software(Convert.ToInt32(hdnCve_Software.Value)); string xmlData = oblSoftware.xmlDataTotales(totalesSoftware, software.Descripcion); HabilitarBotonAgregarDetalle(true); StringBuilder Clientscript = new StringBuilder(); Clientscript.Append("<script>"); Clientscript.Append("updateChartTotalesSoftware(\"" + xmlData + "\");"); Clientscript.Append("</script>"); if (!ClientScript.IsStartupScriptRegistered("udpChart")) { ScriptManager.RegisterStartupScript(this.Page, this.Page.GetType(), "udpChart", Clientscript.ToString(), false); } } else if (e.CommandName.Equals("Editar")) { hdnCve_Software.Value = cve_Software.ToString(); lblInfo.Text = ".: Actualizar :."; CargarDatosSoftware(); txtCantidadU.Enabled = false; mpeDatosSoftware.Show(); } } }
protected void ProcesarGrid(int App_Id) { BLSoftware objGrupoSoftware = new BLSoftware(); bool Chk; int AppBD_Id = 0; foreach (GridViewRow row in grdDatos.Rows) { AppBD_Id = 0; Chk = ((CheckBox)row.FindControl("chkEsProp")).Checked; int.TryParse(row.Cells[CeldaId].Text, out AppBD_Id); objGrupoSoftware.InsertarAppRelBD(App_Id, AppBD_Id, Chk); objGrupoSoftware.HistoricoApp(this.Page.ToString().Substring(4, this.Page.ToString().Substring(4).Length - 5) + ".aspx", Session["UserNameLogin"].ToString(), "I", App_Id, AppBD_Id); } }
protected void btnGuardar_Click(object sender, EventArgs e) { try { if (!hdnCve_Software.Value.Equals("0")) { Model.Software sofware = new Model.Software(); sofware.Cve_Software = Convert.ToInt32(hdnCve_Software.Value); sofware.Descripcion = txtNombreLicenciaU.Text; sofware.Version = txtVersionU.Text; sofware.NumeroLicencias = Convert.ToInt32(txtCantidadU.Text); BLSoftware blSoftware = new BLSoftware(sofware); blSoftware.actualizaSoftware(); } else { InventarioHSC.Model.Software sofware = new Model.Software(); sofware.Cve_Software = 0; sofware.Descripcion = txtNombreLicenciaU.Text; sofware.Version = txtVersionU.Text; sofware.NumeroLicencias = Convert.ToInt32(txtCantidadU.Text); BLSoftware blSoftware = new BLSoftware(sofware); string respuesta = blSoftware.insertaSoftwareNuevo(); if (respuesta != "OK") { Warning.Visible = false; LabelWarning.Text = ""; LabelInfo.Text = respuesta; LabelInfo.Focus(); Info.Visible = true; btnBuscar_Click(sender, e); mpeDatosSoftware.Hide(); } } } catch (Exception ex) { Warning.Visible = true; LabelWarning.Text = "Ocurrio un Error en el Proceso: " + ex.Message; LabelWarning.Focus(); LabelInfo.Text = ""; Info.Visible = false; } }
protected void ddlInstancia_SelectedIndexChanged(object sender, EventArgs e) { BLSoftware sw = new BLSoftware(); int AppSB_Id = 0; int.TryParse(ddlInstancia.SelectedItem.Value, out AppSB_Id); txtNombre.Text = ""; if (AppSB_Id > 0) { DataTable Info = new DataTable(); pnlContent.Enabled = true; sw.InformacionGeneralInstancia(AppSB_Id, ref Info); if (Info.Rows.Count > 0) { if (Info.Columns.Contains("Srv_Id")) { ddlServidor.SelectedValue = Info.Rows[0]["Srv_Id"].ToString(); } if (Info.Columns.Contains("BD_Id")) { ddlBD.SelectedValue = Info.Rows[0]["BD_Id"].ToString(); } if (Info.Columns.Contains("AppSB_Nombre")) { txtNombre.Text = Info.Rows[0]["AppSB_Nombre"].ToString(); } } } else { pnlContent.Enabled = false; if (ddlServidor.Items.Count > 0) { ddlServidor.SelectedIndex = 0; } if (ddlBD.Items.Count > 0) { ddlBD.SelectedIndex = 0; } } }
protected void btnProcesar_Click(object sender, EventArgs e) { if (Page.IsValid) { BLSoftware objGrupoSoftware = new BLSoftware(); BLServidores objGrupoServidores = new BLServidores(); int AppBD_Id = 0; int AppSB_Id = 0; DateTime? AppBD_FechaBaja; int.TryParse(ddlBD.SelectedValue, out AppBD_Id); int.TryParse(ddlInstanciaBD.SelectedValue, out AppSB_Id); txtNombre.Text = txtNombre.Text.Trim(); txtCinta.Text = txtCinta.Text.Trim(); txtObservacionesCinta.Text = txtObservacionesCinta.Text.Trim(); AppBD_FechaBaja = DatosGenerales.ConvierteFecha(txtFechaBaja.Text); if (txtFechaBaja.Text != "" && AppBD_FechaBaja == null) { MsgBoxU.AddMessage("Formato de fecha incorrecto", YaBu.MessageBox.uscMsgBox.enmMessageType.Attention); return; } if (txtNombre.Text != "" && AppBD_Id > 0 && AppSB_Id > 0) { objGrupoSoftware.ActualizarBD(AppBD_Id, AppSB_Id, txtNombre.Text, chkActiva.Checked, chkProductiva.Checked, AppBD_FechaBaja); } else { MsgBoxU.AddMessage("Se debe seleccionar un servidor, una instancia y un nombre", YaBu.MessageBox.uscMsgBox.enmMessageType.Attention); } if (txtCinta.Text != "" && pnlCinta.Visible == true) { objGrupoServidores.RegistrarCinta(DatosGenerales.TiposRespaldoCintas.Base_Datos, AppBD_Id, txtCinta.Text, txtObservacionesCinta.Text, DateTime.Now); } objGrupoSoftware.HistoricoApp(this.Page.ToString().Substring(4, this.Page.ToString().Substring(4).Length - 5) + ".aspx", Session["UserNameLogin"].ToString(), "U", AppSB_Id); DatosGenerales.EnviaMensaje("Proceso finalizado", "Modificación de BD", DatosGenerales.TiposMensaje.Informacion); } }
protected void CargaDiscos(int Srv_Id) { BLSoftware sw = new BLSoftware(); DataTable InfoDiscos = new DataTable(); sw.InformacionCompletaDiscos(Srv_Id, ref InfoDiscos); pnlDiscos.Enabled = true; //Agregar campos a USel --> en eso me quedé if (InfoDiscos.Rows.Count > 0) { USel.Rows.Clear(); USel = InfoDiscos; grdDiscos.DataSource = InfoDiscos; grdDiscos.DataBind(); EsconderColumnas(); ddlUnidad.DataSource = MinusDT(LetrasUnidad(), "SrvD_Unidad", USel, "SrvD_Unidad"); ddlUnidad.DataBind(); } }
protected void btnProcesar_Click(object sender, EventArgs e) { if (Page.IsValid) { BLSoftware objGrupoSoftware = new BLSoftware(); string Resp = ""; int AppSt_Id = 0; int AppT_Id = 0; int Srv_Id = 0; int AppBD_Id = 0; int.TryParse(ddlEstado.SelectedValue, out AppSt_Id); int.TryParse(ddlTipo.SelectedValue, out AppT_Id); int.TryParse(ddlServidorP.SelectedValue, out Srv_Id); int.TryParse(ddlBD.SelectedValue, out AppBD_Id); if (AppSt_Id > 0 && AppT_Id > 0 && AppBD_Id > 0) { Resp = objGrupoSoftware.InsertarAplicacion(AppSt_Id, AppT_Id, txtNombre.Text.Trim(), txtDescripcion.Text.Trim(), chkEnTFS.Checked, chkProductiva.Checked, txtObservaciones.Text.Trim(), txtUbicacion.Text.Trim(), Srv_Id, true, AppBD_Id, true); } else { MsgBoxU.AddMessage("Faltan campos por seleccionar", YaBu.MessageBox.uscMsgBox.enmMessageType.Attention); } int IdMod = 0; int.TryParse(Resp, out IdMod); objGrupoSoftware.HistoricoApp(this.Page.ToString().Substring(4, this.Page.ToString().Substring(4).Length - 5) + ".aspx", Session["UserNameLogin"].ToString(), "I", IdMod); if (IdMod > 0) { DatosGenerales.EnviaMensaje("Proceso finalizado", "Alta de aplicación", DatosGenerales.TiposMensaje.Informacion); } else { DatosGenerales.EnviaMensaje(Resp, "Alta de aplicación", DatosGenerales.TiposMensaje.Error); } } }
protected void gvwSoftware_PageIndexChanging(object sender, GridViewPageEventArgs e) { if (txtCantidad.Text.Trim().Equals("") && txtVersion.Text.Trim().Equals("") && DescripcionSoftware.Text.Trim().Equals("")) { BLSoftware oblSoftware = new BLSoftware(); gvwSoftware.DataSource = oblSoftware.ObtieneSoftware(); gvwSoftware.PageIndex = e.NewPageIndex; gvwSoftware.DataBind(); } else { int? valueIntNull = null; int? pCantidad = txtCantidad.Text.Trim().Equals("") ? valueIntNull : Convert.ToInt32(txtCantidad.Text); string pNombreLicencia = DescripcionSoftware.Text.Trim().Equals("") ? null : DescripcionSoftware.Text; string pVersion = txtVersion.Text.Trim().Equals("") ? null : txtVersion.Text; BLSoftware oblSoftware = new BLSoftware(); gvwSoftware.DataSource = oblSoftware.OntieneFiltroSoftware(pNombreLicencia, pVersion, pCantidad); gvwSoftware.PageIndex = e.NewPageIndex; gvwSoftware.DataBind(); } }
private void ExtraerDetalle() { if (txtCantidad.Text.Trim().Equals("") && txtVersion.Text.Trim().Equals("") && DescripcionSoftware.Text.Trim().Equals("")) { BLSoftware oblSoftware = new BLSoftware(); gvwSoftware.AllowPaging = false; gvwSoftware.DataSource = oblSoftware.ObtieneSoftware(); gvwSoftware.DataBind(); } else { int? valueIntNull = null; int? pCantidad = txtCantidad.Text.Trim().Equals("") ? valueIntNull : Convert.ToInt32(txtCantidad.Text); string pNombreLicencia = DescripcionSoftware.Text.Trim().Equals("") ? null : DescripcionSoftware.Text; string pVersion = txtVersion.Text.Trim().Equals("") ? null : txtVersion.Text; BLSoftware oblSoftware = new BLSoftware(); gvwSoftware.AllowPaging = false; gvwSoftware.DataSource = oblSoftware.OntieneFiltroSoftware(pNombreLicencia, pVersion, pCantidad); gvwSoftware.DataBind(); } }
protected void Page_SaveStateComplete(object sender, EventArgs e) { if (!Page.IsPostBack) { BLSoftware oblSoftware = new BLSoftware(); List <TotalesSoftware> totalesSoftware = oblSoftware.ObtieneTotalesSoftware(0); string xmlData = oblSoftware.xmlDataTotales(totalesSoftware); StringBuilder Clientscript = new StringBuilder(); Clientscript.Append("<script>"); Clientscript.Append("updateChartTotalesSoftware(\"" + xmlData + "\");"); Clientscript.Append("</script>"); if (!ClientScript.IsStartupScriptRegistered("udpChart")) { ScriptManager.RegisterStartupScript(this.Page, this.Page.GetType(), "udpChart", Clientscript.ToString(), false); } } }
protected void btnProcesar_Click(object sender, EventArgs e) { if (Page.IsValid) { BLSoftware objGrupoSoftware = new BLSoftware(); string Resp = ""; int Srv_Id = 0; int BD_Id = 0; int.TryParse(ddlServidor.SelectedValue, out Srv_Id); int.TryParse(ddlInstanciaBD.SelectedValue, out BD_Id); if (Srv_Id > 0 && BD_Id > 0) { Resp = objGrupoSoftware.InsertarBDServidor(BD_Id, txtNombre.Text.Trim(), chkActiva.Checked, chkProductiva.Checked); } else { MsgBoxU.AddMessage("Se debe seleccionar un servidor y una instancia de base de datos", YaBu.MessageBox.uscMsgBox.enmMessageType.Attention); } int IdMod = 0; int.TryParse(Resp, out IdMod); objGrupoSoftware.HistoricoApp(this.Page.ToString().Substring(4, this.Page.ToString().Substring(4).Length - 5) + ".aspx", Session["UserNameLogin"].ToString(), "I", IdMod); if (IdMod > 0) { DatosGenerales.EnviaMensaje("Proceso finalizado", "Alta de BD", DatosGenerales.TiposMensaje.Informacion); } else { DatosGenerales.EnviaMensaje(Resp, "Alta de BD", DatosGenerales.TiposMensaje.Error); } } }
protected void ddlServidor_SelectedIndexChanged(object sender, EventArgs e) { BLSoftware sw = new BLSoftware(); int Srv_Id = 0; int.TryParse(ddlServidor.SelectedItem.Value, out Srv_Id); txtLlave.Text = ""; if (Srv_Id > 0) { DataTable InfoServidor = new DataTable(); DataTable InfoDiscos = new DataTable(); pnlContent.Enabled = true; sw.InformacionGeneralServidor(Srv_Id, ref InfoServidor, ref InfoDiscos); lnkDiscos.NavigateUrl = "ModificarDiscos.aspx?Srv=" + Srv_Id.ToString(); if (InfoServidor.Rows.Count > 0) { if (InfoServidor.Columns.Contains("idItem")) { ddlEquipo.SelectedValue = InfoServidor.Rows[0]["idItem"].ToString(); } if (InfoServidor.Columns.Contains("idSistema")) { ddlSO.SelectedValue = InfoServidor.Rows[0]["idSistema"].ToString(); } if (InfoServidor.Columns.Contains("Srv_EsVirtual")) { ddlEsVirtual.SelectedValue = InfoServidor.Rows[0]["Srv_EsVirtual"].ToString(); } if (InfoServidor.Columns.Contains("Srv_Tipo")) { ddlTipo.SelectedValue = InfoServidor.Rows[0]["Srv_Tipo"].ToString(); } if (InfoServidor.Columns.Contains("Srv_Estado")) { ddlEstado.SelectedValue = InfoServidor.Rows[0]["Srv_Estado"].ToString(); } if (InfoServidor.Columns.Contains("Srv_Observaciones")) { txtObservaciones.Text = InfoServidor.Rows[0]["Srv_Observaciones"].ToString(); } if (InfoServidor.Columns.Contains("Srv_Nombre")) { txtNombreEquipo.Text = InfoServidor.Rows[0]["Srv_Nombre"].ToString(); } if (InfoServidor.Columns.Contains("Srv_IP")) { txtIP.Text = InfoServidor.Rows[0]["Srv_IP"].ToString(); } if (InfoServidor.Columns.Contains("Srv_RAM")) { txtRAM.Text = InfoServidor.Rows[0]["Srv_RAM"].ToString(); } if (InfoServidor.Columns.Contains("Srv_RAM")) { txtRAM.Text = InfoServidor.Rows[0]["Srv_RAM"].ToString(); } USel.Rows.Clear(); USel = InfoDiscos; grdDiscos.DataSource = InfoDiscos; grdDiscos.DataBind(); ddlUnidad.DataSource = MinusDT(LetrasUnidad(), "Unidad", USel, "Unidad"); ddlUnidad.DataBind(); } } else { pnlContent.Enabled = false; if (ddlEquipo.Items.Count > 0) { ddlEquipo.SelectedIndex = 0; } if (ddlSO.Items.Count > 0) { ddlSO.SelectedIndex = 0; } if (ddlEsVirtual.Items.Count > 0) { ddlEsVirtual.SelectedIndex = 0; } if (ddlTipo.Items.Count > 0) { ddlTipo.SelectedIndex = 0; } if (ddlEstado.Items.Count > 0) { ddlEstado.SelectedIndex = 0; } txtNombreEquipo.Text = ""; txtIP.Text = ""; txtRAM.Text = ""; ddlUnidad.Items.Clear(); UnidadesHDD(ref ddlUnidad); txtCapacidad.Text = ""; grdDiscos.DataSource = null; grdDiscos.DataBind(); } }
protected void ddlApp_SelectedIndexChanged(object sender, EventArgs e) { BLSoftware sw = new BLSoftware(); int App_Id = 0; int.TryParse(ddlApp.SelectedItem.Value, out App_Id); txtDescripcion.Text = ""; txtNombre.Text = ""; txtObservaciones.Text = ""; txtUbicacion.Text = ""; chkEnTFS.Checked = false; chkProductiva.Checked = false; if (App_Id > 0) { DataTable Info = new DataTable(); pnlContent.Enabled = true; sw.InformacionGeneralApp(App_Id, ref Info); if (Info.Rows.Count > 0) { if (Info.Columns.Contains("AppSt_Id")) { ddlEstado.SelectedValue = Info.Rows[0]["AppSt_Id"].ToString(); } if (Info.Columns.Contains("AppT_Id")) { ddlTipo.SelectedValue = Info.Rows[0]["AppT_Id"].ToString(); } if (Info.Columns.Contains("App_Descripcion")) { txtDescripcion.Text = Info.Rows[0]["App_Descripcion"].ToString(); } if (Info.Columns.Contains("App_Nombre")) { txtNombre.Text = Info.Rows[0]["App_Nombre"].ToString(); } if (Info.Columns.Contains("App_Observaciones")) { txtObservaciones.Text = Info.Rows[0]["App_Observaciones"].ToString(); } if (Info.Columns.Contains("App_Ubicacion")) { txtUbicacion.Text = Info.Rows[0]["App_Ubicacion"].ToString(); } if (Info.Columns.Contains("App_EnTFS")) { if (Info.Rows[0]["App_EnTFS"].ToString() == "S") { chkEnTFS.Checked = true; } else { chkEnTFS.Checked = false; } } if (Info.Columns.Contains("App_Productiva")) { if (Info.Rows[0]["App_Productiva"].ToString() == "S") { chkProductiva.Checked = true; } else { chkProductiva.Checked = false; } } } } else { pnlContent.Enabled = false; if (ddlEstado.Items.Count > 0) { ddlEstado.SelectedIndex = 0; } if (ddlTipo.Items.Count > 0) { ddlTipo.SelectedIndex = 0; } } }
protected void btnProcesar_Click(object sender, EventArgs e) { BLSoftware objGrupoSoftware = new BLSoftware(); Model.Servidores server = new Model.Servidores(); string Resp = ""; int RAM = 0; int Srv_Id = 0; int.TryParse(ddlServidor.SelectedItem.Value, out Srv_Id); server.id = Srv_Id; if (ddlEstado.SelectedValue == "A") { server.Estado = true; } else { server.Estado = false; } if (ddlEsVirtual.SelectedValue == "S") { server.EsVirtual = true; } else { server.EsVirtual = false; } server.idItem = Convert.ToInt32(ddlEquipo.SelectedValue); server.idSistema = Convert.ToInt32(ddlSO.SelectedValue); server.IP = txtIP.Text; server.Llave = txtLlave.Text; server.Nombre = txtNombreEquipo.Text; int.TryParse(txtRAM.Text, out RAM); server.RAM = RAM; server.Tipo = ddlTipo.SelectedValue; server.TotalHDD = 0; Resp = objGrupoSoftware.ActualizarServidorApp(server, USel, txtObservaciones.Text.Trim()); objGrupoSoftware.HistoricoApp(this.Page.ToString().Substring(4, this.Page.ToString().Substring(4).Length - 5) + ".aspx", Session["UserNameLogin"].ToString(), "U", server.id); SiNoNull(ref ddlEsVirtual); Estado(ref ddlEstado); DatosGenerales.TipoEquipo(ref ddlTipo); UnidadesHDD(ref ddlUnidad); CargaCatalogos(); txtNombreEquipo.Text = ""; txtCapacidad.Text = ""; txtIP.Text = ""; txtLlave.Text = ""; txtRAM.Text = ""; grdDiscos.DataSource = null; grdDiscos.DataBind(); if (server.id > 0) { DatosGenerales.EnviaMensaje("Proceso finalizado", "Modificación de servidor", DatosGenerales.TiposMensaje.Informacion); } else { DatosGenerales.EnviaMensaje(Resp, "Modificación de servidor", DatosGenerales.TiposMensaje.Error); } }
protected void ddlBD_SelectedIndexChanged(object sender, EventArgs e) { BLSoftware sw = new BLSoftware(); int AppBD_Id = 0; int.TryParse(ddlBD.SelectedItem.Value, out AppBD_Id); txtNombre.Text = ""; chkActiva.Checked = false; chkProductiva.Checked = false; pnlURespaldo.Visible = false; if (AppBD_Id > 0) { DataTable Info = new DataTable(); pnlContent.Enabled = true; sw.InformacionGeneralBD(AppBD_Id, ref Info); if (Info.Rows.Count > 0) { if (Info.Columns.Contains("Srv_Id")) { ddlServidor.SelectedValue = Info.Rows[0]["Srv_Id"].ToString(); } CargaInstancias(); if (Info.Columns.Contains("AppSB_Id")) { ddlInstanciaBD.SelectedValue = Info.Rows[0]["AppSB_Id"].ToString(); } if (Info.Columns.Contains("AppBD_Nombre")) { txtNombre.Text = Info.Rows[0]["AppBD_Nombre"].ToString(); } if (Info.Columns.Contains("AppBD_Activa")) { if (Info.Rows[0]["AppBD_Activa"].ToString() == "S") { chkActiva.Checked = true; } else { chkActiva.Checked = false; } } if (Info.Columns.Contains("AppBD_Productiva")) { if (Info.Rows[0]["AppBD_Productiva"].ToString() == "S") { chkProductiva.Checked = true; } else { chkProductiva.Checked = false; } } if (Info.Columns.Contains("AppBD_FechaBaja")) { if (!chkActiva.Checked) { pnlBaja.Visible = true; } else { pnlBaja.Visible = false; } if (Info.Rows[0]["AppBD_FechaBaja"].ToString() != "01/01/1900") { txtFechaBaja.Text = Info.Rows[0]["AppBD_FechaBaja"].ToString(); } } pnlBaja.Visible = !chkActiva.Checked; grdCintas.DataSource = sw.ObtenerUltimaCinta((int)DatosGenerales.TiposRespaldoCintas.Base_Datos, AppBD_Id); grdCintas.DataBind(); pnlURespaldo.Visible = true; } } else { pnlContent.Enabled = false; if (ddlServidor.Items.Count > 0) { ddlServidor.SelectedIndex = 0; } if (ddlInstanciaBD.Items.Count > 0) { ddlInstanciaBD.SelectedIndex = 0; } } }