private void UpdateDifference() { if (Context != null && Context.WeeklyWorldState != null && Context.WeeklyWorldState.StoreWorldInfo != null) { if (!Context.WeeklyWorldState.StoreWorldInfo.IsCashDesk) { lblDifference.Visible = true; StoreWorldPlanningInfo stinfo = Context.WeeklyWorldState.StoreWorldInfo as StoreWorldPlanningInfo; if (stinfo != null) { int targetedHour = stinfo.GetTargetValue(ViewDate.DayOfWeek); int plannedHour = m_dailyView.TotalPlannedWorkingHours; int diff = plannedHour - targetedHour; double diffPercent = (targetedHour != 0)?(100 / (double)targetedHour) * plannedHour - 100:0; lblDifference.Text = GetLocalized("Difference") + " " + String.Format("{0} / {1:F2}%", TextParser.TimeToString(diff), diffPercent); } } else { lblDifference.Visible = false; } } }
protected void UpdatePersonMinMaxInfo() { if (Context == null) { ClearWorldInfo(); } else { if (Context.WeeklyWorldState != null && Context.WeeklyWorldState.StoreWorldInfo != null) { WorldPlanningInfo winfo = Context.WeeklyWorldState.StoreWorldInfo; if (winfo.IsCashDesk) { panelControlWorldInfo.Visible = false; } else { panelControlWorldInfo.Visible = true; lblMinimumPresence.Text = GetLocalized("MinimumPresence") + " " + winfo.MinimumPresence.ToString(); lblMaximumPresence.Text = GetLocalized("MaximumPresence") + " " + winfo.MaximumPresence.ToString(); StoreWorldPlanningInfo stinfo = winfo as StoreWorldPlanningInfo; lblTargetedHours.Text = GetLocalized("TargetedHours") + " " + TextParser.TimeToString(stinfo.GetTargetValue(ViewDate.DayOfWeek)); } } else { ClearWorldInfo(); } } }