Пример #1
0
 public void OnListaCargada(object sender, ViewLoadEventArgs e)
 {
     if (ListaCargadaEvent != null)
     {
         ListaCargadaEvent(sender, e);
     }
 }
Пример #2
0
        //public object RaiseEstructuraGridDetalle(DataGridView objetoGrid)
        //{
        //    proveedor.ArmarGridDetalle(objetoGrid);
        //    return this.proveedor;
        //}

        public void RaiseCargaVista(object unObjetoLocal)
        {
            if (unObjetoLocal != null)
            {
                cliente registro = (cliente)unObjetoLocal;
                //TipoContablePr tipoContablePr = new TipoContablePr();

                try
                {
                    List <object>     listaValores = new List <object>();
                    ViewLoadEventArgs argumentos   = new ViewLoadEventArgs();

                    //ASIGNACION DE VALORES A CONTROLES
                    //SE ASIGNA LA CARGA DE TODOS LOS CONTROLES QUE PRESETAN LOS DATOS DEL OBJETO ENTIDAD
                    //DATOS PERSONA
                    ((DateTimeInput)this.controles["_dtpFechaIngreso"]).Value = registro.fechaingreso;
                    this.controles["_txtId"].Text       = registro.id.ToString();
                    this.controles["_txtApellido"].Text = registro.apellido;
                    this.controles["_txtNombre"].Text   = registro.nombre;
                    ((ComboBox)this.controles["_cboTipoPersona"]).DataSource      = this.proveedor.ListaTipoPersona;
                    ((ComboBox)this.controles["_cboTipoPersona"]).SelectedValue   = registro.tipopersona;
                    ((ComboBox)this.controles["_cboTipoDocumento"]).DataSource    = this.proveedor.ListaTipoDocumento;
                    ((ComboBox)this.controles["_cboTipoDocumento"]).SelectedValue = registro.tipodocumento;
                    this.controles["_txtIdentificacionSN"].Text            = registro.identificacion;
                    ((ComboBox)this.controles["_cboGenero"]).DataSource    = this.proveedor.ListaGenero;
                    ((ComboBox)this.controles["_cboGenero"]).SelectedValue = registro.genero;
                    //DATOS CLIENTE
                    this.controles["_txtRazonSocial"].Text         = registro.razonsocial;
                    this.controles["_txtTelefonoSN"].Text          = registro.telefono;
                    ((PictureBox)this.controles["_picFoto"]).Image = registro.foto;
                    this.controles["_txtBarrio"].Text    = registro.barrio.ToString();
                    this.controles["_txtDireccion"].Text = registro.referenciadireccion;
                    this.controles["_txtCelularSN"].Text = registro.celular;
                    //this.controles["_txtCorreo"].Text = registro.Correo;
                    ((ComboBox)this.controles["_cboEstadoCivil"]).DataSource    = this.proveedor.ListaEstadoCivil;
                    ((ComboBox)this.controles["_cboEstadoCivil"]).SelectedValue = registro.fkestadoscivile;
                    this.controles["_txtConyugue"].Text     = registro.fkconyuge.ToString();
                    this.controles["_txtProfesion"].Text    = registro.fkprofesione.nombre;
                    this.controles["_txtInfAdicional"].Text = registro.informacionadicional;
                    this.controles["_lblEstado"].Text       = registro.estadopersona.descripcion;
                    this.controles["_lblEstado"].ForeColor  = registro.estadopersona.id == 2 ? System.Drawing.Color.Red : System.Drawing.Color.Blue;
                    //PASO DE VALORES AL FORMULARIO PARA ASIGNACION DE VARIABLES LOCALES
                    listaValores.Add(registro);
                    argumentos.ListaObjetos = listaValores;
                    GestionMaestrasCr.Instancia.OnListaCargada(null, argumentos);
                }
                catch (Exception ex)
                {
                    if (ex.InnerException == null)
                    {
                        General.Mensaje(ex.Message.ToString());
                    }
                    else
                    {
                        General.Mensaje(ex.InnerException.Message.ToString());
                    }
                }
            }
        }
Пример #3
0
        public void RaiseCargaVista(object unObjetoLocal)
        {
            if (unObjetoLocal != null)
            {
                contable registro = (contable)unObjetoLocal;
                //TipoContablePr tipoContablePr = new TipoContablePr();

                try
                {
                    List <object> listaValores = new List <object>();

                    ViewLoadEventArgs argumentos = new ViewLoadEventArgs();

                    //ASIGNACION DE VALORES A CONTROLES
                    this.controles["_lblAnulado"].Visible                = registro.esanulado ? true : false;
                    this.controles["_txtNumero"].Text                    = registro.numero.ToString("0000000");
                    ((ComboBox)this.controles["_cboTipo"]).DataSource    = proveedor.ListaTipoContable;
                    ((ComboBox)this.controles["_cboTipo"]).SelectedValue = registro.fktiposcontable;
                    ((DateTimeInput)this.controles["_dtpFecha"]).Value   = registro.fecha;
                    this.controles["_txtBeneficiario"].Text              = registro.fkpersona.ToString();
                    this.controles["_txtDetalle"].Text                   = registro.observacion;

                    //ASIGNACION DE DATOS AL DETALLE
                    ((DataGridView)this.controles["_dgrDetalle"]).DataSource = null;
                    ((DataGridView)this.controles["_dgrDetalle"]).DataSource = SoporteList <detallecontable> .ToBindingList(registro.fkdetallescontables);

                    //if (((DataGridView)this.controles[5]).DataSource == null)
                    //    ((DataGridView)this.controles[5]).DataSource = SoporteList<DetalleContable>.ToBindingList(registro.DetalleContable);
                    //else
                    //{
                    //    System.ComponentModel.BindingList<DetalleContable> listaDetalle = (System.ComponentModel.BindingList<DetalleContable>)((DataGridView)this.controles[5]).DataSource;
                    //    listaDetalle.Clear();
                    //    registro.DetalleContable.ForEach(delegate(DetalleContable x) { listaDetalle.Add(x); });
                    //}
                    //PASO DE VALORES AL FORMULARIO PARA ASIGNACION DE VARIABLES LOCALES
                    listaValores.Add(registro.eseditable);
                    listaValores.Add(registro);
                    argumentos.ListaObjetos = listaValores;
                    GestionMaestrasCr.Instancia.OnListaCargada(null, argumentos);
                }
                catch (Exception ex)
                {
                    if (ex.InnerException == null)
                    {
                        General.Mensaje(ex.Message.ToString());
                    }
                    else
                    {
                        General.Mensaje(ex.InnerException.Message.ToString());
                    }
                }
                finally
                {
                }
            }
        }
Пример #4
0
        public object RaiseListLoad(object sender, string modulo, int rowIndex, int colIndex = 0)
        {
            int    totalLista         = 0;
            object proveedorInstancia = null;

            try
            {
                proveedorInstancia = CargaGrid(modulo, ((DataGridView)sender));
                totalLista         = ((DataGridView)sender).RowCount;
                if (ListaCargadaEvent != null)
                {
                    ViewLoadEventArgs argumentos = new ViewLoadEventArgs(modulo);

                    argumentos.ColIndex = colIndex;
                    argumentos.RowCount = totalLista;
                    //DEFINIMOS ROWINDEX
                    if (totalLista <= rowIndex)
                    {
                        argumentos.RowIndex = totalLista - 1;
                    }
                    else
                    if (totalLista > rowIndex)
                    {
                        argumentos.RowIndex = rowIndex;
                    }

                    ListaCargadaEvent(sender, argumentos);
                }
            }
            catch (Exception ex)
            {
                if (ex.InnerException == null)
                {
                    General.Mensaje(ex.Message, MessageBoxIcon.Exclamation);
                }
                else
                {
                    General.Mensaje(ex.InnerException.Message, MessageBoxIcon.Exclamation);
                }
            }

            return(proveedorInstancia);
        }