private StudentEntity GetDataPeao() { StudentEntity entityPeao = new StudentEntity() { Adress = this.txtAdressPeao.Text.Trim(), City = this.txtCityPeao.Text.Trim(), Email = this.txtEmailPeao.Text.Trim(), Id = Convert.ToInt32(this.lblIdPeao.Text), Mobile = this.txtMobilePeao.Text.Trim(), Name = this.txtNamePeao.Text.Trim(), Phone = this.txtPhonePeao.Text.Trim(), SexType = this.cbSexPeao.SelectedIndex == 0 ? "F" : "M" }; return entityPeao; }
private void PopulateFieldsPrenda(StudentEntity entityPrenda) { this.lblIdPrenda.Text = entityPrenda.Id.ToString(); this.txtAdressPrenda.Text = entityPrenda.Adress; this.txtCityPrenda.Text = entityPrenda.City; this.txtEmailPrenda.Text = entityPrenda.Email; this.txtMobilePrenda.Text = entityPrenda.Mobile; this.txtNamePrenda.Text = entityPrenda.Name; this.txtPhonePrenda.Text = entityPrenda.Phone; this.cbSexPeao.SelectedIndex = entityPrenda.SexType.Equals("M") ? 1 : 0; }
public FrmNewStudent(StudentEntity regEntity) { InitializeComponent(); frmNewStudent = this; PopulateFields(regEntity); }
private void PopulateFields(StudentEntity regEntity) { var entityReg = (from r in new RegistrationFormBUS().GetAll() where r.IdStudent == regEntity.Id select r).FirstOrDefault(); //number registration this.txtNumberRegistration.Text = entityReg.Id.ToString(); this.chbPayment.Checked = entityReg.Payment; var entitysRegStudents = from r in new RegistrationFormBUS().GetAll() where r.Id == entityReg.Id select r; PopolateFieldsClass(new ClassBUS().GetByID(entityReg.IdClass),entityReg.Observation); PopulateFieldsPeao(new StudentBUS().GetByID(entitysRegStudents.ElementAt(0).IdStudent)); PopulateFieldsPrenda(new StudentBUS().GetByID(entitysRegStudents.ElementAt(1).IdStudent)); PopulateFieldsKnowLeddge(entityReg); }