I need some help with LoadScreenFromObject() method. I am available to save data from the controls to database. However, I can't retrieve data from the database and map the data to the controls. Below are the codes for the two methods.
protected override void LoadObjectFromScreen(tblUserEO baseEO)
baseEO.UserName = txtUserName.Text;
baseEO.UserPassword = txtPassword.Text;
baseEO.UserType = Convert.ToInt32(txtUserType.Text);
baseEO.IsActive = ckbIsActive.Checked;
protected override void LoadScreenFromObject(tblUserEO baseEO)
txtUserName.Text = baseEO.UserName;
txtPassword.Text = baseEO.UserPassword;
txtUserType.Text = Convert.ToString(baseEO.UserType);
ckbIsActive.Checked = baseEO.IsActive;
ViewState[VIEW_STATE_KEY_USER] = baseEO;
I debugged the codes, and the return values of baseEO.UserName, baseEO.UserPassword, and baseEO.UserType from LoadScreenFromObject() are null. Am I am missing from something?
I would like to retrieve UserName and Password from the tblUser table. What would be the good way to do so? Do I have to write internal methods to select those values in tblUserEO class?
I truly appreciate if you can give me some suggestions.