public static PLANTILLACVT Detalle(int t819_idplantillacvt, int t001_idficepi) { PLANTILLACVT pl = new PLANTILLACVT(); SqlDataReader dr = SUPER.DAL.PLANTILLACVT.Detalle(t819_idplantillacvt, t001_idficepi); if (dr.Read()) { if (dr["T819_IDPLANTILLACVT"] != DBNull.Value) { pl.t819_idplantillacvt = int.Parse(dr["T819_IDPLANTILLACVT"].ToString()); } if (dr["T812_FINICIO"] != DBNull.Value) { pl.t812_finicio = dr["T812_FINICIO"].ToString(); } if (dr["T812_FFIN"] != DBNull.Value) { pl.t812_ffin = dr["T812_FFIN"].ToString(); } if (dr["T819_FUNCION"] != DBNull.Value) { pl.t819_funcion = (string)dr["T819_FUNCION"]; } if (dr["T819_OBSERVA"] != DBNull.Value) { pl.t819_observa = (string)dr["T819_OBSERVA"]; } if (dr["T035_IDCODPERFIL"] != DBNull.Value) { pl.t035_idcodperfil = int.Parse(dr["T035_IDCODPERFIL"].ToString()); } if (dr["T812_IDEXPPROFFICEPI"] != DBNull.Value) { pl.t812_idexpprofficepi = int.Parse(dr["T812_IDEXPPROFFICEPI"].ToString()); } if (dr["t020_idcodidioma"] != DBNull.Value) { pl.t020_idcodidioma = short.Parse(dr["t020_idcodidioma"].ToString()); } } else { throw (new NullReferenceException("No se ha obtenido ningun dato de PLANTILLACVT")); } return(pl); }
protected void Page_Load(object sender, EventArgs e) { try { if (!Page.IsCallback) { try { if (Session["IDRED"] == null) { try { Response.Redirect("~/SesionCaducadaModal.aspx", true); } catch (System.Threading.ThreadAbortException) { return; } } int idPlant = -1; if (Request.QueryString["ep"] != null) { this.hdnEP.Value = Utilidades.decodpar(Request.QueryString["ep"].ToString()); } if (Request.QueryString["id"] != null && Utilidades.decodpar(Request.QueryString["id"].ToString()) != "-1") { idPlant = int.Parse(Utilidades.decodpar(Request.QueryString["id"].ToString())); } ObtenerPerfiles(); GetIdiomas(); if (idPlant != -1) { PLANTILLACVT oPlant = new SUPER.BLL.PLANTILLACVT(idPlant); txtDescripcion.Text = oPlant.t819_denominacion; txtFun.Text = oPlant.t819_funcion; txtObs.Text = oPlant.t819_observa; hdnId.Value = oPlant.t819_idplantillacvt.ToString(); if (oPlant.t035_idcodperfil.ToString() != "") { cboPerfil.SelectedValue = oPlant.t035_idcodperfil.ToString(); } if (oPlant.t020_idcodidioma.ToString() != "") { cboIdioma.SelectedValue = oPlant.t020_idcodidioma.ToString(); } } strHTMLEntorno = SUPER.BLL.PLANTILLACVTET.Catalogo(false, idPlant); } catch (Exception ex) { sErrores += Errores.mostrarError("Error al cargar los datos ", ex); } //1º Se indican (por este orden) la función a la que se va a devolver el resultado // y la función que va a acceder al servidor string cbRespuesta = Page.ClientScript.GetCallbackEventReference(this, "arg", "RespuestaCallBack", "context", false); string cbLlamada = "function RealizarCallBack(arg, context)" + "{" + cbRespuesta + ";" + "}"; //2º Se "registra" la función que va a acceder al servidor. Page.ClientScript.RegisterClientScriptBlock(this.GetType(), "RealizarCallBack", cbLlamada, true); } } catch (Exception ex) { sErrores += Errores.mostrarError("Error al cargar la página ", ex); } }