Esempio n. 1
0
        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.");
            }
        }
Esempio n. 2
0
        private void AddTagListViewItem(MOG_DBBranchInfo branch, bool isActiveTag)
        {
            ListViewItem item = new ListViewItem();

            item.Text = branch.mBranchName;
            item.SubItems.Add(MogUtils_StringVersion.VersionToString(branch.mCreatedDate));
            item.SubItems.Add(branch.mCreatedBy);
            if (isActiveTag)
            {
                item.ImageKey = "check";
            }

            TagsListView.Items.Add(item);
        }
Esempio n. 3
0
        private void AddBranchListViewItem(MOG_DBBranchInfo branch)
        {
            ListViewItem item = new ListViewItem();

            item.Text = branch.mBranchName;
            item.SubItems.Add(MogUtils_StringVersion.VersionToString(branch.mCreatedDate));
            item.SubItems.Add(branch.mCreatedBy);
            item.SubItems.Add(MogUtils_StringVersion.VersionToString(branch.mRemovedDate));
            item.SubItems.Add(branch.mRemovedBy);

            // This is a removed branch
            if (branch.mRemovedBy.Length != 0)
            {
                item.BackColor = System.Drawing.Color.Red;
            }

            BranchesListView.Items.Add(item);
        }