protected void obtenerMotivos() { cboMotivo.DataSource = MOTIVO.ObtenerMotivos(); cboMotivo.DataValueField = "sValor"; cboMotivo.DataTextField = "sDenominacion"; cboMotivo.DataBind(); cboMotivo.SelectedValue = "1"; }
protected string ObtenerDatosBeneficiario(int nUsuario) { StringBuilder sb = new StringBuilder(); USUARIO oUsuario = USUARIO.Obtener(nUsuario); sb.Append(oUsuario.Nombre + "{sep}"); sb.Append(oUsuario.t314_idusuario.ToString() + "{sep}"); sb.Append(oUsuario.t313_denominacion + "{sep}"); //sb.Append(oUsuario.oOficinaLiquidadora.t010_desoficina + "{sep}"); sb.Append(oUsuario.t422_idmoneda.ToString() + "{sep}"); sb.Append(oUsuario.nCCIberper.ToString() + "{sepdatos}"); //sb.Append(oUsuario.oDietaKm.t069_ick.ToString("N") + "{sep}"); //sb.Append(oUsuario.oDietaKm.t069_icdc.ToString("N") + "{sep}"); //sb.Append(oUsuario.oDietaKm.t069_icmd.ToString("N") + "{sep}"); //sb.Append(oUsuario.oDietaKm.t069_icde.ToString("N") + "{sep}"); //sb.Append(oUsuario.oDietaKm.t069_icda.ToString("N") + "{sep}"); //sb.Append(oUsuario.oTerritorio.T007_ITERK.ToString("N") + "{sep}"); //sb.Append(oUsuario.oTerritorio.T007_ITERDC.ToString("N") + "{sep}"); //sb.Append(oUsuario.oTerritorio.T007_ITERMD.ToString("N") + "{sep}"); //sb.Append(oUsuario.oTerritorio.T007_ITERDE.ToString("N") + "{sep}"); //sb.Append(oUsuario.oTerritorio.T007_ITERDA.ToString("N") + "{sep}"); //sb.Append((oUsuario.t010_idoficina_base.HasValue) ? oUsuario.t010_idoficina_base.ToString() + "{sep}" : "" + "{sep}"); //sb.Append(oUsuario.oOficinaLiquidadora.t010_idoficina.ToString() + "{sep}"); //sb.Append((oUsuario.bAutorresponsable) ? "1" + "{sepdatos}" : "0" + "{sepdatos}"); List <ElementoLista> aMotivos = MOTIVO.ObtenerMotivos(nUsuario, ""); for (int i = 0; i < aMotivos.Count; i++) { sb.Append(aMotivos[i].sValor + "//" + aMotivos[i].sDenominacion + "//" + aMotivos[i].sDatoAux1 + "//" + aMotivos[i].sDatoAux2 + "//" + aMotivos[i].sDatoAux3 + "//" + aMotivos[i].sDatoAux4 + "{sep}"); } sb.Append("{sepdatos}"); //if (Profesional.bPerteneceVariasEmpresas(nUsuario)) //{ ArrayList aEmpresas = Profesional.ObtenerEmpresasTerritorios(nUsuario); for (int i = 0; i < aEmpresas.Count; i++) { sb.Append(((string[])aEmpresas[i])[0] + "//" //t313_idempresa + ((string[])aEmpresas[i])[1] + "//" //t313_denominacion + ((string[])aEmpresas[i])[2] + "//" //t007_idterrfis + ((string[])aEmpresas[i])[3] + "//" //t007_nomterrfis + ((string[])aEmpresas[i])[4] + "//" //T007_ITERDC + ((string[])aEmpresas[i])[5] + "//" //T007_ITERMD + ((string[])aEmpresas[i])[6] + "//" //T007_ITERDA + ((string[])aEmpresas[i])[7] + "//" //T007_ITERDE + ((string[])aEmpresas[i])[8] + "{sep}"); //T007_ITERK } //} return(sb.ToString()); }
public void RaiseCallbackEvent(string eventArg) { string sResultado = ""; //1º Si hubiera argumentos, se recogen y tratan. //string MisArg = eventArg; string[] aArgs = Regex.Split(eventArg, "@#@"); sResultado = aArgs[0] + @"@#@"; if (Session["GVT_IDRED"] == null) { _callbackResultado = aArgs[0] + @"@#@Error@#@SESIONCADUCADA"; return; } ; //2º Aquí realizaríamos el acceso a BD, etc,... switch (aArgs[0]) { case ("grabar"): try { MOTIVO.Grabar(aArgs[1], aArgs[2]); sResultado += "OK@#@"; } catch (Exception ex) { sResultado += "Error@#@" + Errores.mostrarError("Error al grabar las modificaciones.", ex); } break; case ("buscar"): try { sResultado += "OK@#@" + MOTIVO.obtenerPersonas(aArgs[1], aArgs[2], aArgs[3], aArgs[4]); } catch (Exception ex) { sResultado += "Error@#@" + Errores.mostrarError("Error al obtener las personas.", ex); } break; case ("aprobadores"): try { sResultado += "OK@#@" + MOTIVO.CatalogoAprobadores(aArgs[1]); } catch (Exception ex) { sResultado += "Error@#@" + Errores.mostrarError("Error al obtener los aprobadores.", ex); } break; } //3º Damos contenido a la variable que se envía de vuelta al cliente. _callbackResultado = sResultado; }
protected string ObtenerMotivosNodoBeneficiario(int nBeneficiario, string sEstado, int t303_idnodo) { StringBuilder sb = new StringBuilder(); List <ElementoLista> aMotivos = MOTIVO.ObtenerMotivosNodoBeneficiario(nBeneficiario, sEstado, t303_idnodo); for (int i = 0; i < aMotivos.Count; i++) { sb.Append(aMotivos[i].sValor + "//" + aMotivos[i].sDenominacion + "//" + aMotivos[i].sDatoAux1 + "//" + aMotivos[i].sDatoAux2 + "//" + aMotivos[i].sDatoAux3 + "//" + aMotivos[i].sDatoAux4 + "{sep}"); } return(sb.ToString()); }
public void obtenerMotivos() { List <ElementoLista> oLista = MOTIVO.ObtenerMotivosActivos(); ListItem oLI = null; oLI = new ListItem("", ""); cboMotivo.Items.Add(oLI); foreach (ElementoLista oMotivo in oLista) { oLI = new ListItem(oMotivo.sDenominacion, oMotivo.sValor); cboMotivo.Items.Add(oLI); } }
public bool read() { try { MOTIVO tipoPermiso = Conexion.entities.MOTIVO.First(f => f.IDMOTIVO == this.idMotivo); this.idMotivo = Convert.ToInt32(tipoPermiso.IDTIPOPERMISO); this.nombreMotivo = tipoPermiso.NOMBREMOTIVO; return(true); } catch (Exception e) { return(false); } }
protected void obtenerMotivos(int nBeneficiario, string sEstado) { List <ElementoLista> oLista = MOTIVO.ObtenerMotivos(nBeneficiario, sEstado); ListItem oLI = null; foreach (ElementoLista oMotivo in oLista) { oLI = new ListItem(oMotivo.sDenominacion, oMotivo.sValor); oLI.Attributes.Add("idcencos", oMotivo.sDatoAux1); oLI.Attributes.Add("des_cencos", oMotivo.sDatoAux2); oLI.Attributes.Add("idnodo", oMotivo.sDatoAux3); oLI.Attributes.Add("des_nodo", oMotivo.sDatoAux4); cboMotivo.Items.Add(oLI); } cboMotivo.SelectedValue = "1"; }
protected void Page_Load(object sender, EventArgs e) { try { //Para que se muestre la botonera, únicamente hay que indicar el número de botonera //y crear el manejador de eventos para la misma. Master.nBotonera = 19; Master.Botonera.ItemClick += new ToolBarEventHandler(this.Botonera_Click); Master.bFuncionesLocales = true; Master.TituloPagina = "Mantenimiento de motivos"; Master.FuncionesJavaScript.Add("Javascript/draganddrop.js"); Master.FicherosCSS.Add("Capa_Presentacion/Mantenimiento/css/Mantenimiento.css"); if (!Page.IsCallback) { if (!Page.IsPostBack) { try { strTablaHTMLMotivo = MOTIVO.CatalogoMotivo();//Rellena la tabla con motivos } catch (Exception ex) { Master.sErrores = Errores.mostrarError("Error al obtener el catálogo de motivos.", 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) { Master.sErrores = Errores.mostrarError("Error al cargar la página.", ex); } }