コード例 #1
0
ファイル: GestionMaestrasCr.cs プロジェクト: ferbenor/moro
 public void OnListaCargada(object sender, ViewLoadEventArgs e)
 {
     if (ListaCargadaEvent != null)
     {
         ListaCargadaEvent(sender, e);
     }
 }
コード例 #2
0
ファイル: ClienteCr.cs プロジェクト: ferbenor/moro
        //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;
                    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.fkpersona.idestadopersona == 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
ファイル: ContableCr.cs プロジェクト: ferbenor/moro
        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.ToList());

                    //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 void VistaCargada(object sender, ViewLoadEventArgs e)
 {
     if (raiseEvent)
     {
         if (e.RowIndex > -1 && e.ColIndex > -1)
         {
             this.dgrGenero.CurrentCell = dgrGenero.Rows[e.RowIndex].Cells[e.ColIndex];
         }
     }
 }
コード例 #5
0
 public void VistaCargada(object sender, ViewLoadEventArgs e)
 {
     if (this.RaiseEvent)
     {
         if (e.RowIndex > -1 && e.ColIndex > -1)
         {
             this.dgrLista.CurrentCell = dgrLista.Rows[e.RowIndex].Cells[e.ColIndex];
         }
         listaOriginal          = this.dgrLista.DataSource;
         this.CambiosPendientes = false;
     }
 }
コード例 #6
0
ファイル: Contables1.cs プロジェクト: ferbenor/moro
        public void VistaCargada(object sender, ViewLoadEventArgs e)
        {
            if (this.RaiseEvent)
            {
                this.RegistroEditable = (bool)e.ListaObjetos[0];
                this.objetoLocal      = e.ListaObjetos[1];
                ContableCr.Instancia.SumarValores();
                cambiosPendientes = false;
                if (this.EsEditable)
                {
                    GestionOpciones();

                    //ContableCr.Instancia.RaiseEstructuraGridDetalle(this._dgrDetalle);
                }
                //OBJETOS QUE AL CARGAR DEBEN ESTAR DESABILITADOS
                this._cboTipo.Enabled = false;
                this.registroNuevo    = false;
            }
        }
コード例 #7
0
ファイル: GestionMaestrasCr.cs プロジェクト: ferbenor/moro
        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);
        }