protected void Detalle() { try { CNCorreccion ObjCN = new CNCorreccion(); DataTable temp = new DataTable(); CECorreccion Obj = new CECorreccion(); Obj.Codigo = Convert.ToInt32(lblCodigoCorrelativoDetalle.Text); temp = ObjCN.ListarDetalleCorrelativoCorreccion(Obj, ConfigurationManager.ConnectionStrings["SIEMPRESOFT"].ConnectionString.ToString()); if (lblUsuarioDetalle.Text == User.Identity.Name.ToString()) { pnPanelInsercionDetalle.Visible = true; pnListadoDetalle.Height = 400; } else { pnPanelInsercionDetalle.Visible = false; pnListadoDetalle.Height = 570; } gvDetalle.DataSource = temp; gvDetalle.DataBind(); } catch (Exception ex) { ucMsje.RegistrarMensajeCliente("dvMsjeError", Funciones.m_strImagenError, ex.Message + "<br />" + ex.StackTrace); } finally { } }
protected void btnGuardarTabla_Click(object sender, EventArgs e) { try { int codigo; CNCorreccion ObjCN = new CNCorreccion(); CECorreccion ObjCE = new CECorreccion(); ObjCE.CodigoAsignado = Convert.ToInt32(ddlUsuario.SelectedValue); ObjCE.Fecha = Convert.ToDateTime(txtfecha.Text); ObjCE.Descripcion = txtDescripcion.Text; ObjCE.Version = txtVersion.Text; ObjCE.Codigo = Convert.ToInt32(lblCodigoCorrelativo.Text); ObjCE.Mejora = ddlMejora.SelectedValue; if (lblCodigoCorrelativo.Text == "0") { codigo = ObjCN.InsertarCorrelativoCorreccion(ObjCE, ConfigurationManager.ConnectionStrings["SIEMPRESOFT"].ConnectionString.ToString()); ScriptManager.RegisterStartupScript(this, this.GetType(), "Msje", "alert('Se ha realizado la peticion de un nuevo correlativo de correccion satisfactoriamente.\\n\\n Numero de Correlativo asignado:" + codigo + "');", true); //txtNumero.Text = codigo.ToString(); //mpeNuevo.Show(); } else { ObjCE.Numero = Convert.ToInt32(txtNumero.Text.Trim()); codigo = ObjCN.ActualizarCorrelativoCorreccion(ObjCE, ConfigurationManager.ConnectionStrings["SIEMPRESOFT"].ConnectionString.ToString()); ScriptManager.RegisterStartupScript(this, this.GetType(), "Msje", "alert('Se ha realizado la actualizacion del correlativo de correccion satisfactoriamente.');", true); } buscarcorrecciones(); } catch (Exception ex) { ucMsje.RegistrarMensajeCliente("dvMsjeError", Funciones.m_strImagenError, ex.Message + "<br />" + ex.StackTrace); } finally { } }
protected void btnAceptarEliminar_Click(object sender, EventArgs e) { try { int codigo; CNCorreccion ObjCN = new CNCorreccion(); CECorreccion ObjCE = new CECorreccion(); ObjCE.Codigo = Convert.ToInt32(lblCodigoCorrelativoEliminar.Text); ObjCE.Vigencia = false; codigo = ObjCN.EliminarCorrelativoCorreccion(ObjCE, ConfigurationManager.ConnectionStrings["SIEMPRESOFT"].ConnectionString.ToString()); ScriptManager.RegisterStartupScript(this, this.GetType(), "Msje", "alert('Se ha desestimado el correlativo satisfactoriamente.');", true); buscarcorrecciones(); } catch (Exception ex) { ucMsje.RegistrarMensajeCliente("dvMsjeError", Funciones.m_strImagenError, ex.Message + "<br />" + ex.StackTrace); } finally { } }