コード例 #1
0
        private void SetAccessForSecurityLevel(int deptID)
        {
            RSLib.COSecurity sec = new RSLib.COSecurity();
            CBUser           u   = new CBUser();
            decimal          passLvl;

            sec.InitAppSettings();
            u.Load(sec.UserID);
            passLvl = CBUserLevel.GetLevelForDepartment(u.ID, deptID);

            // enable everything in case of change
            tdbgQuikUpdate.EditActive = true;
            tdbgQuikUpdate.Enabled    = true;

            miCurrUserID = u.ID;
            if (passLvl != 3 || u.IsAdministrator == true)
            // SSS - Removing u.IsManager - will require Moderator Configuration
            //if (passLvl != 3 || u.IsAdministrator == true || u.IsManager == true)
            {
                // is a moderator for this department so enable some stuff
                //mbIsModerator = true;
            }
            else
            {
                //mbIsModerator = false;

                //tdbgQuikUpdate.EditActive = false;
                tdbgQuikUpdate.Enabled = false;
            }
        }
コード例 #2
0
        private void SaveDepartmentList(int uID)
        {
            CBUserLevel ul;

            foreach (DataRow dr in mdsDepts.Tables[0].Rows)
            {
                ul = new CBUserLevel();

                ul.ID           = Convert.ToInt32(dr["UserLevelID"]);
                ul.UserID       = uID;
                ul.DepartmentID = Convert.ToInt32(dr["DeptID"]);

                if (Convert.ToBoolean(dr["IsModerator"]) == true)
                {
                    ul.SecurityLevelID = 2;
                }
                else
                {
                    ul.SecurityLevelID = 3;
                }

                ul.Save();
            }
        }
コード例 #3
0
        public string msCurrentUserName; //******* added 12/1 for testing
        private void SetAccessForSecurityLevel()
        {
            RSLib.COSecurity sec = new RSLib.COSecurity();
            CBUser           u   = new CBUser();
            decimal          maxLvl;

            sec.InitAppSettings();
            u.Load(sec.UserID);

            maxLvl = CBUserLevel.GetMaxLevelForUser(u.ID);

            tssUsername.Text  = u.Username;
            msCurrentUserName = u.Username;
            //         MessageBox.Show(msCurrentUserName);

            // turn everything back on in case of logout
            mnuToolsEmpTitle.Enabled = true;
            mnuToolsDept.Enabled     = true;
            mnuToolsOptions.Enabled  = true;

            mnuNavigate.Enabled = true;
            mnuNavigate.Visible = true;

            tsbProject.Enabled  = true;
            tsbCustomer.Enabled = true;
            tsbEmployee.Enabled = true;

            manageReleaseTransmittalToolStripMenuItem.Enabled = true;
            manageIssueReleaseFormToolStripMenuItem.Visible   = true;
            employeeTitlesToolStripMenuItem.Visible           = true;
            departmentsToolStripMenuItem.Visible = true;

            if (u.IsAdministrator == true || u.IsEngineerAdmin == true)
            {
                forecastRemainingToolStripMenuItem.Visible        = true;
                manageReleaseTransmittalToolStripMenuItem.Enabled = true;
                mnuNavigate.Enabled = true;
                systemUsersToolStripMenuItem.Enabled = false;
                systemUsersToolStripMenuItem.Visible = false;


                // costSummaryToolStripMenuItem.Visible = true;
                costSummaryToolStripMenuItem1.Visible                   = true;
                projectForecastingToolStripMenuItem.Visible             = true;
                projectForecastingReportRollupToolStripMenuItem.Visible = true;
                weeklyPMReportsToolStripMenuItem.Visible                = true;
                pCNLogToolStripMenuItem.Visible = true;
                projectForecastingReportPipelinesToolStripMenuItem.Visible = true; //*******************Added 12/8

                if (u.IsAdministrator == true)
                {
                    systemUsersToolStripMenuItem.Enabled = true;
                    systemUsersToolStripMenuItem.Visible = true;

                    forecastRemainingToolStripMenuItem.Visible                  = true;
                    pipelineForecastRemainingToolStripMenuItem.Visible          = true;
                    programManagementForecastRemainingToolStripMenuItem.Visible = true;
                    forecastRemainingBirminghamToolStripMenuItem.Visible        = true; //*******************Added 7/24
                    manageReleaseTransmittalToolStripMenuItem.Visible           = true;
                    tsbProject.Visible     = true;
                    tsbCustomer.Visible    = true;
                    tsbEmployee.Visible    = true;
                    mnuNavCust.Enabled     = true;
                    mnuNavEmp.Enabled      = true;
                    mnuNavProjects.Visible = true;
                    mnuNavProjects.Enabled = true;
                    mnuNavCust.Visible     = true;
                    mnuNavEmp.Visible      = true;
                    employeeTitlesToolStripMenuItem.Visible = true;
                    departmentsToolStripMenuItem.Visible    = true;
                    systemUsersToolStripMenuItem.Visible    = true;
                }
            }
            else
            {
                if (u.IsManager == true)
                {  //Updated by Scott Shelton on 6/11/2015
                   // mnuNavigate.Enabled = true;
                    forecastRemainingToolStripMenuItem.Visible                  = false;
                    pipelineForecastRemainingToolStripMenuItem.Visible          = false;
                    programManagementForecastRemainingToolStripMenuItem.Visible = false;
                    forecastRemainingBirminghamToolStripMenuItem.Visible        = false; //*******************Added 7/24
                    projectForecastingReportPipelinesToolStripMenuItem.Visible  = true;  //*******************Added 12/8
                    manageReleaseTransmittalToolStripMenuItem.Visible           = false;
                    tsbProject.Visible     = false;
                    tsbCustomer.Visible    = false;
                    tsbEmployee.Visible    = false;
                    mnuNavCust.Enabled     = false;
                    mnuNavEmp.Enabled      = false;
                    mnuNavProjects.Visible = false;
                    mnuNavProjects.Enabled = false;
                    mnuNavCust.Visible     = false;
                    mnuNavEmp.Visible      = false;
                    employeeTitlesToolStripMenuItem.Visible = false;
                    departmentsToolStripMenuItem.Visible    = false;
                    systemUsersToolStripMenuItem.Visible    = false;
                }
                else
                {
                    resourceVarianceToolStripMenuItem.Visible = true;
                    //resourceVarianceSummaryToolStripMenuItem.Visible = true;

                    mnuNavigate.Visible = false;
                    forecastRemainingToolStripMenuItem.Visible                  = false;
                    pipelineForecastRemainingToolStripMenuItem.Visible          = false;
                    programManagementForecastRemainingToolStripMenuItem.Visible = false;
                    forecastRemainingBirminghamToolStripMenuItem.Visible        = false; //*******************Added 7/24
                    projectForecastingReportPipelinesToolStripMenuItem.Visible  = false; //*******************Added 12/8
                    manageReleaseTransmittalToolStripMenuItem.Visible           = false;
                    tsbProject.Visible     = false;
                    tsbCustomer.Visible    = false;
                    tsbEmployee.Visible    = false;
                    mnuNavCust.Enabled     = false;
                    mnuNavEmp.Enabled      = false;
                    mnuNavProjects.Visible = false;
                    mnuNavProjects.Enabled = false;
                    mnuNavCust.Visible     = false;
                    mnuNavEmp.Visible      = false;
                    employeeTitlesToolStripMenuItem.Visible                 = false;
                    departmentsToolStripMenuItem.Visible                    = false;
                    systemUsersToolStripMenuItem.Visible                    = false;
                    costSummaryToolStripMenuItem.Visible                    = false;
                    costSummaryToolStripMenuItem1.Visible                   = false;
                    projectForecastingToolStripMenuItem.Visible             = false;
                    projectForecastingReportRollupToolStripMenuItem.Visible = false;
                    weeklyPMReportsToolStripMenuItem.Visible                = false;
                    pCNLogToolStripMenuItem.Visible = false;
                }
            }
        }
コード例 #4
0
 private void LoadDepartments(int userID)
 {
     mdsDepts = CBUserLevel.GetListOfDepartmentLevels(userID);
     tdbgDepartments.SetDataBinding(mdsDepts, "Table", true);
 }
コード例 #5
0
        private void SetAccessForSecurityLevel(int deptID)
        {
            RSLib.COSecurity sec = new RSLib.COSecurity();
            CBUser           u   = new CBUser();
            decimal          passLvl;
            string           plsoverride;
            string           plsoverridevalue;

            plsoverride      = msCurrProj;
            plsoverridevalue = plsoverride.Substring(0, 3);


            sec.InitAppSettings();
            u.Load(sec.UserID);
            passLvl = CBUserLevel.GetLevelForDepartment(u.ID, deptID);

            miCurrUserID = u.ID;


            if (passLvl != 3 || u.IsAdministrator == true)
            {
                txtHGANumber.Enabled     = true;
                txtClientNumber.Enabled  = true;
                txtCADNumber.Enabled     = true;
                cboActivityCodes.Enabled = true;
                groupBox1.Enabled        = true;
                panel1.Enabled           = true;
                panel2.Enabled           = true;
                txtBudgetHrs.Enabled     = true;
                txtRemainingHrs.Enabled  = true;
                txtWBS.Enabled           = true;
                bttOpenExcel2.Enabled    = true; //********12/2
            }
            else
            {
                txtHGANumber.Enabled     = false;
                txtClientNumber.Enabled  = false;
                txtCADNumber.Enabled     = false;
                cboActivityCodes.Enabled = false;
                groupBox1.Enabled        = false;
                panel1.Enabled           = false;
                panel2.Enabled           = false;
                txtBudgetHrs.Enabled     = true;
                txtBudgetHrs.Visible     = false;
                txtRemainingHrs.Enabled  = false;
                txtWBS.Enabled           = false;
                bttOpenExcel2.Enabled    = false;//********12/2
            }
            if (u.IsAdministrator == true || u.IsEngineerAdmin == true)
            {
                bttProjectLead.Enabled = true;
                txtBudgetHrs.Visible   = true;
            }
            else
            {
                bttProjectLead.Enabled = false;
            }

            if (plsoverridevalue == "8.J" || plsoverridevalue == "8.H" || plsoverridevalue == "8.A" || plsoverridevalue == "0.A")
            {
                txtBudgetHrs.Enabled       = true;
                txtBudgetHrs.Visible       = true;
                label7.Visible             = false;
                label5.Visible             = false;
                txtEarnedHrs.Visible       = false;
                txtPercentComplete.Visible = false;
            }
            else
            {
                if (u.IsAdministrator == true || u.IsEngineerAdmin == true)
                {
                    txtBudgetHrs.Visible = true;
                }

                else
                {
                    txtBudgetHrs.Enabled = false;
                }
            }
        }