public static UserAccountPanelControl getSingleton() { if (singleton == null) { singleton = new UserAccountPanelControl(); } return(singleton); }
public NewUserAccountForm(UserAccountPanelControl userAccountPanelControl, FormType formType, ref UserAccount userAccount) { InitializeComponent(); this.userAccount = userAccount; this.userAccountPanelControl = userAccountPanelControl; // 填入Account Type資料 foreach (string accountTypeName in userAccountPanelControl.accountTypeTable.Keys) { accountTypeComboBox.Items.Add(accountTypeName); } // 填入Access Function資料 foreach (AccessFunction accessFunction in userAccountPanelControl.accessFunctionTable) { advancedAccessCheckedListBox.Items.Add(accessFunction.AccessFunctionName); } // 填入Department資料 foreach (string departmentName in userAccountPanelControl.departmentList) { departmentComboBox.Items.Add(departmentName); } this.formType = formType; switch (formType) { case FormType.NEW_FORM: titleLabel.Text = "New User Account"; break; case FormType.MODIFY_FORM: titleLabel.Text = string.Format("Modify Account for {0}", userAccount.LoginID); loginIDTextBox.Enabled = false; SetDataToUI(); break; } cardReader1.TextBoxForSetCardID = CardIDTextBox; }