protected void CarePlanInterventionGrid_OnNeedDataSource(Object sender, Telerik.Web.UI.GridNeedDataSourceEventArgs e) { Telerik.Web.UI.RadGrid carePlanInterventionGrid = (Telerik.Web.UI.RadGrid)sender; Telerik.Web.UI.RadListViewDataItem selectedCarePlanDataItem = (Telerik.Web.UI.RadListViewDataItem)carePlanInterventionGrid.Parent; Int32 selectedCarePlanIndex = selectedCarePlanDataItem.DataItemIndex; Telerik.Web.UI.RadListView carePlanInterventionListView = (Telerik.Web.UI.RadListView)selectedCarePlanDataItem.Parent.Parent; List <Client.Core.Individual.Case.MemberCaseProblemCarePlan> problemCarePlans = (List <Client.Core.Individual.Case.MemberCaseProblemCarePlan>)carePlanInterventionListView.DataSource; switch (e.RebindReason) { case Telerik.Web.UI.GridRebindReason.InitialLoad: // carePlanInterventionGrid.DataSource = problemCarePlans[selectedCarePlanIndex].CarePlan.Interventions; break; case Telerik.Web.UI.GridRebindReason.PostBackEvent: break; } return; }
protected void MemberCaseCarePlanListViewProblemsGrid_OnNeedDataSource(Object sender, Telerik.Web.UI.GridNeedDataSourceEventArgs e) { Telerik.Web.UI.RadGrid MemberCaseCarePlanListViewProblemsGrid = (Telerik.Web.UI.RadGrid)sender; Telerik.Web.UI.RadListViewDataItem listViewDataItem = (Telerik.Web.UI.RadListViewDataItem)MemberCaseCarePlanListViewProblemsGrid.Parent; Int32 selectedMemberCaseCarePlanIndex = listViewDataItem.DataItemIndex; Client.Core.Individual.Case.MemberCaseCarePlan selectedMemberCaseCarePlan = CarePlansDataSource[selectedMemberCaseCarePlanIndex]; switch (e.RebindReason) { case Telerik.Web.UI.GridRebindReason.InitialLoad: case Telerik.Web.UI.GridRebindReason.ExplicitRebind: case Telerik.Web.UI.GridRebindReason.PostBackEvent: MemberCaseCarePlanListViewProblemsGrid.DataSource = selectedMemberCaseCarePlan.Problems; break; } return; }
public System.Data.DataTable GetDataTable(Object obj) { Telerik.Web.UI.RadGrid grd = (Telerik.Web.UI.RadGrid)obj; System.Data.DataTable dtRecords = new System.Data.DataTable(); foreach (Telerik.Web.UI.GridColumn col in grd.Columns) { if (col.ColumnType == "GridBoundColumn" || col.ColumnType == "GridDateTimeColumn") { System.Data.DataColumn colString = new System.Data.DataColumn(col.UniqueName); dtRecords.Columns.Add(colString); } } foreach (Telerik.Web.UI.GridDataItem row in grd.Items) { System.Data.DataRow dr = dtRecords.NewRow(); foreach (Telerik.Web.UI.GridColumn col in grd.Columns) { if (col.ColumnType == "GridBoundColumn" || col.ColumnType == "GridDateTimeColumn") { dr[col.UniqueName] = row[col.UniqueName].Text; } } dtRecords.Rows.Add(dr); } return(dtRecords); }
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 gridSelectFirstRow(Telerik.Web.UI.RadGrid grid) { if (grid.Items.Count > 0) { if (grid.SelectedItems.Count == 0) { grid.MasterTableView.Items[0].Selected = true; grid.SelectedIndexes.Add(0); } } }
public void LlenaGrid(DataSet ds, Telerik.Web.UI.RadGrid Grid, string Idioma) { if (Idioma == "es-GT") { Grid.Culture = new CultureInfo("es-PE"); } else if (Idioma == "en-US") { Grid.Culture = new CultureInfo("en-US"); } Grid.DataSource = ds; }
protected void CarePlanGoalGrid_OnItemCommand(Object sender, Telerik.Web.UI.GridCommandEventArgs e) { Telerik.Web.UI.RadGrid carePlanGoalGrid = (Telerik.Web.UI.RadGrid)sender; if (carePlanGoalGrid == null) { return; } Telerik.Web.UI.RadListViewDataItem selectedCarePlanDataItem = (Telerik.Web.UI.RadListViewDataItem)carePlanGoalGrid.Parent; Int32 selectedCarePlanIndex = selectedCarePlanDataItem.DataItemIndex; Telerik.Web.UI.RadListView carePlanGoalListView = (Telerik.Web.UI.RadListView)selectedCarePlanDataItem.Parent.Parent; List <Client.Core.Individual.Case.MemberCaseProblemCarePlan> problemCarePlans = (List <Client.Core.Individual.Case.MemberCaseProblemCarePlan>)carePlanGoalListView.DataSource; switch (e.CommandName) { case "InitInsert": break; case "RebindGrid": carePlanGoalGrid.DataSource = null; carePlanGoalGrid.DataBind(); break; case "Delete": Int64 memberCaseCarePlanId = Convert.ToInt64(e.Item.OwnerTableView.DataKeyValues[e.Item.ItemIndex]["MemberCaseCarePlanId"]); Int64 memberCaseCarePlanGoalId = Convert.ToInt64(e.Item.OwnerTableView.DataKeyValues[e.Item.ItemIndex]["Id"]); // problemCarePlans[selectedCarePlanIndex].CarePlan.Goals.RemoveAt (e.Item.ItemIndex); carePlanGoalGrid.DataSource = null; carePlanGoalGrid.DataBind(); break; default: System.Diagnostics.Debug.WriteLine("Item Command: " + e.CommandName); break; } return; }
public void ConsultaPermisosUsuario(Permiso permiso, string conexion, ref Telerik.Web.UI.RadGrid RadGrid) { try { System.Collections.Generic.List <Permiso> Lista = new System.Collections.Generic.List <Permiso>(); CapaDatos.CD_PermisosU claseCapaDatos = new CapaDatos.CD_PermisosU(); claseCapaDatos.ConsultaPermisosUsuario(permiso, conexion, ref Lista); if (Lista.Count > 0) { RadGrid.DataSource = Lista; RadGrid.DataBind(); } } catch (Exception ex) { throw ex; } }
public void ConsultaPermisosCtrlTU(Permiso permiso, string Conexion, ref Telerik.Web.UI.RadGrid RadGrid) { try { List <Permiso> Lista = new List <Permiso>(); CapaDatos.CD_PermisosTU claseCapaDatos = new CapaDatos.CD_PermisosTU(); claseCapaDatos.ConsultaPermisosCtrlTU(permiso, Conexion, ref Lista); if (Lista.Count > 0) { RadGrid.DataSource = Lista; RadGrid.DataBind(); } } catch (Exception ex) { throw ex; } }
private bool UpdateRelatedProducts(Telerik.Web.UI.RadGrid grid, bool isRemove = false) { if (productGuid == Guid.Empty) { return(false); } bool isUpdated = false; foreach (Telerik.Web.UI.GridDataItem data in grid.SelectedItems) { Guid itemGuid2 = new Guid(data.GetDataKeyValue("ProductGuid").ToString()); if (!isRemove) { RelatedItem relatedItem = new RelatedItem(); relatedItem.SiteGuid = siteSettings.SiteGuid; relatedItem.ItemGuid1 = productGuid; relatedItem.ItemGuid2 = itemGuid2; relatedItem.Save(); } else { RelatedItem.Delete(productGuid, itemGuid2); } isUpdated = true; } if (isUpdated) { //message.SuccessMessage = Resource.UpdateSuccessMessage; gridRelated.Rebind(); } return(true); }
public void InsertarTipoUsuario(TipoUsuario tipoUsuario, string conexion, ref Telerik.Web.UI.RadGrid RadGrid, ref int Item) { try { System.Collections.Generic.List <Permiso> Lista = new System.Collections.Generic.List <Permiso>(); CapaDatos.CD_CatTiposUsuario claseCapaDatos = new CapaDatos.CD_CatTiposUsuario(); claseCapaDatos.InsertarTipoUsuario(ref tipoUsuario, conexion, ref Lista); if (Lista.Count > 1) { RadGrid.DataSource = Lista; RadGrid.DataBind(); Item = 1; } else { Item = 0; } } catch (Exception ex) { throw ex; } }
protected void dtUsuarios_ItemDataBound(object sender, DataListItemEventArgs e) { Fechas fechas = new Fechas(); Telerik.Web.UI.RadHtmlChart grafica = (Telerik.Web.UI.RadHtmlChart)e.Item.FindControl("DonutChartUsuario") as Telerik.Web.UI.RadHtmlChart; Telerik.Web.UI.RadGrid radGridAltaUser = (Telerik.Web.UI.RadGrid)e.Item.FindControl("radGridAltaUser") as Telerik.Web.UI.RadGrid; Telerik.Web.UI.RadGrid radGridBajasUser = (Telerik.Web.UI.RadGrid)e.Item.FindControl("radGridBajasUser") as Telerik.Web.UI.RadGrid; Telerik.Web.UI.RadGrid radGridBajasInmediatasUser = (Telerik.Web.UI.RadGrid)e.Item.FindControl("radGridBajasInmediatasUser") as Telerik.Web.UI.RadGrid; Telerik.Web.UI.RadTabStrip RadTabStrip1 = (Telerik.Web.UI.RadTabStrip)e.Item.FindControl("RadTabStrip1") as Telerik.Web.UI.RadTabStrip; Telerik.Web.UI.RadMultiPage RadMultiPage1 = (Telerik.Web.UI.RadMultiPage)e.Item.FindControl("RadMultiPage1") as Telerik.Web.UI.RadMultiPage; Label lblIdUsuario = (Label)e.Item.FindControl("lblIdUsuario") as Label; string usuario = lblIdUsuario.Text; Datos datos = new Datos(); int empresa = 0; try { empresa = Convert.ToInt32(Session["e"]); } catch (Exception) { Response.Redirect("Default.aspx"); } DataTable dtA = new DataTable(); DataTable dtB = new DataTable(); DataTable dtBI = new DataTable(); DateTime fecha_inicio; DateTime fecha_final; string periodo = ddlPeriodo.SelectedValue; Label[] periodos = { Label1, Label2, Label3, Label4, Label5, Label6, Label7, Label8, Label9, Label10, Label11, Label12 }; string año = ddlAños.SelectedValue; string periodo_indicado = "1"; if (año == "") { año = fechas.obtieneFechaLocal().Year.ToString(); } if (periodo == "0") { fecha_inicio = Convert.ToDateTime("01/" + periodo_indicado.PadLeft(2, '0') + "/" + año); fecha_final = fecha_inicio.AddYears(1); fecha_final = fecha_final.AddDays(-1); } else { fecha_inicio = Convert.ToDateTime("01/" + periodo.PadLeft(2, '0') + "/" + año); fecha_final = fecha_inicio.AddMonths(1); fecha_final = fecha_final.AddDays(-1); } dtA = datos.obtieneInformacionAltaUsuarios(usuario, empresa.ToString(), fecha_inicio, fecha_final); radGridAltaUser.DataSource = dtA; radGridAltaUser.DataBind(); dtB = datos.obtieneInformacionBajasUsuarios(usuario, empresa.ToString(), fecha_inicio, fecha_final); radGridBajasUser.DataSource = dtB; radGridBajasUser.DataBind(); dtBI = datos.obtieneInformacionBajasInmeditasUsuarios(usuario, empresa.ToString(), fecha_inicio, fecha_final); radGridBajasInmediatasUser.DataSource = dtBI; radGridBajasInmediatasUser.DataBind(); int altas = dtA.Rows.Count; int bajas = dtB.Rows.Count; int bajasInm = dtBI.Rows.Count; if (altas == 0 && bajas != 0 && bajasInm == 0) { RadTabStrip1.SelectedIndex = RadMultiPage1.SelectedIndex = 1; } else if (altas != 0 && bajas == 0 && bajasInm == 0) { RadTabStrip1.SelectedIndex = RadMultiPage1.SelectedIndex = 0; } else if (altas == 0 && bajas == 0 && bajasInm != 0) { RadTabStrip1.SelectedIndex = RadMultiPage1.SelectedIndex = 2; } else { RadTabStrip1.SelectedIndex = RadMultiPage1.SelectedIndex = 0; } int dato = Convert.ToInt32(periodo); grafica.Legend.Appearance.Position = Telerik.Web.UI.HtmlChart.ChartLegendPosition.Bottom; grafica.PlotArea.Series.Clear(); Telerik.Web.UI.DonutSeries serieRec = new Telerik.Web.UI.DonutSeries(); serieRec.StartAngle = 0; serieRec.HoleSize = 0; serieRec.LabelsAppearance.Position = Telerik.Web.UI.HtmlChart.PieAndDonutLabelsPosition.OutsideEnd; serieRec.LabelsAppearance.DataFormatString = "{0}"; serieRec.LabelsAppearance.Visible = true; serieRec.TooltipsAppearance.BackgroundColor = Color.Black; serieRec.TooltipsAppearance.Color = Color.White; serieRec.TooltipsAppearance.DataFormatString = "{0}"; Telerik.Web.UI.PieSeriesItem cRec = new Telerik.Web.UI.PieSeriesItem(); Telerik.Web.UI.PieSeriesItem cPag = new Telerik.Web.UI.PieSeriesItem(); Telerik.Web.UI.PieSeriesItem cOt = new Telerik.Web.UI.PieSeriesItem(); cRec.Y = Convert.ToDecimal(bajas.ToString()); cPag.Y = Convert.ToDecimal(altas.ToString()); cOt.Y = Convert.ToDecimal(bajasInm.ToString()); cRec.Exploded = cPag.Exploded = cOt.Exploded = false; cRec.BackgroundColor = Color.FromArgb(255, 69, 0); cPag.BackgroundColor = Color.FromArgb(50, 205, 50); cOt.BackgroundColor = Color.FromArgb(135, 206, 250); cRec.Name = "Bajas"; cPag.Name = "Altas"; cOt.Name = "Bajas Inmediatas"; serieRec.SeriesItems.Add(cRec); serieRec.SeriesItems.Add(cPag); serieRec.SeriesItems.Add(cOt); grafica.PlotArea.Series.Add(serieRec); }
public void LlenaGridDataSet(DataSet Ds, Telerik.Web.UI.RadGrid Grid, string Tabla) { //Grid.Culture = new CultureInfo("es-PE"); Grid.DataSource = Ds.Tables[Tabla]; }
public void LlenaGridDataView(DataView dv, Telerik.Web.UI.RadGrid Grid, string Table) { Grid.Culture = new CultureInfo("es-PE"); Grid.DataSource = dv; }
public void LlenaGridDt(DataSet ds, Telerik.Web.UI.RadGrid Grid, string Table) { Grid.Culture = new CultureInfo("es-PE"); Grid.DataSource = ds.Tables[Table]; }
public void LlenaGrid(DataSet ds, Telerik.Web.UI.RadGrid Grid) { Grid.Culture = new CultureInfo("es-PE"); Grid.DataSource = ds; }