Пример #1
0
        private void tdbgHours_ComboSelect(object sender, C1.Win.C1TrueDBGrid.ColEventArgs e)
        {
            tdbgHours.UpdateData(); //******************Added 10/8/2015

            string acct = tdbgHours.Columns[0].Value.ToString().Substring(0, 2);

            for (int j = 0; j < i; j++)
            {
                string y = codes[j].Substring(0, 2);
                if (y.Equals(acct))
                {
                    test_Hour = true;
                    break;
                }
            }
            if (test_Hour == false)
            {
                int c = Convert.ToInt32(acct) * 1000;
                CBActivityCodeDisc.UpdateForProject(c, project_ID, true);
                mbIsCodeAdded = true;

                MessageBox.Show("This Expense isn't valid. Group will be Added in the budget " + c.ToString());
            }
            else
            {
                test_Hour = false;
            }
        }
Пример #2
0
        public void EditPreviousPCN(int pcnID)
        {
            ClearForm();

            moProj = new CBProject();
            moBudg = new CBBudget();

            moPCN.LoadWithData(pcnID);
            moProj.Load(moPCN.ProjectID);
            project_ID = moPCN.ProjectID;

            List <CBActivityCodeDisc> _Groups = CBActivityCodeDisc.GetAllForProject(project_ID).ToList();

            foreach (var group in _Groups)
            {
                codes[i] = group.Code;
                i++;
            }


            moBudg.LoadByProject(moProj.ID);

            LoadFromPCN();

            this.Text = "PCN: Job-" + moProj.Number + " PCN-" + moPCN.PCNNumber;

            SetPCNSecurityLevel();
            mbIsFixedRate = moProj.IsFixedRate;
            SetPCN_RateLevel();
        }
Пример #3
0
        public void StartNewPCN(int projID)
        {
            ClearForm();

            moProj = new CBProject();
            moProj.Load(projID);
            moPCN.PCNNumber = moPCN.GetNextPCNNumber(projID);
            moPCN.ProjectID = projID;

            lblProjectNumber.Text = moProj.Number;
            lblProjectTitle.Text  = moProj.Description;
            txtPCNNumber.Text     = moPCN.PCNNumber;

            this.Text = "PCN: Job-" + moProj.Number + " PCN-" + moPCN.PCNNumber;

            project_ID = moPCN.ProjectID;
            List <CBActivityCodeDisc> _Groups = CBActivityCodeDisc.GetAllForProject(project_ID).ToList();

            foreach (var group in _Groups)
            {
                codes[i] = group.Code;
                i++;
            }
            SetPCNSecurityLevel();
            mbIsFixedRate = moProj.IsFixedRate;
        }
Пример #4
0
        private void box_checked(object sender, EventArgs e)
        {
            CheckBox           box   = (CheckBox)sender;
            CBActivityCodeDisc group = (CBActivityCodeDisc)box.Tag;

            CBActivityCodeDisc.UpdateForProject((int)group.Code.ToInt(), ProjectID, box.Checked);
        }
Пример #5
0
        public CodeGroupSelector(int projet_id)
        {
            InitializeComponent();
            _Groups = CBActivityCodeDisc.GetAll().ToList();
            var project_codes = CBActivityCodeDisc.GetAllForProject(projet_id).Select(x => x.Code).ToList();
            var top           = 12;

            foreach (var group in _Groups)
            {
                CheckBox box = new CheckBox()
                {
                    Name      = "cb" + group.Code
                    , Checked = project_codes.Contains(group.Code)
                    , Text    = group.Code + " - " + group.Name
                    , Left    = 12
                    , Width   = 500
                    , Top     = top
                    , Tag     = group
                };
                top += box.Height;
                box.CheckedChanged += new EventHandler(box_checked);
                this.Controls.Add(box);
            }

            this.Height = top + 150;
            ProjectID   = projet_id;
        }
Пример #6
0
 public FWS(CBActivityCodeDisc group, bool show_specification = true)
 {
     _Group = group;
     InitializeComponent();
     this.Text      = "FWS" + group.Code;
     groupBox1.Text = _Group.Code + " Specifications and Procurement";
     if (!show_specification)
     {
         groupBox1.Visible = false;
         this.Height       = this.Height - groupBox1.Height;
     }
     //   this.WindowState = FormWindowState.Maximized;
 }
Пример #7
0
        private void LoadSortList()
        {
            RevSol.RSListItem li;

            lstSorts.Items.Clear();

            li             = new RevSol.RSListItem();
            li.ID          = 0;
            li.Description = "Engineering Disciplines";
            lstSorts.Items.Add(li);

            li             = new RevSol.RSListItem();
            li.ID          = 2;
            li.Description = "Engineering Summary";
            lstSorts.Items.Add(li);

            li             = new RevSol.RSListItem();
            li.ID          = 3;
            li.Description = "Pipeline Disciplines";
            lstSorts.Items.Add(li);

            li             = new RevSol.RSListItem();
            li.ID          = 4;
            li.Description = "Pipeline Summary";
            lstSorts.Items.Add(li);

            var groups = CBActivityCodeDisc.GetAll().ToList();

            foreach (var group in groups)
            {
                li             = new RevSol.RSListItem();
                li.ID          = Int32.Parse(group.Code);
                li.Description = group.Name;
                lstSorts.Items.Add(li);
            }

            li             = new RevSol.RSListItem();
            li.ID          = 1;
            li.Description = "Total Proj. by PM";
            lstSorts.Items.Add(li);


            lstSorts.SelectedIndex = 0;
        }
Пример #8
0
        public void CopyPCN(int projID, int pcnID)
        {
            ClearForm();

            moProj = new CBProject();
            moBudg = new CBBudget();

            moPCN.LoadWithCopyData(pcnID);

            moProj.Load(moPCN.ProjectID);
            moBudg.LoadByProject(moProj.ID);

            LoadFromPCN();

            this.Text = "PCN: Job-" + moProj.Number + " PCN-" + moPCN.PCNNumber;

            moProj.Load(projID);
            moPCN.PCNNumber = moPCN.GetNextPCNNumber(projID);
            moPCN.ProjectID = projID;

            lblProjectNumber.Text = moProj.Number;
            lblProjectTitle.Text  = moProj.Description;
            txtPCNNumber.Text     = moPCN.PCNNumber;
            this.Text             = "PCN: Job-" + moProj.Number + " PCN-" + moPCN.PCNNumber;
            project_ID            = moPCN.ProjectID;
            List <CBActivityCodeDisc> _Groups = CBActivityCodeDisc.GetAllForProject(project_ID).ToList();

            foreach (var group in _Groups)
            {
                codes[i] = group.Code;
                i++;
            }

            SetPCNSecurityLevel();
            mbIsFixedRate = moProj.IsFixedRate;
            SetPCN_RateLevel();
        }
Пример #9
0
        private void tdbdDeptGroup_MouseLeave(object sender, EventArgs e)
        {
            string Dept = tdbgExpenses.Columns[2].Value.ToString();

            for (int j = 0; j < i; j++)
            {
                string y = codes[j];

                if (y.Equals(Dept))
                {
                    test_Expense = true;
                    // MessageBox.Show("Match");
                    break;
                }
            }
            if (test_Expense == false)
            {
                int D;
                if (Dept == "")
                {
                    D = 11000;
                }
                else
                {
                    D = Convert.ToInt32(Dept);               //*********************************************Expection is happening here,,,, I have to check it!!!!!!!!!!!!
                }
                // **************** Default Dept is 11000
                CBActivityCodeDisc.UpdateForProject(D, project_ID, true);
                mbIsCodeAdded = true;
                MessageBox.Show("This Department is not part of the current budget.  It will be Added in the budget." + Dept);
            }
            else
            {
                test_Expense = false;
            }
        }