예제 #1
0
 protected void MF_Use(object sender, EventArgs e)
 {
     SelPiID           = MF.SelectedPerformanceIndicators;
     SelCollectorUseID = MF.SelectedDataCollector;
     SelMetricID       = MF.SelectedMetrics;
     SelGcaID          = MF.SelectedGroupCategoryAspect;
     SelOrgLocationsID = MF.SelectedOrgLocations;
     ShiftDates.Clear();
 }
예제 #2
0
        protected void rapFrequency_AjaxRequest(object sender, Telerik.Web.UI.AjaxRequestEventArgs e)
        {
            string Command = e.Argument;

            if (string.IsNullOrEmpty(Command) || Command.Length < 3)
            {
                return;
            }

            if (Command[0] != 'L' && Command[0] != 'R')
            {
                return;
            }

            string[] array = Command.Split('|');
            if (array != null)
            {
                if (array.Length == 3)
                {
                    int step = array[0] == "L" ? 1 : -1;

                    int FrequencyID;
                    if (!int.TryParse(array[1], out FrequencyID))
                    {
                        return;
                    }

                    Guid EntityID = Guid.Empty;
                    try { EntityID = new Guid(array[2]); }
                    catch { }

                    MetricValue.ShiftDate sd = new MetricValue.ShiftDate
                    {
                        FrequencyID = FrequencyID,
                        StartDate   = MetricTrac.Bll.Frequency.AddPeriod(Frequency.GetNormalizedDate(FrequencyID, CurrentDate), FrequencyID, step),
                        EntityID    = EntityID
                    };
                    bool ExistShift = false;
                    foreach (MetricValue.ShiftDate s in ShiftDates)
                    {
                        if (s.FrequencyID == sd.FrequencyID && s.EntityID == sd.EntityID)
                        {
                            ExistShift  = true;
                            s.StartDate = MetricTrac.Bll.Frequency.AddPeriod(s.StartDate, FrequencyID, step);
                            break;
                        }
                    }
                    if (!ExistShift)
                    {
                        ShiftDates.Add(sd);
                    }
                }
            }
        }