protected override void BaseSecure(Security config) { var write = Operations.Write; var closed = new BudgetStates(this.Session).Closed; config.Deny(this.ObjectType, closed, write); }
protected void btnSubmit_Click(object sender, EventArgs e) { try { string budgetNextState = BudgetStates.GetBudgetNextState(BudgetState); switch (BudgetType) { case 0: SubmitInitialBudget(budgetNextState); break; case 1: SubmitRevisedBudget(budgetNextState); break; case 2: SubmitCompletionBudget(budgetNextState); break; default: throw new IndException("Unknown budget type: " + BudgetType.ToString()); } } catch (IndException ex) { ReportControlError(ex); return; } catch (Exception ex) { ReportControlError(new IndException(ex)); return; } }
protected void btnApprove_Click(object sender, EventArgs e) { try { TrackingActivityLog tkl = new TrackingActivityLog(SessionManager.GetConnectionManager(this.Page)); CurrentUser currentUser = SessionManager.GetSessionValueRedirect(this.Page, SessionStrings.CURRENT_USER) as CurrentUser; //if (currentUser.UserRole.Id == ApplicationConstants.ROLE_BUSINESS_ADMINISTATOR || currentUser.UserRole.Id == ApplicationConstants.ROLE_KEY_USER) //{ // currentUser.IdProjectFunctionImpersonated = ApplicationConstants.INT_NULL_VALUE; //} CurrentProject currentProject = SessionManager.GetSessionValueRedirect(this.Page, SessionStrings.CURRENT_PROJECT) as CurrentProject; bool isFake; string versionNo; string budgetNextState = BudgetStates.GetBudgetNextState(BudgetState); switch (BudgetType) { case 0: ApproveInitialBudget(budgetNextState); versionNo = "1"; break; case 1: ApproveRevisedBudget(budgetNextState); RevisedBudget revBudget = new RevisedBudget(SessionManager.GetConnectionManager(this.Page)); revBudget.IdProject = currentProject.Id; versionNo = revBudget.GetVersionNumber(out isFake); break; case 2: ApproveCompletionBudget(budgetNextState); ReforecastBudget refBudget = new ReforecastBudget(SessionManager.GetConnectionManager(this.Page)); refBudget.IdProject = currentProject.Id; versionNo = refBudget.GetVersionNumber(out isFake); break; default: throw new IndException("Unknown budget type: " + BudgetType.ToString()); } if (!string.IsNullOrEmpty(versionNo)) { currentProject.IdVersion = int.Parse(versionNo); } tkl.InsertTrackingActivityLog(currentProject, currentUser, ETrackingActivity.ApprovedBudget); } catch (IndException ex) { ReportControlError(ex); return; } catch (Exception ex) { ReportControlError(new IndException(ex)); return; } //navigate back to followup - Do not put this in try!!!! ParentPage.ResponseRedirect("~/Pages/Budget/FollowUpBudget/FollowUpBudget.aspx?BudgetType=" + BudgetType + "&BudgetVersion=" + BudgetVersion); }
protected void btnApprove_Click(object sender, EventArgs e) { try { string budgetNextState = BudgetStates.GetBudgetNextState(BudgetState); switch (BudgetType) { case 0: ApproveInitialBudget(budgetNextState); break; case 1: ApproveRevisedBudget(budgetNextState); break; case 2: ApproveCompletionBudget(budgetNextState); break; default: throw new IndException("Unknown budget type: " + BudgetType.ToString()); } } catch (IndException ex) { ReportControlError(ex); return; } catch (Exception ex) { ReportControlError(new IndException(ex)); return; } //navigate back to followup - Do not put this in try!!!! ParentPage.ResponseRedirect("~/Pages/Budget/FollowUpBudget/FollowUpBudget.aspx?BudgetType=" + BudgetType + "&BudgetVersion=" + BudgetVersion); }