示例#1
0
        private void bttOK_Click(object sender, EventArgs e)
        {
            RSLib.COSecurity sec = new RSLib.COSecurity();
            CBUser           u   = new CBUser();

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

            if (u.IsAdministrator == true)
            //if (u.IsAdministrator == true || u.IsEngineerAdmin == true)
            {
                if (mbItemChanged == true && IsValid() == true)
                {
                    LoadScreenToObject();
                    moEmp.Save();

                    SaveDepartments(moEmp.ID);

                    if (OnNewItem != null)
                    {
                        OnNewItem(moEmp.ID);
                    }
                }
            }

            this.Close();
        }
示例#2
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;
            }
        }
示例#3
0
        private void LoadItemList()
        {
            SqlDataReader dr;
            ListViewItem  lvi;

            this.Cursor = Cursors.WaitCursor;

            dr = CBUser.GetList();
            lvwItems.Items.Clear();

            while (dr.Read())
            {
                lvi = new ListViewItem();

                lvi.Text = dr["ID"].ToString();
                lvi.SubItems.Add(dr["Username"].ToString());
                lvi.SubItems.Add(dr["Description"].ToString());

                lvwItems.Items.Add(lvi);
            }
            lvwItems.ColumnClick += new ColumnClickEventHandler(lvwItems_ColumnClick);// ****************  this line was added MZ
            dr.Close();

            sbPanStatus.Text = lvwItems.Items.Count.ToString() + " user(s)";

            this.Cursor = Cursors.Default;
        }
示例#4
0
        private void bttApply_Click(object sender, EventArgs e)
        {
            RSLib.COSecurity sec = new RSLib.COSecurity();
            CBUser           u   = new CBUser();

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

            if (u.IsAdministrator == true || u.IsEngineerAdmin)
            // System Administrators and Document Managers can update customers in PCATS
            {
                if (mbItemChanged == true && IsValid() == true)
                {
                    LoadScreenToObject();
                    moCust.Save();

                    SaveLocationsForCustomer(moCust.ID);

                    if (OnNewItem != null)
                    {
                        OnNewItem(moCust.ID);
                    }

                    bttOK.Enabled       = false;
                    bttApply.Enabled    = false;
                    grpLocation.Enabled = true;
                }
            }
        }
示例#5
0
        private void SetPCNSecurityLevel()
        {
            RSLib.COSecurity sec = new RSLib.COSecurity();
            CBUser           u   = new CBUser();

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

            if (u.IsAdministrator == true || u.IsEngineerAdmin == true || u.IsManager == true)
            {
            }
            else
            {
                tlbbPrint.Enabled           = false;
                label10.Visible             = false;
                txtEstimatedHrs.Visible     = false;
                label15.Visible             = false;
                txtEstimatedDollars.Visible = false;
                label2.Visible              = false;
                txtEstimTIC.Visible         = false;
                label1.Visible              = false;
                txtEstimateAccuracy.Visible = false;

                tdbgHours.Splits[0].DisplayColumns[5].Visible = false;
                tdbgHours.Splits[0].DisplayColumns[7].Visible = false;

                /*
                 * tdbgExpenses.Splits[0].DisplayColumns[2].Visible = false;
                 * tdbgExpenses.Splits[0].DisplayColumns[4].Visible = false;
                 * tdbgExpenses.Splits[0].DisplayColumns[5].Visible = false;
                 * tdbgExpenses.Splits[0].DisplayColumns[6].Visible = false;
                 */
            }
        }
示例#6
0
        private void ClearForm()
        {
            moUser              = new CBUser();
            txtUsername.Text    = "";
            txtDescription.Text = "";
            txtPassword.Text    = "";
            txtConfirm.Text     = "";

            chkAdministrator.Checked = false;
            chkEngineerAdmin.Checked = false;
            chkManager.Checked       = false;
        }
示例#7
0
        protected override void bttDelete_Click(object sender, EventArgs e)
        {
            base.bttDelete_Click(sender, e);

            int    tmpID = Convert.ToInt32(lvwItems.SelectedItems[0].Text);
            string val   = lvwItems.SelectedItems[0].SubItems[1].Text;

            DialogResult retVal = MessageBox.Show("Are you sure that you wish to remove \"" + val + "\"", "Remove Item", MessageBoxButtons.YesNo, MessageBoxIcon.Question);

            if (retVal == DialogResult.Yes)
            {
                CBUser.Delete(tmpID);
                LoadItemList();
            }
        }
示例#8
0
        private void SetSecurityAccessLevel()
        {
            RSLib.COSecurity sec = new RSLib.COSecurity();
            CBUser           u   = new CBUser();

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

            if (u.IsAdministrator == false)
            {
                chkAdministrator.Enabled = false;
                chkEngineerAdmin.Enabled = false;
                chkManager.Enabled       = false;
                tdbgDepartments.Enabled  = false;
            }
        }
示例#9
0
        private bool AllowEditPCN(CBUser user)
        {
            bool retVal = false;

            if (user.IsAdministrator == true)
            {
                retVal = true;
            }

            if (user.IsEngineerAdmin == true)
            {
                retVal = true;
            }

            return(retVal);
        }
示例#10
0
        private void bttOK_Click(object sender, EventArgs e)
        {
            RSLib.COSecurity sec = new RSLib.COSecurity();
            CBUser           u   = new CBUser();

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

            if (u.IsAdministrator == true || u.IsEngineerAdmin == true)
            {
                if (mbItemChanged == true && IsValid() == true)
                {
                    LoadScreenToObject();
                    moProj.Save();
                    SaveBudgets(moProj.ID);
                    newPM = moProj.ProjMngrID;

                    if (mbPMChanged == true)
                    {
                        if (IsNewProject == true)
                        {
                            Save_Summary_NewProject(newPM, moProj.ID);
                        }
                        else
                        {
                            Save_PMUpdate(previousPM, newPM, moProj.ID);
                        }
                    }
                    else
                    {
                    }

                    if (OnNewItem != null)
                    {
                        OnNewItem(moProj.ID);
                    }
                }

                else
                {
                    MessageBox.Show("No change Allowed");
                    return;
                }
            }

            this.Close();
        }
示例#11
0
        private void bttOK_Click(object sender, EventArgs e)
        {
            CBUser user = new CBUser();

            RSLib.COAppSetting aps = new RSLib.COAppSetting();
            RSLib.COSecurity   sec = new RSLib.COSecurity();

            user.Load(txtUser.Text, txtPassword.Text);
            //SSS 20131105 Added to force focus on password field on startup
            txtPassword.Focus();

            if (user.ID > 0)
            {
                aps.InitAppSettings();
                aps.LastUser = user.Username;
                aps.SaveAppSettings();

                sec.UserID    = user.ID;
                sec.SessionID = System.Guid.NewGuid().ToString();
                sec.SaveAppSettings();

                if (OnSuccessLogin != null)
                {
                    OnSuccessLogin(user.ID, sec.SessionID);
                }

                // MessageBox.Show("Loading User");
                LoadScreenToObject();
                // MessageBox.Show(moLog.Name);

                Common.GlobalVar.GlobalValue = moLog.Save();

                UserName = txtUser.Text;

                //   MessageBox.Show(Common.GlobalVar.GlobalValue + "----" + UserName);


                this.Close();
            }
            else
            {
                MessageBox.Show("Invalid User Name or Password", "Login Error", MessageBoxButtons.OK, MessageBoxIcon.Information);
                txtPassword.Text = "";
                txtPassword.Focus();
            }
        }
示例#12
0
        private void SetSecurityAccessLevel()
        {
            RSLib.COSecurity sec = new RSLib.COSecurity();
            CBUser           u   = new CBUser();

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

            if (u.IsAdministrator == true || u.IsEngineerAdmin == true)
            //if (u.IsAdministrator == true || u.IsManager == true)
            {
                mbAllowEdit = true;
            }
            else
            {
                mbAllowEdit    = false;
                bttNew.Enabled = false;
            }
        }
示例#13
0
        private void bttOK_Click(object sender, EventArgs e)
        {
            CBUser user = new CBUser();

            user.Load(txtUser.Text, txtPassword.Text);

            if (AllowEditPCN(user) == true)
            {
                string changeOnly;

                if (mbIsChangeOnly == false)
                {
                    changeOnly = "NO";
                }
                else
                {
                    changeOnly = "YES";
                }

                if (OnChangeApproved != null)
                {
                    OnChangeApproved(changeOnly, 1);
                }

                mbIsApproved = true;

                if (mbIsUserCheckOnly == true)
                {
                    this.Hide();
                }
                else
                {
                    this.Close();
                }
            }
            else
            {
                MessageBox.Show("User is not listed in the controls group", "User Error", MessageBoxButtons.OK, MessageBoxIcon.Stop);
            }
        }
示例#14
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;
                }
            }
        }
示例#15
0
        private void LoadObjectToScreen()
        {
            CBCustomer     c  = new CBCustomer();
            CBLocation     l  = new CBLocation();
            CBEmployee     e  = new CBEmployee();
            CBRateSchedule rs = new CBRateSchedule();

            txtNumber.Text      = moProj.Number;
            txtDescription.Text = moProj.Description;

            c.Load(moProj.CustomerID);
            cboCustomer.Text       = c.Name;
            txtCustomerNumber.Text = moProj.CustomerProjNumber;

            LoadLocationBox(moProj.CustomerID);
            l.Load(moProj.LocationID);
            cboLocation.Text = l.FullName;

            e.Load(moProj.ProjMngrID);
            cboManager.Text = e.Name;

            e.Load(moProj.LeadProjMngrID);
            cboManagerLead.Text = e.Name;

            e.Load(moProj.RelationshipMngrID);
            cboRelationship.Text = e.Name;

            rs.Load(moProj.RateSchedID);
            cboRateSched.Text = rs.Name;
            if (rs.IsMultiplier == true)
            {
                lblMultiplier.Visible = true;
                txtMultiplier.Visible = true;
                txtMultiplier.Text    = moProj.Multiplier.ToString("#,##0.00");
                lblOverlay.Visible    = true;
                txtOverlay.Visible    = true;
                txtOverlay.Text       = moProj.Overlay.ToString("#,##0.00");
            }
            else
            {
                lblMultiplier.Visible = false;
                txtMultiplier.Visible = false;
                txtMultiplier.Text    = "0.00";
                lblOverlay.Visible    = false;
                txtOverlay.Visible    = false;
                txtOverlay.Text       = "0.00";
            }

            txtPOAmount.Text = moProj.POAmount;

            dtpStart.Value            = moProj.DateStart;
            dtpEnd.Value              = moProj.DateEnd;
            chkActiveProposal.Checked = moProj.IsProposal;
            chkIsBooked.Checked       = moProj.IsBooked;
            chkIsActive.Checked       = moProj.IsActive;
            chkIsGovernment.Checked   = moProj.IsGovernment;
            chkIsMaster.Checked       = moProj.IsMaster;
            chkIsFixedRate.Checked    = moProj.IsFixedRate;



            if (moProj.MasterID > 0)
            {
                cboMasterJobs.Text = CBProject.GetNumberByID(moProj.MasterID);
            }

            cboReportStatus.SelectedIndex = moProj.ReportingStatus;

            rtbNotes.Text = moProj.Notes;

            mdsBudget = CBProjectBudget.GetListDSByProjID(moProj.ID);
            tdbgBudget.SetDataBinding(mdsBudget, "Table", true);

            TotalBudget();

            RSLib.COSecurity sec = new RSLib.COSecurity();
            CBUser           u   = new CBUser();

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

            if (u.IsAdministrator == true || u.IsEngineerAdmin == true)
            {
                chkActiveProposal.Enabled = true;
                chkIsActive.Enabled       = true;
                chkIsBooked.Enabled       = true;
            }
        }
示例#16
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;
                }
            }
        }