private void grid_UserAcc_cell_click(object sender, MouseButtonEventArgs e) { try { UASUSR userAccData = (UASUSR)grid_UserAcc.SelectedItem; if (userAccData == null) { return; } UA_UserID.txt_Content.Text = userAccData.USER_ID == null ? string.Empty : userAccData.USER_ID; UA_Password.pwd_Password.Password = userAccData.PASSWD == null ? string.Empty : userAccData.PASSWD; UA_ConfrimPassword.pwd_Password.Password = userAccData.PASSWD == null ? string.Empty : userAccData.PASSWD; UA_UserName.txt_Content.Text = userAccData.USER_NAME == null ? string.Empty : userAccData.USER_NAME; UA_Group.combo_Content.Text = userAccData.USER_GRP == null ? string.Empty : userAccData.USER_GRP; UA_BadgeNumber.txt_Content.Text = userAccData.BADGE_NUMBER == null ? string.Empty : userAccData.BADGE_NUMBER; if (userAccData.isDisable()) { UA_AccountActivation.radbtn_Yes.IsChecked = false; UA_AccountActivation.radbtn_No.IsChecked = true; } else { UA_AccountActivation.radbtn_Yes.IsChecked = true; UA_AccountActivation.radbtn_No.IsChecked = false; } UA_Department.txt_Content.Text = userAccData.DEPARTMENT == null ? string.Empty : userAccData.DEPARTMENT; } catch (Exception ex) { logger.Error(ex, "Exception"); } }
public Boolean checkUserEnable(string user_id) { DBConnection_EF conn = null; Boolean result = true; try { conn = DBConnection_EF.GetContext(); conn.BeginTransaction(); UASUSR loginUser = userDao.getUser(conn, false, user_id); if (loginUser == null) { result = false; } else if (loginUser.isDisable()) { result = false; } else { result = true; //A0.01 UserFunc userFunc = userFuncDao.getUserFunc(conn, user_id, function_code); } conn.Commit(); } catch (Exception ex) { logger.Warn("Load User Function Failed from UASUFNC [user_id:{0}]", user_id, ex); result = false; } finally { if (conn != null) { try { conn.Close(); } catch (Exception exception) { logger.Warn("Close Connection Failed.", exception); } } } return(result); }