예제 #1
0
 public ReferencesForm()
 {
     InitializeComponent();
     PopulateGrid();
     // Member Can't access Add/Update/Delete Button
     AddIconButton.Hide();
     UpdateIconButton.Hide();
     DeleteIconButton.Hide();
     RightPanel.Size = new Size(17, 0);
 }
예제 #2
0
        private void Selection(string SubButton)
        {
            if (SubButton == "Show")
            {
                HeadingLable.Text = "List Of All Cases";
                HidenPanel.Size   = new Size(17, 0);
                RightPanel.Hide();

                if (Identity == "Admin")
                {
                    Query = "";
                }
                else if (Identity != "")
                {
                    Query = "";
                }
            }
            else if (SubButton == "Approve")
            {
                HeadingLable.Text = "List Of Approved Cases";
                CasesGrid.Columns[7].HeaderText = "Approval Date";

                if (Identity == "Admin")
                {
                    ApproveIconButton.Hide();
                    AddIconButton.Hide();
                    RejectIconButton.Location    = new Point(6, 18);
                    PendingIconButton.Location   = new Point(6, 68);
                    CompletedIconButton.Location = new Point(6, 118);
                    DeleteIconButton.Location    = new Point(6, 168);
                    Query = "";
                }
                else if (Identity != "")
                {
                    HidenPanel.Size = new Size(17, 0);
                    RightPanel.Hide();
                    Query = "";
                }
                else        // If no Team is Joined
                {
                    HidenPanel.Size = new Size(17, 0);
                    RightPanel.Hide();
                }
            }
            else if (SubButton == "Rejected")
            {
                HeadingLable.Text = "List Of Rejected Cases";
                CasesGrid.Columns[7].HeaderText = "Rejection Date";

                if (Identity == "Admin")
                {
                    RejectIconButton.Hide();
                    AddIconButton.Hide();
                    PendingIconButton.Location   = new Point(6, 68);
                    CompletedIconButton.Location = new Point(6, 118);
                    DeleteIconButton.Location    = new Point(6, 168);
                    Query = "";
                }
                else if (Identity != "")
                {
                    HidenPanel.Size = new Size(17, 0);
                    RightPanel.Hide();
                    Query = "";
                }
                else
                {
                    HidenPanel.Size = new Size(17, 0);
                    RightPanel.Hide();
                }
            }
            else if (SubButton == "Pending")
            {
                HeadingLable.Text = "List Of Pending Cases";
                CasesGrid.Columns[7].HeaderText = "Pending Date";

                PendingIconButton.Hide();
                CompletedIconButton.Hide();

                if (Identity == "Admin")
                {
                    AddIconButton.Hide();
                    DeleteIconButton.Location = new Point(6, 118);
                    Query = "";
                }
                else if (Identity != "")
                {
                    ApproveIconButton.Hide();
                    RejectIconButton.Hide();
                    // Relocating Buttons
                    AddIconButton.Location    = new Point(6, 18);
                    DeleteIconButton.Location = new Point(6, 68);
                    Query = "";
                }
                else
                {
                    HidenPanel.Size = new Size(17, 0);
                    RightPanel.Hide();
                }
            }
            else
            {
                HeadingLable.Text = "List Of Completed Cases";
                CasesGrid.Columns[7].HeaderText = "Approval Date";

                if (Identity == "Admin")
                {
                    ApproveIconButton.Hide();
                    RejectIconButton.Hide();
                    PendingIconButton.Hide();
                    CompletedIconButton.Hide();
                    AddIconButton.Hide();
                    DeleteIconButton.Location = new Point(6, 18);
                    Query = "";
                }
                else if (Identity != "")
                {
                    HidenPanel.Size = new Size(17, 0);
                    RightPanel.Hide();
                    Query = "";
                }
                else
                {
                    HidenPanel.Size = new Size(17, 0);
                    RightPanel.Hide();
                }
            }
        }