コード例 #1
0
        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;
            }
        }
コード例 #2
0
        protected void btnReject_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;

                switch (BudgetType)
                {
                case 0:
                    RejectInitialBudget();
                    versionNo = "1";
                    break;

                case 1:
                    RejectRevisedBudget();
                    RevisedBudget revBudget = new RevisedBudget(SessionManager.GetConnectionManager(this.Page));
                    revBudget.IdProject = currentProject.Id;
                    versionNo           = revBudget.GetVersionNumber(out isFake);
                    break;

                case 2:
                    RejectCompletionBudget();
                    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.DisapprovedBudget);
            }
            catch (IndException ex)
            {
                ReportControlError(ex);
                return;
            }
            catch (Exception ex)
            {
                ReportControlError(new IndException(ex));
                return;
            }

            //navigate back to followup
            ParentPage.ResponseRedirect("~/Pages/Budget/FollowUpBudget/FollowUpBudget.aspx?BudgetType=" + BudgetType + "&BudgetVersion=" + BudgetVersion);
        }
コード例 #3
0
ファイル: BudgetCategory.cs プロジェクト: durwood/Retire
        public BudgetCategory(BudgetType budgetType)
        {
            BudgetType = budgetType;
            var mainAndSub = budgetType.ToString().Split('_');

            MainCategory = mainAndSub[0];
            SubCategory  = mainAndSub.Length > 1 ? mainAndSub[1] : "";
        }
コード例 #4
0
        protected static string GetCachedToString(OrganizationId organizationId, BudgetType budgetType)
        {
            StringBuilder stringBuilder = new StringBuilder();

            stringBuilder.Append("oid~");
            stringBuilder.Append(organizationId.ToString());
            stringBuilder.Append("~");
            stringBuilder.Append(budgetType.ToString());
            return(stringBuilder.ToString());
        }
コード例 #5
0
 public static void Initialize(BudgetType budgetType, int?massOverBudgetPercent, bool allowReinitialize)
 {
     if (ThrottlingPerfCounterWrapper.PerfCountersInitialized && !allowReinitialize)
     {
         throw new InvalidOperationException(string.Format("ThrottlingPerformanceCounters were already initialized with budget type of '{0}'.", ThrottlingPerfCounterWrapper.budgetType));
     }
     if (massOverBudgetPercent != null && (massOverBudgetPercent.Value < 0 || massOverBudgetPercent.Value > 100))
     {
         throw new ArgumentOutOfRangeException("massOverBudgetPercent", massOverBudgetPercent.Value, "massOverBudgetPercent must be between 0 and 100 inclusive");
     }
     ThrottlingPerfCounterWrapper.budgetType = budgetType;
     ThrottlingPerfCounterWrapper.massiveNumberOfUsersOverBudgetPercent = ((massOverBudgetPercent != null) ? massOverBudgetPercent.Value : DefaultThrottlingAlertValues.MassUserOverBudgetPercent(budgetType));
     try
     {
         string instanceName = ThrottlingPerfCounterWrapper.GetInstanceName(budgetType.ToString());
         ThrottlingPerfCounterWrapper.throttlingPerfCounters     = MSExchangeThrottling.GetInstance(instanceName);
         ThrottlingPerfCounterWrapper.userThrottlingPerfCounters = MSExchangeUserThrottling.GetInstance(instanceName);
         ThrottlingPerfCounterWrapper.PerfCountersInitialized    = true;
     }
     catch (Exception ex)
     {
         ThrottlingPerfCounterWrapper.PerfCountersInitialized = false;
         Globals.LogEvent(DirectoryEventLogConstants.Tuple_InitializePerformanceCountersFailed, string.Empty, new object[]
         {
             ex.ToString()
         });
         ExTraceGlobals.ClientThrottlingTracer.TraceError <string, string>(0L, "[ThrottlingPerfCounterWrapper.Initialize] Perf counter initialization failed with exception type: {0}, Messsage: {1}", ex.GetType().FullName, ex.Message);
     }
     ThrottlingPerfCounterWrapper.budgetsMicroDelayed = new ExactTimeoutCache <BudgetKey, BudgetKey>(delegate(BudgetKey key, BudgetKey value, RemoveReason reason)
     {
         ThrottlingPerfCounterWrapper.UpdateBudgetsMicroDelayed();
     }, null, null, 1000000, false, CacheFullBehavior.ExpireExisting);
     ThrottlingPerfCounterWrapper.budgetsAtMaximumDelay = new ExactTimeoutCache <BudgetKey, BudgetKey>(delegate(BudgetKey key, BudgetKey value, RemoveReason reason)
     {
         ThrottlingPerfCounterWrapper.UpdateBudgetsAtMaxDelay();
     }, null, null, 1000000, false, CacheFullBehavior.ExpireExisting);
     ThrottlingPerfCounterWrapper.budgetsLockedOut = new ExactTimeoutCache <BudgetKey, BudgetKey>(delegate(BudgetKey key, BudgetKey value, RemoveReason reason)
     {
         ThrottlingPerfCounterWrapper.UpdateBudgetsLockedOut();
     }, null, null, 1000000, false, CacheFullBehavior.ExpireExisting);
     ThrottlingPerfCounterWrapper.budgetsOverBudget = new ExactTimeoutCache <BudgetKey, BudgetKey>(delegate(BudgetKey key, BudgetKey value, RemoveReason reason)
     {
         ThrottlingPerfCounterWrapper.UpdateOverBudget();
     }, null, null, 1000000, false, CacheFullBehavior.ExpireExisting);
     ThrottlingPerfCounterWrapper.budgetsAtMaxConcurrency = new HashSet <BudgetKey>();
 }
コード例 #6
0
        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);
        }
コード例 #7
0
        protected void btnReject_Click(object sender, EventArgs e)
        {
            try
            {
                switch (BudgetType)
                {
                case 0:
                    RejectInitialBudget();
                    break;

                case 1:
                    RejectRevisedBudget();
                    break;

                case 2:
                    RejectCompletionBudget();
                    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
            ParentPage.ResponseRedirect("~/Pages/Budget/FollowUpBudget/FollowUpBudget.aspx?BudgetType=" + BudgetType + "&BudgetVersion=" + BudgetVersion);
        }
コード例 #8
0
 // Token: 0x060073E5 RID: 29669 RVA: 0x0017DE54 File Offset: 0x0017C054
 private static void VerifyCorrectBudgetType(BudgetType budgetType)
 {
     if (budgetType != BudgetType.PowerShell && budgetType != BudgetType.WSMan && budgetType != BudgetType.WSManTenant)
     {
         throw new ArgumentException("PowerShell budgets can only be used with BudgetTypes PowerShell, WSMan and WSManTenant.  Passed Key: " + budgetType.ToString());
     }
 }
コード例 #9
0
        public string[] UpdateLeaveBudget_LeaveBudgetPage(string RuleGroupID, string Year, string StrObjLeaveBudget)
        {
            this.InitializeCulture();
            string[] RetMessage = new string[4];
            try
            {
                AttackDefender.CSRFDefender(this.Page);
                decimal ruleGroupID = decimal.Parse(this.StringBuilder.CreateString(RuleGroupID), CultureInfo.InvariantCulture);
                int     year        = int.Parse(this.StringBuilder.CreateString(Year), CultureInfo.InvariantCulture);
                StrObjLeaveBudget = this.StringBuilder.CreateString(StrObjLeaveBudget);
                Dictionary <string, object> ParamDic = (Dictionary <string, object>)JsSerializer.DeserializeObject(StrObjLeaveBudget);
                BudgetType       budgetType          = (BudgetType)Enum.Parse(typeof(BudgetType), ParamDic["LeaveBudgetType"].ToString());
                LeaveBudgetProxy leaveBudgetProxy    = new LeaveBudgetProxy();
                leaveBudgetProxy.BudgetType  = budgetType;
                leaveBudgetProxy.Description = ParamDic["Description"].ToString();
                switch (budgetType)
                {
                case BudgetType.Usual:
                    leaveBudgetProxy.TotoalDay  = ParamDic["YD"].ToString();
                    leaveBudgetProxy.TotoalTime = ParamDic["YH"].ToString();
                    break;

                case BudgetType.PerMonth:
                    leaveBudgetProxy.Day1   = ParamDic["MD1"].ToString();
                    leaveBudgetProxy.Time1  = ParamDic["MH1"].ToString();
                    leaveBudgetProxy.Day2   = ParamDic["MD2"].ToString();
                    leaveBudgetProxy.Time2  = ParamDic["MH2"].ToString();
                    leaveBudgetProxy.Day3   = ParamDic["MD3"].ToString();
                    leaveBudgetProxy.Time3  = ParamDic["MH3"].ToString();
                    leaveBudgetProxy.Day4   = ParamDic["MD4"].ToString();
                    leaveBudgetProxy.Time4  = ParamDic["MH4"].ToString();
                    leaveBudgetProxy.Day5   = ParamDic["MD5"].ToString();
                    leaveBudgetProxy.Time5  = ParamDic["MH5"].ToString();
                    leaveBudgetProxy.Day6   = ParamDic["MD6"].ToString();
                    leaveBudgetProxy.Time6  = ParamDic["MH6"].ToString();
                    leaveBudgetProxy.Day7   = ParamDic["MD7"].ToString();
                    leaveBudgetProxy.Time7  = ParamDic["MH7"].ToString();
                    leaveBudgetProxy.Day8   = ParamDic["MD8"].ToString();
                    leaveBudgetProxy.Time8  = ParamDic["MH8"].ToString();
                    leaveBudgetProxy.Day9   = ParamDic["MD9"].ToString();
                    leaveBudgetProxy.Time9  = ParamDic["MH9"].ToString();
                    leaveBudgetProxy.Day10  = ParamDic["MD10"].ToString();
                    leaveBudgetProxy.Time10 = ParamDic["MH10"].ToString();
                    leaveBudgetProxy.Day11  = ParamDic["MD11"].ToString();
                    leaveBudgetProxy.Time11 = ParamDic["MH11"].ToString();
                    leaveBudgetProxy.Day12  = ParamDic["MD12"].ToString();
                    leaveBudgetProxy.Time12 = ParamDic["MH12"].ToString();
                    break;
                }
                this.LeaveBudgetBusiness.SaveBudget(ruleGroupID, year, leaveBudgetProxy);
                RetMessage[0] = GetLocalResourceObject("RetSuccessType").ToString();
                RetMessage[1] = GetLocalResourceObject("LeaveBudgetAssignmentOperationCompleted").ToString();
                RetMessage[2] = "success";
                RetMessage[3] = budgetType.ToString();
                return(RetMessage);
            }
            catch (UIValidationExceptions ex)
            {
                RetMessage = this.exceptionHandler.HandleException(this.Page, ExceptionTypes.UIValidationExceptions, ex, RetMessage);
                return(RetMessage);
            }
            catch (UIBaseException ex)
            {
                RetMessage = this.exceptionHandler.HandleException(this.Page, ExceptionTypes.UIBaseException, ex, RetMessage);
                return(RetMessage);
            }
            catch (Exception ex)
            {
                RetMessage = this.exceptionHandler.HandleException(this.Page, ExceptionTypes.Exception, ex, RetMessage);
                return(RetMessage);
            }
        }