public override void DoSalvar(ObjetoNegocio objeto) { Distribuidora distribuidora = (Distribuidora)objeto; Midas.VeiculoZ.VeiculozFachada.Instancia.SalvarDistribuidora(distribuidora); this.tId.Text = distribuidora.Id.ToString(); }
private void ObtenerValoresBusqueda(int inicio, int limite) { try { if (dgConsulta.Items.Count > 0) { dgConsulta.ItemsSource = null; dgConsulta.Items.Clear(); } var tiposParametros = new List <Type>(); var valoresParametros = new List <Object>(); if (string.Compare(txtBusqueda.Text.Trim(), descripcionAnterior.Trim(), StringComparison.CurrentCultureIgnoreCase) != 0) { descripcionAnterior = txtBusqueda.Text; ucPaginacion.Inicio = 1; inicio = 1; } var paginacionInfo = new PaginacionInfo { Inicio = inicio, Limite = limite }; tiposParametros.Add(paginacionInfo.GetType()); valoresParametros.Add(paginacionInfo); Contexto.GetType().GetProperty(CampoDescripcion).SetValue(Contexto, txtBusqueda.Text, null); tiposParametros.Add(Contexto.GetType()); valoresParametros.Add(Contexto); MethodInfo metodo = ObjetoNegocio.GetType().GetMethod(MetodoInvocacion, tiposParametros.ToArray()); if (metodo != null) { dynamic resultadoInvocacion = metodo.Invoke(ObjetoNegocio, valoresParametros.ToArray()); if (resultadoInvocacion != null && resultadoInvocacion.Lista != null && resultadoInvocacion.Lista.Count > 0) { ucPaginacion.TotalRegistros = resultadoInvocacion.TotalRegistros; dgConsulta.ItemsSource = resultadoInvocacion.Lista; } else { ucPaginacion.TotalRegistros = 0; } } } catch (ExcepcionGenerica) { SkMessageBox.Show(this, SuKarne.Controls.Properties.Resources.Ayuda_MensajeError, MessageBoxButton.OK, MessageImage.Error); } catch (Exception ex) { Logger.Error(ex); SkMessageBox.Show(this, SuKarne.Controls.Properties.Resources.Ayuda_MensajeError, MessageBoxButton.OK, MessageImage.Error); } }
protected void btns_Click(object sender, EventArgs e) { PermitirRedirigir = true; string Mensaje = ""; ObjetoNegocio["CambiarIDPyT"] = ObjetoNegocio["IDPyT"]; ObjetoNegocio["CambiarConcepto"] = con.Text; ObjetoNegocio["CambiarPrecio"] = PROT.NegocioGeneral.Lib.NoDecimalNulo(pr.Texto.Text); try { // Esto es como matar a un padre... // Código de base de datos en un aspx... PROT.AccesoDatos.Datos.Instancia().BeginTransaction(); ((LCC.Negocio.Presupuestos.PresupuestoYTarifa)ObjetoNegocio).MensajeMetodosModificar = ""; ((LCC.Negocio.Presupuestos.PresupuestoYTarifa)ObjetoNegocio).Metodo(Page, "ModificarConceptoPrecioTarifas"); Mensaje += ((LCC.Negocio.Presupuestos.PresupuestoYTarifa)ObjetoNegocio).MensajeMetodosModificar; foreach (DataGridItem dic in vtar.Grid.Items) { ((LCC.Negocio.Presupuestos.PresupuestoYTarifa)ObjetoNegocio).MensajeMetodosModificar = ""; ObjetoNegocio["CambiarIDPresupuestoVersion"] = Int32.Parse(dic.Cells[0].Text); ObjetoNegocio["CambiarUnidades"] = double.Parse(((PROT.ControlesEspeciales.Numero)dic.Controls[3].Controls[1]).Texto.Text); ObjetoNegocio["CambiarDivisor"] = ((PROT.ControlesEspeciales.Numero)dic.Controls[4].Controls[1]).Texto.Text == "" ? null : ((PROT.ControlesEspeciales.Numero)dic.Controls[4].Controls[1]).Texto.Text; ((LCC.Negocio.Presupuestos.PresupuestoYTarifa)ObjetoNegocio).Metodo(Page, "ModificarUnidadesTarifas"); Mensaje += ((LCC.Negocio.Presupuestos.PresupuestoYTarifa)ObjetoNegocio).MensajeMetodosModificar; } // Actualizar Presupuesto. ((LCC.Negocio.Presupuestos.PresupuestoYTarifa)ObjetoNegocio).Metodo(Page, "DespuesDeModificarTarifas"); PROT.AccesoDatos.Datos.Instancia().CommitTransaction(); } catch (Exception ex) { PROT.AccesoDatos.Datos.Instancia().RollBackTransaction(); Mensaje += "ERROR: " + ex.Message + PROT.AccesoDatos.Datos.CRLF; } ((RaizPage)Page).Mensaje = Mensaje; RedirigirA = "~/presupuestos/presupuesto.aspx?id=" + ObjetoNegocio.ObjetoAsociado("Presupuesto").IDActual[0].ToString(); //this.Response.Redirect("~/presupuestos/presupuesto.aspx?id=" + ObjetoNegocio.ObjetoAsociado("Presupuesto").IDActual[0].ToString(), true); }
protected void cer_Click(object sender, EventArgs e) { this.Response.Redirect("~/presupuestos/presupuesto.aspx?id=" + ObjetoNegocio.ObjetoAsociado("Presupuesto").IDActual[0].ToString(), true); }
/// <summary> /// Consulta los valores de ayuda /// </summary> /// <param name="valorParametro"></param> private void ConsultarValores(object valorParametro) { if (ValidarSiPuedeBuscar()) { try { existenDatos = false; PropertyInfo property = EsAyudaSimple ? Contexto.GetType().GetProperty(CampoDescripcion) : Contexto.GetType().GetProperty(CampoClave); if (property != null) { var tiposParametros = new[] { Contexto.GetType() }; var metodo = ObjetoNegocio.GetType().GetMethod(MetodoInvocacion, tiposParametros); if (metodo != null) { if (valorParametro == null) { object valorPropiedad = property.GetValue(Contexto, null); property.SetValue(Contexto, valorPropiedad, null); } else { try { property.SetValue(Contexto, valorParametro, null); } catch (Exception) { property.SetValue(Contexto, Convert.ToInt32(valorParametro), null); } } var valoresParametros = new[] { Contexto }; object resultadoInvocacion = metodo.Invoke(ObjetoNegocio, valoresParametros); if (resultadoInvocacion != null) { existenDatos = true; AsiganaValores(resultadoInvocacion); } else { SkMessageBox.Show(Application.Current.Windows[1], MensajeClaveInexistenteBusqueda, MessageBoxButton.OK, MessageImage.Warning); LimpiarCampos(); if (BusquedaVacia != null) { BusquedaVacia(); } } } } } catch (Exception ex) { Logger.Error(ex); SkMessageBox.Show(Application.Current.Windows[1], SuKarne.Controls.Properties.Resources.Ayuda_MensajeError, MessageBoxButton.OK, MessageImage.Error); } } }