public override void Execute() { using (var createBranchForm = new CreateBranchForm(this)) { createBranchForm.ShowDialog(); } }
private void AddBranch() { MOG_Privileges privs = MOG_ControllerProject.GetPrivileges(); if (privs.GetUserPrivilege(MOG_ControllerProject.GetUserName(), MOG_PRIVILEGE.CreateBranch)) { CreateBranchForm newBranch = new CreateBranchForm(); newBranch.BranchSourceTextBox.Text = MOG_ControllerProject.GetBranchName(); if (newBranch.ShowDialog() == DialogResult.OK) { // Create the branch if (MOG_ControllerProject.BranchCreate(MOG_ControllerProject.GetBranchName(), newBranch.BranchNameTextBox.Text)) { MOG_DBBranchInfo branch = MOG_DBProjectAPI.GetBranch(newBranch.BranchNameTextBox.Text); AddBranchListViewItem(branch); MOG_Prompt.PromptMessage("Create Branch", "New branch successfully created.\n" + "BRANCH: " + newBranch.BranchNameTextBox.Text); } } } else { MOG_Prompt.PromptResponse("Insufficient Privileges", "Your privileges do not allow you to create branches."); } }
static private void MOGGlobalBranchCreate_Click(object sender, System.EventArgs e) { string branch = ((ToolStripMenuItem)sender).Text; CreateBranchForm newBranch = new CreateBranchForm(); newBranch.BranchSourceTextBox.Text = MOG_ControllerProject.GetBranchName(); if (newBranch.ShowDialog() == DialogResult.OK) { if (MOG_ControllerProject.BranchCreate(MOG_ControllerProject.GetBranchName(), newBranch.BranchNameTextBox.Text)) { // Rebuild the branch menu MainMenuProjectsClass.MOGGlobalBranchesInit(true); MOG_Prompt.PromptMessage("Create Branch", "New branch successfully created.\n" + "BRANCH: " + newBranch.BranchNameTextBox.Text); } } }