private void FillForm() { XDropdownListItem sh_type = this.cShType._Items.Cast <XDropdownListItem>().Where(i => (string)i.Value == this.boj5_person.shType).FirstOrDefault(); XDropdownListItem nation = this.cNationality._Items.Cast <XDropdownListItem>().Where(i => ((nationality_VM)i.Value).nationality_name_th == this.boj5_person.nationality).FirstOrDefault(); if (sh_type != null) { this.cShType._SelectedItem = sh_type; } if (nation != null) { this.cNationality._SelectedItem = nation; } this.cTitle._Text = this.boj5_person.title; this.cHolderName._Text = this.boj5_person.holderName; this.cSurname._Text = this.boj5_person.surname; this.cOccupation._Text = this.boj5_person.occupation; this.cShId._Text = this.boj5_person.shId; this.cAddrNo._Text = this.boj5_person.addrNo; this.cMoo._Text = this.boj5_person.moo; this.cSoi._Text = this.boj5_person.soi; this.cRoad._Text = this.boj5_person.road; this.cTumbol._Text = this.boj5_person.tumbol; this.cAmphur._Text = this.boj5_person.amphur; this.cProvince._Text = this.boj5_person.province; this.cAddrForeign.Text = this.boj5_person.addrForeign; }
private void FillForm() { XDropdownListItem share_type = this.cShareType._Items.Cast <XDropdownListItem>().Where(c => (string)c.Value == this.boj5_detail.shareType).FirstOrDefault(); DataGridViewRow holder_row = this.dgvPerson.Rows.Cast <DataGridViewRow>().Where(r => (bool)r.Cells[this.col_selected.Name].Value == true).FirstOrDefault(); this.cShareDocId._Text = this.boj5_detail.shareDocId; if (holder_row != null) { holder_row.Cells[this.dgvPerson.FirstDisplayedScrollingColumnIndex].Selected = true; } if (share_type != null) { this.cShareType._SelectedItem = share_type; } this.cShareNumber._Value = Convert.ToDecimal(this.boj5_detail.shareNumber); this.cPaidAmount._Value = Convert.ToDecimal(this.boj5_detail.paidAmount); this.cAsPaidAmount._Value = Convert.ToDecimal(this.boj5_detail.asPaidAmount); this.cShareDocDate._SelectedDate = this.boj5_detail.shareDocDate; this.cShareRegExist._SelectedDate = this.boj5_detail.shareRegExist; this.cShareRegOmit._SelectedDate = this.boj5_detail.shareRegOmit; }