public UserTypeService() { if (UserTypeService.userTypeDataAccess == null) { UserTypeService.userTypeDataAccess = new UserTypeDataAccess(); } }
private void frm_UserRegistration_Load(object sender, EventArgs e) { try { gridRefresh(); // call grid refresh method btn_Reset.Enabled = false; // disable user account reset button metroTabControl1.SelectedTab = metroTabPage1; cmbType.DataSource = UserTypeDataAccess.getAllUserRoles(); cmbType.ValueMember = "Id"; cmbType.DisplayMember = "Type"; } catch (Exception ex) { MessageBox.Show("Failed : " + ex.Message, "Error", MessageBoxButtons.OK, MessageBoxIcon.Error); } }
public static Role GetRoleById(int id) { UserTypeDataAccess ut = new UserTypeDataAccess(); return(ut.GetRoleById(id)); }