public void LoadData() { CheckForIllegalCrossThreadCalls = false; // // LISTANDO LOS DATOS DEL ALUMNO // this._student = this._cStudents.FindStudents( this._codigo ); this.lblNames.Text = this._student.Names; this.ttpData.SetToolTip( this.lblNames, this._student.Names ); this.lblLastNames.Text = this._student.LastNames; this.ttpData.SetToolTip( this.lblLastNames, this._student.LastNames ); this.lblGenero.Text = ( this._student.Gender ) ? "Femenino" : "Masculino"; this.ttpData.SetToolTip( this.lblGenero, ( this._student.Gender ) ? "Femenino" : "Masculino" ); this.lblBrindthey.Text = this._student.Birthday; this.ttpData.SetToolTip( this.lblBrindthey, this._student.Birthday ); string age = Convert.ToInt32( ( ( ( DateTime.Now - Convert.ToDateTime( this._student.Birthday ) ).TotalDays ) / 365 ) ).ToString() + " " + "AƱos"; this.lblAge.Text = age; this.ttpData.SetToolTip( this.lblAge, age ); this.lblColegio_Procedencia.Text = this._student.NameLastSchool; this.ttpData.SetToolTip( this.lblColegio_Procedencia, this._student.NameLastSchool ); this.lblType.Text = ( this._student.TypeLastSchool ) ? "Estatal" : "Privada"; this.ttpData.SetToolTip( this.lblType, ( this._student.TypeLastSchool ) ? "Estatal" : "Privada" ); this.lblAdress.Text = this._student.Address; this.ttpData.SetToolTip( this.lblAdress, this._student.Address ); string[] ubigeo = new string[3] { this._student.Ubigeo.Substring(0, 2), this._student.Ubigeo.Substring(2, 2), this._student.Ubigeo.Substring(4, 2), }; object[] dep = this._data.Tables["Departamentos"].Select( "CodDepartamento=" + ubigeo[0] )[0].ItemArray; this.lblDepartament.Text = ( string ) dep[1]; this.ttpData.SetToolTip( this.lblDepartament, ( string ) dep[1] ); object[] Provincia = this._data.Tables["Provincias"].Select( "ClaveUbigeo=" + Convert.ToInt32( ubigeo[1] ) + " AND Cod_Departamento=" + ubigeo[0] )[0].ItemArray; this.lblProvince.Text = ( string ) Provincia[3]; this.ttpData.SetToolTip( this.lblProvince, ( string ) Provincia[3] ); object[] Distrito = this._data.Tables["Distritos"].Select( "ClaveUbigeo=" + Convert.ToInt32( ubigeo[2] ) + " AND Cod_Provincia=" + Provincia[0] )[0].ItemArray; this.lblDistrict.Text = ( string ) Distrito[3]; this.ttpData.SetToolTip( this.lblDistrict, ( string ) Distrito[3] ); if ( this.pbfoto != null ) { this.pbfoto.ImageLocation = this._cStudents.ConfigBaseUrl + this._student.ImageSrc; this.ttpData.SetToolTip( this.pbfoto, this._cStudents.ConfigBaseUrl + this._student.ImageSrc ); } this.PanelMain.Enabled = true; this.pgsLoading.Visible = false; // // LISTANDO DOCUMENTOS DEL ALUMNO // List<lDocumentos> lista = this._cDocuments.List( this._codigo ); if ( lista != null && lista.Any() ) { foreach ( lDocumentos item in lista ) { object[] obj = new object[5] { item.Codigo, item.Names, item.Number, item.Expiration, item.ModifiedDate }; this.dgvDocumentos.Rows.Add( obj ); } this.pgsLoadingDocument.Visible = false; } else { this.dgvDocumentos.Enabled = false; this.pgsLoadingDocument.Visible = false; } // // LISTANDO LOS APODERADOS DEL ALUMNO // List<lApoderados> list = this._cParents.List( this._codigo ); if ( list.Any() ) { foreach ( lApoderados item in list ) { object[] objTemp = new object[3] { item.Codigo, item.Names, item.TipoApoderado }; this.dgvParientes.Rows.Add( objTemp ); } this.pgsLoadingparientes.Visible = false; } else { this.dgvParientes.Enabled = false; this.pgsLoadingparientes.Visible = false; } this._hilo.Abort(); }
private void LoadData() { CheckForIllegalCrossThreadCalls = false; this._inAction = true; if ( this._toActualize ) { this.panelMain.Enabled = false; this.pgaAlumnoLoad.Visible = true; this._student = this.alum.FindStudents( this._codigoAlumno ); this.txtnombre.Text = this._student.Names; this.lvAlumnoNombre.Visible = false; this.txtapellidos.Text = this._student.LastNames; this.lvAlumnoApellido.Visible = false; this.cbsexo.SelectedIndex = ( this._student.Gender ) ? 1 : 0; this.lvAlumnoGenero.Visible = false; this.dtbirthday.Value = Convert.ToDateTime( this._student.Birthday ); this.lvAlumnoFechaNacimiento.Visible = false; this.txtAlumnoColegiaProcedencia.Text = this._student.NameLastSchool; this.lvAlumnoColegioProcedencia.Visible = false; this.cbAlumnoTipoColegio.SelectedIndex = ( this._student.TypeLastSchool ) ? 1 : 0; this.lbvtipocolegio.Visible = false; this.txtAlumnoDireccion.Text = this._student.Address; this.lbVdireccion.Visible = false; this.txtobservacion.Text = this._student.Observation; string[] ubigeo = new string[3] { this._student.Ubigeo.Substring(0, 2), this._student.Ubigeo.Substring(2, 2), this._student.Ubigeo.Substring(4, 2), }; this.cbDepartamento.SelectedValue = Convert.ToInt32( ubigeo[0] ); this.cbDepartamento_SelectionChangeCommitted( cbDepartamento, EventArgs.Empty ); this.cbProvincia.SelectedValue = (Convert.ToInt32(ubigeo[1])).ToString(); this.cbProvincia_SelectionChangeCommitted( cbProvincia, EventArgs.Empty ); this.cbdistrito.SelectedValue = (Convert.ToInt32(ubigeo[2])).ToString(); this.lblvdistrito.Visible = false; if ( !string.IsNullOrEmpty( this._student.ImageSrc ) ) this.pbAlumnoPerfilPicture.ImageLocation = this.alum.ConfigBaseUrl + this._student.ImageSrc; else this.pbAlumnoPerfilPicture.ImageLocation = this.alum.ConfigBaseUrl + "static/img/pdefault_md.png"; } this.pgaAlumnoLoad.Visible = false; this.panelMain.Enabled = true; this.alum.ListSchool( _data ); this._inAction = false; this._hilo.Abort(); }
private void LoadData() { CheckForIllegalCrossThreadCalls = false; if ( this._toActualize ) { this.panelMain.Enabled = false; this.pgaAlumnoLoad.Visible = true; this._student = this.alum.FindStudents( this._codigoAlumno ); this.txtnombre.Text = this._student.Names; this.txtapellidos.Text = this._student.LastNames; this.cbsexo.SelectedIndex = ( this._student.Gender ) ? 1 : 0; this.dtbirthday.Value = Convert.ToDateTime( this._student.Birthday ); this.txtAlumnoColegiaProcedencia.Text = this._student.NameLastSchool; this.cbAlumnoTipoColegio.SelectedIndex = ( this._student.TypeLastSchool ) ? 1 : 0; this.txtAlumnoDireccion.Text = this._student.Address; this.txtobservacion.Text = this._student.Observation; string[] ubigeo = new string[3] { this._student.Ubigeo.Substring(0, 2), this._student.Ubigeo.Substring(2, 2), this._student.Ubigeo.Substring(4, 2), }; this.cbDepartamento.SelectedValue = Convert.ToInt32( ubigeo[0] ); //this.Invoke( ( MethodInvoker ) delegate() //{ // this.cbAlumnoDepartamento_SelectionChangeCommitted( cbDepartamento, EventArgs.Empty ); //}); this.cbProvincia.SelectedValue = Convert.ToInt32( ubigeo[1] ); //this.cbAlumnoProvincia_SelectionChangeCommitted( cbAlumnoProvincia, EventArgs.Empty ); this.cbdistrito.SelectedValue = Convert.ToInt32( ubigeo[2] ); if ( pbAlumnoPerfilPicture != null ) { this.pbAlumnoPerfilPicture.ImageLocation = this.alum.ConfigBaseUrl + this._student.ImageSrc; } } this.pgaAlumnoLoad.Visible = false; this.panelMain.Enabled = true; this.alum.ListSchool( _data ); }