private void dgv_CellClick(object sender, DataGridViewCellEventArgs e) { GroupBoxInputData.Enabled = false; id_group_level = dgv.CurrentRow.Cells[0].Value.ToString(); TextBoxRemark.Text = dgv.CurrentRow.Cells[2].Value.ToString(); ComboBoxGroup.SelectedValue = dgv.CurrentRow.Cells[4].Value.ToString(); ShowGroupLevel(); if (dgv.CurrentRow.Cells[5].Value.ToString() == "") { ComboBoxParentGroup.Text = "No Parent"; } else { ComboBoxParentGroup.SelectedValue = dgv.CurrentRow.Cells[5].Value; } ButtonEdit.Enabled = true; ButtonDelete.Enabled = true; ButtonSave.Enabled = true; if ((e.ColumnIndex == dgv.Columns["RoleGroup"].Index)) { var formMain = (FormMain)GetOpenForm.GetForm("FormMain"); formMain.ShowFormToTabPage(new FormRoleGroup()); var formRoleGroup = (formMain.GetFormInTabControl("FormRoleGroup") as FormRoleGroup); formRoleGroup.textBoxGroupLevel.Text = dt.Rows[dgv.CurrentRow.Index].ItemArray[1].ToString(); formRoleGroup.textBoxGroupLevel.Text += "-" + dgv.CurrentRow.Cells[2].Value.ToString(); formRoleGroup.textBoxGroupLevel.Tag = dgv.CurrentRow.Cells[0].Value; } }
private void ButtonUserAccess_Click(object sender, EventArgs e) { var formMain = (FormMain)GetOpenForm.GetForm("FormMain"); formMain.ShowFormToTabPage(new FormUserRole()); var formRoleGroup = (formMain.GetFormInTabControl("FormUserRole") as FormUserRole); formRoleGroup.TextBoxUser.Text = dgv.CurrentRow.Cells["userid"].Value.ToString(); formRoleGroup.TextBoxUser.Text += "-" + dgv.CurrentRow.Cells["name"].Value.ToString(); formRoleGroup.TextBoxUser.Tag = dgv.CurrentRow.Cells[0].Value; }
void ResetDesignColor() { Type varType = typeof(DesignColorReset); foreach (System.Reflection.FieldInfo fi in varType.GetFields()) { MYAPPCS.Properties.Settings.Default[fi.Name] = fi.GetValue(Color.Transparent); } MYAPPCS.Properties.Settings.Default.Save(); SetDesignColor(); var formMain = (FormMain)GetOpenForm.GetForm("FormMain"); formMain.SetDesignUI(); }
private void ButtonSetUp_Click(object sender, EventArgs e) { if (ComboBoxColor.SelectedIndex >= 0 && ComboBoxVarDesignName.SelectedIndex >= 0) { var ColorSelected = Color.FromName((String)ComboBoxColor.Items[ComboBoxColor.SelectedIndex]); var variable = varType.GetFields()[ComboBoxVarDesignName.SelectedIndex]; variable.SetValue(Color.Transparent, ColorSelected); MYAPPCS.Properties.Settings.Default[variable.Name] = ColorSelected; MYAPPCS.Properties.Settings.Default.Save(); var formMain = (FormMain)GetOpenForm.GetForm("FormMain"); formMain.SetDesignUI(); } else { MessageBox.Show("Please Select Design and Color"); } }
private void ButtonGroupLevel_Click(object sender, EventArgs e) { var formMain = (FormMain)GetOpenForm.GetForm("FormMain"); formMain.ShowFormToTabPage(new FormGroupLevel()); }
private void FormMain_FormClosed(object sender, FormClosedEventArgs e) { GetOpenForm.GetForm("FormLogin").Show(); LogApp.Logout(); }