protected void InterventionsGrid_OnDeleteCommand(Object sender, Telerik.Web.UI.GridCommandEventArgs eventArgs) { if (MercuryApplication == null) { return; } if (!(eventArgs.Item is Telerik.Web.UI.GridDataItem)) { return; } String carePlanGoalName = String.Empty; Client.Core.Individual.CarePlanGoal carePlanGoal = null; String carePlanInterventionName = String.Empty; Client.Core.Individual.CarePlanIntervention carePlanIntervention = null; // GET VALUES OUT OF THE DATA ITEM Telerik.Web.UI.GridDataItem dataItem = (Telerik.Web.UI.GridDataItem)eventArgs.Item; carePlanGoalName = (String)dataItem.GetDataKeyValue("CarePlanGoal.Name"); carePlanGoal = carePlan.CarePlanGoal(carePlanGoalName); if (carePlanGoal != null) { carePlanInterventionName = (String)dataItem.GetDataKeyValue("Name"); carePlanIntervention = carePlanGoal.CarePlanIntervention(carePlanInterventionName); if (carePlanIntervention != null) { carePlanGoal.Interventions.Remove(carePlanIntervention); } } InitializeInterventionsPage(); InterventionsGrid.Rebind(); return; }
protected void RadGrid1_DetailTableDataBind(object sender, Telerik.Web.UI.GridDetailTableDataBindEventArgs e) { Telerik.Web.UI.GridDataItem dataItem = (Telerik.Web.UI.GridDataItem)e.DetailTableView.ParentItem; int id = int.Parse(dataItem.GetDataKeyValue("ID").ToString()); e.DetailTableView.DataSource = GetMailScheduleHistoryDetail(id); }
protected void ProblemStatementsGrid_OnItemCommand(Object sender, Telerik.Web.UI.GridCommandEventArgs e) { Telerik.Web.UI.RadGrid grid = (Telerik.Web.UI.RadGrid)sender; Telerik.Web.UI.GridDataItem item = (Telerik.Web.UI.GridDataItem)e.Item; Mercury.Server.Application.MemberCaseModificationResponse response; Int64 memberCaseProblemCarePlanId = 0; switch (e.CommandName) { case "DeleteProblemStatement": memberCaseProblemCarePlanId = Convert.ToInt64(item.GetDataKeyValue("Id")); response = MercuryApplication.MemberCase_DeleteProblemStatement(Case, memberCaseProblemCarePlanId); Case = new Client.Core.Individual.Case.MemberCase(MercuryApplication, response.MemberCase); if (response.HasException) { ExceptionMessage = response.Exception.Message; } break; } return; }
protected void RadGrid1_DetailTableDataBind(object sender, Telerik.Web.UI.GridDetailTableDataBindEventArgs e) { System.Data.DataTable dt = (System.Data.DataTable)ViewState["GRID_DATA"]; Telerik.Web.UI.GridDataItem dataItem = (Telerik.Web.UI.GridDataItem)e.DetailTableView.ParentItem; string kdInduk = dataItem.GetDataKeyValue("KD_UNIT").ToString(); e.DetailTableView.DataSource = dt.Select("KD_PARENT = '" + kdInduk + "'"); }
void grid_ItemDataBound(object sender, Telerik.Web.UI.GridItemEventArgs e) { if (e.Item is Telerik.Web.UI.GridDataItem) { Telerik.Web.UI.GridDataItem item = (Telerik.Web.UI.GridDataItem)e.Item; Literal litAttributes = (Literal)item.FindControl("litAttributes"); if (litAttributes != null) { int productId = Convert.ToInt32(item.GetDataKeyValue("ProductId")); string attributesXml = item.GetDataKeyValue("AttributesXml").ToString(); string results = string.Empty; if (!string.IsNullOrEmpty(attributesXml)) { var attributes = ProductAttributeParser.ParseProductAttributeMappings(customFields, attributesXml); if (attributes.Count > 0) { foreach (var a in attributes) { var values = ProductAttributeParser.ParseValues(attributesXml, a.CustomFieldId); if (values.Count > 0) { productProperties.ForEach(property => { if (property.ProductId == productId && property.CustomFieldId == a.CustomFieldId && values.Contains(property.CustomFieldOptionId)) { results += string.Format("<div><span>{0}</span>: {1}</div>", a.Name, property.OptionName); } }); } } } } if (results.Length > 0) { litAttributes.Text = string.Format("<div class='attributes'>{0}</div>", results); } } } }
protected void rgHistoryGrid_DetailTableDataBind(object sender, Telerik.Web.UI.GridDetailTableDataBindEventArgs e) { Telerik.Web.UI.GridDataItem dataItem = (Telerik.Web.UI.GridDataItem)e.DetailTableView.ParentItem; if (e.DetailTableView.Name == "historyDetail") { string reqID = dataItem.GetDataKeyValue("reqId").ToString(); Business.university.Request.ProfessorRequestBusiness PRB = new Business.university.Request.ProfessorRequestBusiness(); e.DetailTableView.DataSource = PRB.getCustomizedProfessorEditedFields(Convert.ToInt32(reqID)); } }
protected void WorkQueueMonitorSummaryGrid_OnSelectedIndexChanged(Object sender, EventArgs e) { if (WorkQueueMonitorSummaryGrid.SelectedItems.Count == 0) { return; } Telerik.Web.UI.GridDataItem dataItem = (Telerik.Web.UI.GridDataItem)WorkQueueMonitorSummaryGrid.SelectedItems[0]; Int64 selectedWorkQueueId = Convert.ToInt64(dataItem.GetDataKeyValue("Id")); WorkQueueSelected = MercuryApplication.WorkQueueGet(selectedWorkQueueId, true); // LOAD QUEUE SUMMARY WorkQueueMonitorSummaryGrid.DataSource = MercuryApplication.WorkQueueMonitorSummary(); InitializeWorkQueueAgingChart(); return; }
protected void InterventionsGrid_OnItemCommand(Object sender, Telerik.Web.UI.GridCommandEventArgs eventArgs) { if (MercuryApplication == null) { return; } if (!(eventArgs.Item is Telerik.Web.UI.GridDataItem)) { return; } Int32 itemIndex = eventArgs.Item.DataSetIndex; String carePlanGoalName = String.Empty; Client.Core.Individual.CarePlanGoal carePlanGoal = null; String carePlanInterventionName = String.Empty; Client.Core.Individual.CarePlanIntervention carePlanIntervention = null; // GET VALUES OUT OF THE DATA ITEM Telerik.Web.UI.GridDataItem dataItem = (Telerik.Web.UI.GridDataItem)eventArgs.Item; carePlanGoalName = (String)dataItem.GetDataKeyValue("CarePlanGoal.Name"); carePlanGoal = carePlan.CarePlanGoal(carePlanGoalName); if (carePlanGoal != null) { carePlanInterventionName = (String)dataItem.GetDataKeyValue("Name"); carePlanIntervention = carePlanGoal.CarePlanIntervention(carePlanInterventionName); } switch (eventArgs.CommandName) { case "ToggleActive": if (carePlanIntervention != null) { carePlanIntervention.Enabled = !carePlanIntervention.Enabled; } break; case Telerik.Web.UI.RadGrid.EditCommandName: // MAKE COPY OF SELECTED ROW FOR EDITING EditCarePlanIntervention = carePlanIntervention.Copy(); // EditCarePlanIntervention = carePlan.Interventions[activityIndex].Copy (); // TODO: ASSIGN INTERVENTION MEMBERS eventArgs.Canceled = true; break; default: System.Diagnostics.Debug.WriteLine(eventArgs.CommandName); break; } InitializeInterventionsPage(); InterventionsGrid.Rebind(); InterventionsGrid.SelectedIndexes.Add(eventArgs.Item.ItemIndex); return; }