private void DeleteBudgetRows_ToCompletion()
        {
            GridTableView          grdTableVw     = grdFollowUpBudget.MasterTableView;
            GridDataItemCollection itemCollection = grdTableVw.Items;

            foreach (GridItem gridItem in itemCollection)
            {
                if (!(gridItem is GridEditableItem))
                {
                    continue;
                }
                GridEditableItem item = gridItem as GridEditableItem;

                CheckBox chkSelected = item["SelectBudgetCol"].FindControl("chkDeleteCol") as CheckBox;
                if (chkSelected == null)
                {
                    continue;
                }
                if (!chkSelected.Checked)
                {
                    continue;
                }
                int idAssociate = ApplicationConstants.INT_NULL_VALUE;
                int.TryParse(item["IdAssociate"].Text, out idAssociate);

                FollowUpCompletionBudget followUpCompletionBudget = new FollowUpCompletionBudget(SessionManager.GetSessionValueNoRedirect(this.Page, SessionStrings.CONNECTION_MANAGER));
                followUpCompletionBudget.DeleteBudgetRows(currentProject.Id, idAssociate, ReturnBudgetVersionFromCombo());
            }
        }
        private void LoadGrid_ToCompletion()
        {
            DataSet dsCompletionBudget = null;
            FollowUpCompletionBudget flpCompletionBudget = new FollowUpCompletionBudget(SessionManager.GetSessionValueNoRedirect(this, SessionStrings.CONNECTION_MANAGER));

            string budgetVersion = ReturnBudgetVersionFromCombo();

            flpCompletionBudget.BudVersion = budgetVersion;
            flpCompletionBudget.IdProject  = currentProject.Id;
            dsCompletionBudget             = flpCompletionBudget.GetAll(true);

            if (dsCompletionBudget != null)
            {
                if (dsCompletionBudget.Tables[0].Rows.Count > 0)
                {
                    grdFollowUpBudget.DataSource = dsCompletionBudget.Tables[0];
                    grdFollowUpBudget.DataBind();

                    //Set Validation enable state only for PM
                    if (IsBATAOrPM(currentUser))
                    {
                        ButtonValid = IsBudgetValidateable(dsCompletionBudget);
                    }
                }
                else
                {
                    LoadGridNull();
                    ButtonValid = false;
                    throw new IndException(string.Format(ApplicationMessages.EXCEPTION_BUDGET_COMPLETION_MISSING_FOR_VERSION, cmbVersions.SelectedItem.Text, cmbType.SelectedItem.Text));
                }
            }
        }
        private bool GetBudgetIsValidState_ToCompletion()
        {
            FollowUpCompletionBudget followUpCompletionBudget = new FollowUpCompletionBudget(SessionManager.GetSessionValueNoRedirect(this.Page, SessionStrings.CONNECTION_MANAGER));

            followUpCompletionBudget.IdProject  = ProjectId;
            followUpCompletionBudget.BudVersion = ReturnBudgetVersionFromCombo();
            return(followUpCompletionBudget.GetCompletionBudgetValidState("GetCompletionScalarValidState"));
        }
        private void ValidateToCompletionBudget()
        {
            object conMan = SessionManager.GetConnectionManager(this);
            FollowUpCompletionBudget followUpCompletion = new FollowUpCompletionBudget(conMan);

            followUpCompletion.IdProject  = ProjectId;
            followUpCompletion.BudVersion = ApplicationConstants.BUDGET_VERSION_IN_PROGRESS_CODE;

            followUpCompletion.ValidateCompletionBudget("ValidateCompletionBudget");
            cmbVersions.FindItemByText(EBudgetVersion.Released.ToString()).Selected = true;
        }
        private void SubmitCompletionBudget(string budgetNextState)
        {
            FollowUpCompletionBudget followUpCompBud = new FollowUpCompletionBudget(SessionManager.GetSessionValueNoRedirect(this.Page, SessionStrings.CONNECTION_MANAGER));

            followUpCompBud.IdProject   = IdProject;
            followUpCompBud.BudVersion  = BudgetVersion;
            followUpCompBud.IdAssociate = IdAssociate;
            followUpCompBud.StateCode   = budgetNextState;

            followUpCompBud.SetModified();

            int ret = followUpCompBud.Save();

            SubmitVisible = false;
        }
        /// <summary>
        /// Method for PM to reject completion budget
        /// </summary>
        private void RejectCompletionBudget()
        {
            FollowUpCompletionBudget followUpCompBud = new FollowUpCompletionBudget(SessionManager.GetSessionValueNoRedirect(this.Page, SessionStrings.CONNECTION_MANAGER));

            followUpCompBud.IdProject   = IdProject;
            followUpCompBud.BudVersion  = BudgetVersion;
            followUpCompBud.IdAssociate = IdAssociate;
            followUpCompBud.StateCode   = ApplicationConstants.BUDGET_STATE_OPEN;

            followUpCompBud.SetModified();
            int ret = followUpCompBud.Save();

            SubmitVisible   = false;
            ApprovedVisible = false;
            RejectVisible   = false;
        }
        private void MoveBudgetRows_ToCompletion()
        {
            GridTableView          grdTableVw     = grdMoveBudget.MasterTableView;
            GridDataItemCollection itemCollection = grdTableVw.Items;

            foreach (GridItem gridItem in itemCollection)
            {
                int idAssociateNM = GetIdAssociateNM(gridItem);

                if (idAssociateNM == ApplicationConstants.INT_NULL_VALUE)
                {
                    continue;
                }
                else
                {
                    FollowUpCompletionBudget followUpCompletionBudget = new FollowUpCompletionBudget(SessionManager.GetSessionValueNoRedirect(this.Page, SessionStrings.CONNECTION_MANAGER));
                    followUpCompletionBudget.MoveCompletionBudget(currentProject.Id, GetIdAssociateLM(), idAssociateNM, SessionManager.GetCurrentUser(this).IdAssociate);
                    btnMoveBudget.Visible = false;
                }
            }
        }
Пример #8
0
        private void MoveBudgetRows_ToCompletion()
        {
            int moveReleased = 0;

            GridTableView          grdTableVw     = grdMoveBudget.MasterTableView;
            GridDataItemCollection itemCollection = grdTableVw.Items;

            ReforecastBudget reforecastBudget = new ReforecastBudget(SessionManager.GetConnectionManager(this));

            reforecastBudget.IdProject = currentProject.Id;
            object lastRevisedValidatedVersion = reforecastBudget.GetLastValidatedVersion();

            if (lastRevisedValidatedVersion != null && int.Parse(lastRevisedValidatedVersion.ToString()) > 0)
            {
                moveReleased = 1;
            }

            foreach (GridItem gridItem in itemCollection)
            {
                int idAssociateNM = GetIdAssociateNM(gridItem);

                if (idAssociateNM == ApplicationConstants.INT_NULL_VALUE)
                {
                    continue;
                }
                else
                {
                    FollowUpCompletionBudget followUpCompletionBudget = new FollowUpCompletionBudget(SessionManager.GetSessionValueNoRedirect(this.Page, SessionStrings.CONNECTION_MANAGER));
                    if (moveReleased == 0)
                    {
                        followUpCompletionBudget.MoveCompletionBudget(currentProject.Id, GetIdAssociateLM(), idAssociateNM, SessionManager.GetCurrentUser(this).IdAssociate);
                    }
                    else
                    {
                        followUpCompletionBudget.MoveCompletionBudgetReleasedVersion(currentProject.Id, GetIdAssociateLM(), idAssociateNM, SessionManager.GetCurrentUser(this).IdAssociate);
                    }
                    btnMoveBudget.Visible = false;
                }
            }
        }