protected void rpMetric_ItemDataBound(object sender, RepeaterItemEventArgs e) { if (e.Item.ItemType < ListItemType.Item || e.Item.ItemType > ListItemType.EditItem) { return; } LastMetricOrgValue = (MetricTrac.Bll.DistinctMetricOrgValue)e.Item.DataItem; BindRepiter("rDate", LastMetricOrgValue.DatesHeader, e); Bll.FrequencyMetricOrgLocationID curFrequencyMetricOrgLocationID = new MetricTrac.Bll.FrequencyMetricOrgLocationID(); curFrequencyMetricOrgLocationID.FrequencyID = LastFrequencyMetric.FrequencyID; curFrequencyMetricOrgLocationID.MetricID = LastMetricOrgValue.MetricID; curFrequencyMetricOrgLocationID.OrgLocationID = LastMetricOrgValue.OrgLocationID; SetNavigationButton(e, curFrequencyMetricOrgLocationID); BindRepiter("rMericValue", LastMetricOrgValue.MetricValues, e); }
// ---- AJAX request -------------------- protected void rapFrequency_AjaxRequest(object sender, Telerik.Web.UI.AjaxRequestEventArgs e) { string Command = e.Argument; if (string.IsNullOrEmpty(Command) || Command.Length < 3) { return; } string[] ArgArray = Command.Split('|'); if (ArgArray.Length < 7) { return; } if (Command[0] != 'L' && Command[0] != 'R') { return; } int step = Command[0] == 'L' ? 1 : -1; int FrequencyID; if (!int.TryParse(ArgArray[1], out FrequencyID)) { return; } Bll.FrequencyMetricOrgLocationID CurTriplet = new MetricTrac.Bll.FrequencyMetricOrgLocationID(); CurTriplet.FrequencyID = FrequencyID; try { Guid MetricID = new Guid(ArgArray[2]); Guid OrgLocationID = new Guid(ArgArray[3]); CurTriplet.MetricID = MetricID; CurTriplet.OrgLocationID = OrgLocationID; DateTime PreviousDate = DateTime.Parse(ArgArray[4]); DateTime NextDate = DateTime.Parse(ArgArray[5]); bool IsNextValues = bool.Parse(ArgArray[6]); DateTime NewDate = step > 0 ? NextDate : PreviousDate; if (!IsNextValues && (step > 0)) { if (FrequencyFirstDate.Keys.Contains(CurTriplet)) { FrequencyFirstDate.Remove(CurTriplet); } } else { if (FrequencyFirstDate.Keys.Contains(CurTriplet)) { FrequencyFirstDate[CurTriplet] = NewDate; } else { FrequencyFirstDate.Add(CurTriplet, NewDate); } } } catch { return; } }