/// <summary> /// In forms constructor the not necessarily labels and tetxboxes are hiding /// from the form. Then the combobox for user types(CmbUsersTypes) is filling /// from the user types(users_types) table. /// /// </summary> public EditUsersTypes() { InitializeComponent(); BtnEdit.Hide(); LblGuide1.Hide(); TbxEditiUsersTypes.Hide(); CmbUsersTypes.DataSource = DCom.GetData("SELECT * FROM users_types"); CmbUsersTypes.DisplayMember = "Type"; CmbUsersTypes.ValueMember = "Type"; }
/// <summary> /// When the client select the user type that wants to edit the not necessarily labels and comboboxes are hiding /// from the form and then the neccesarily labels and tetxboxes are pop up. Then fills all the fields with /// the data of the selected user type. /// </summary> /// <param name="sender"></param> /// <param name="e"></param> private void BtnSelect_Click(object sender, EventArgs e) { BtnEdit.Show(); LblGuide1.Show(); TbxEditiUsersTypes.Show(); BtnSelect.Hide(); CmbUsersTypes.Hide(); LblGuide.Hide(); SelectedData = DCom.GetData(String.Format(SqlExec, CmbUsersTypes.SelectedValue)); TbxEditiUsersTypes.Text = (string)SelectedData.Rows[0]["Type"]; }