Exemple #1
0
 public Minister(int ministerID, string firstName, string midName, string lastName, string suffix, DateTime birthDate, MinistryType ministryType, MinisterStatus status)
 {
     this._ministerID   = ministerID;
     this._firstName    = firstName;
     this._midName      = midName;
     this._lastName     = lastName;
     this._suffix       = suffix;
     this._birthdate    = birthdate;
     this._ministryType = ministryType;
     this._status       = status;
 }
        private void loadMinisterDetails()
        {
            int            ministerID = Convert.ToInt32(dgvr.Cells["ministerID"].Value);
            string         fn         = Convert.ToString(dgvr.Cells["firstName"].Value);
            string         mi         = Convert.ToString(dgvr.Cells["midName"].Value);
            string         ln         = Convert.ToString(dgvr.Cells["lastName"].Value);
            string         suffix     = Convert.ToString(dgvr.Cells["suffix"].Value);
            DateTime       birthdate  = Convert.ToDateTime(dgvr.Cells["birthdate"].Value);
            MinistryType   mtype      = (MinistryType)Convert.ToInt32(dgvr.Cells["ministryType"].Value);
            MinisterStatus status     = (MinisterStatus)Convert.ToInt32(dgvr.Cells["status"].Value);

            txtFN.Text                    = fn;
            txtMI.Text                    = mi;
            txtLN.Text                    = ln;
            txtSuffix.Text                = suffix;
            dtpBirthdate.Value            = birthdate;
            cmbMinistryType.SelectedIndex = cmbMinistryType.Items.IndexOf(mtype);
            cmbStatus.SelectedIndex       = cmbStatus.Items.IndexOf(status);
        }