protected void Page_Init(object sender, EventArgs e) { if (!Page.IsPostBack) { vIdSolicitud = null; int vIdSolicitudQS = -1; if (int.TryParse(Request.QueryString["SolicitudId"], out vIdSolicitudQS)) { vIdSolicitud = vIdSolicitudQS; } if (Request.QueryString["FG_HABILITADO"] != null) { if (Request.QueryString["FG_HABILITADO"] == "False") { btnGuardar.Enabled = false; btnGuardarSalir.Enabled = false; } } if (ContextoUsuario.oUsuario != null) { SeguridadProcesos(); } if (Request.QueryString["PlantillaId"] != null) { vIdPlantillaFormulario = (int.Parse(Request.QueryString["PlantillaId"])); } } if (vDatosModificar == null) { vDatosModificar = new List <KeyValuePair <string, string> >(); } if (vControlDependienteSeleccion == null) { vControlDependienteSeleccion = new List <E_GENERICA>(); } SolicitudNegocio nSolicitud = new SolicitudNegocio(); SPE_OBTIENE_SOLICITUD_PLANTILLA_Result vSolicitud = new SPE_OBTIENE_SOLICITUD_PLANTILLA_Result(); if (vIdPlantillaFormulario != null) { vSolicitud = nSolicitud.ObtenerSolicitudPlantilla(vIdPlantillaFormulario, null, null); } else { vSolicitud = nSolicitud.ObtenerSolicitudPlantilla(null, vIdSolicitud, null); } vXmlSolicitud = vSolicitud.XML_SOLICITUD_PLANTILLA; vPlantilla = new Plantilla() { ctrlPlantilla = new Contenedor() { NbContenedor = "PlantillaSolicitud", CtrlContenedor = mpgSolicitud }, lstContenedores = ObtenerContenedores(), xmlPlantilla = vXmlSolicitud }; vXmlDocumentos = vSolicitud.XML_VALORES; vIdItemFoto = vSolicitud.ID_ITEM_FOTOGRAFIA; if (vSolicitud.FI_FOTOGRAFIA != null) { rbiFotoEmpleado.DataValue = vSolicitud.FI_FOTOGRAFIA; btnEliminarFotoEmpleado.Visible = true; } else { btnEliminarFotoEmpleado.Visible = false; } vPlantilla.CrearFormulario(!Page.IsPostBack); }
protected void Page_Init(object sender, EventArgs e) { vTipoConsulta = Request.QueryString["Tipo"]; vBotonesVisibles = (Request.Params["pBotonesVisbles"]); vsTipoConsulta = vTipoConsulta; if (!Page.IsPostBack) { if (Request.Params["pIdEmpleado"] != null) { vIdEmpleado = Request.Params["pIdEmpleado"]; vsIdCambio = int.Parse(Request.Params["IdCambio"]); vsDsCambio = Request.Params["DsCambio"]; } else { vIdEmpleado = (ContextoUsuario.oUsuario.ID_EMPLEADO_PDE.ToString() != "0") ? ContextoUsuario.oUsuario.ID_EMPLEADO_PDE : "-1"; vsIdCambio = 0; vCambio = "false"; } if (vsTipoConsulta == "e") { btnGuardar.Visible = true; } } //Cuando el parametro "vTipoConsulta" sea vacio o =v todos los campos van con el FG_EDITABLE = 0 //quitar el boton guardar if (vsTipoConsulta != "e") { btnGuardar.Visible = false; btnEliminarFotoEmpleado.Visible = false; btnActualizarFotoEmpleado.Visible = false; btnEliminarFotoEmpleado.Visible = false; rauFotoEmpleado.Visible = false; btnAgregarDocumento.Visible = false; btnEliminarFotoEmpleado.Visible = false; } if (vBotonesVisibles == "true") { btnAutorizar.Visible = true; btnRechazar.Visible = true; btnEliminarFotoEmpleado.Visible = false; lblRechazo.Visible = false; } else { btnAutorizar.Visible = false; btnRechazar.Visible = false; btnEliminarFotoEmpleado.Visible = true; lblRechazo.Visible = true; if (vsDsCambio == "Autorizada") { btnGuardar.Visible = false; } } EmpleadoNegocio nEmpleado = new EmpleadoNegocio(); { SPE_OBTIENE_EMPLEADO_PLANTILLA_CAMBIO_PDE_Result vSolicitud = nEmpleado.ObtenerPlantillaCambioPDE(null, vIdEmpleado, "INVENTARIO_PDE"); vXmlPlantilla = vSolicitud.XML_SOLICITUD_PLANTILLA; vXmlDocumentos = vSolicitud.XML_VALORES; vIdItemFoto = vSolicitud.ID_ITEM_FOTOGRAFIA; if (vSolicitud.FI_FOTOGRAFIA != null) { rbiFotoEmpleado.DataValue = vSolicitud.FI_FOTOGRAFIA; btnEliminarFotoEmpleado.Visible = true; } vXmlPlantilla = vSolicitud.XML_SOLICITUD_PLANTILLA; vXmlDocumentos = vSolicitud.XML_VALORES; vIdItemFoto = vSolicitud.ID_ITEM_FOTOGRAFIA; if (vSolicitud.FI_FOTOGRAFIA != null) { rbiFotoEmpleado.DataValue = vSolicitud.FI_FOTOGRAFIA; btnEliminarFotoEmpleado.Visible = true; } else { btnEliminarFotoEmpleado.Visible = false; } vPlantilla = new Plantilla() { ctrlPlantilla = new Contenedor() { NbContenedor = "PlantillaEmpleado", CtrlContenedor = mpgPlantilla }, lstContenedores = ObtenerContenedores(), xmlPlantilla = vXmlPlantilla }; vPlantilla.CrearFormulario(!Page.IsPostBack); } }