protected void RadGrid1_DetailTableDataBind(object source, Telerik.Web.UI.GridDetailTableDataBindEventArgs e) { try { GridDataItem dataItem = (GridDataItem)e.DetailTableView.ParentItem; switch (e.DetailTableView.Name) { case "Opcion": { int?idArea = int.Parse(dataItem.GetDataKeyValue("Id").ToString()); int?idNivel1 = dataItem.GetDataKeyValue("IdNivel1") != null?int.Parse(dataItem.GetDataKeyValue("IdNivel1").ToString()) : (int?)null; int?idNivel2 = dataItem.GetDataKeyValue("IdNivel2") != null?int.Parse(dataItem.GetDataKeyValue("IdNivel2").ToString()) : (int?)null; int?idNivel3 = dataItem.GetDataKeyValue("IdNivel3") != null?int.Parse(dataItem.GetDataKeyValue("IdNivel3").ToString()) : (int?)null; int?idNivel4 = dataItem.GetDataKeyValue("IdNivel4") != null?int.Parse(dataItem.GetDataKeyValue("IdNivel4").ToString()) : (int?)null; int?idNivel5 = dataItem.GetDataKeyValue("IdNivel5") != null?int.Parse(dataItem.GetDataKeyValue("IdNivel5").ToString()) : (int?)null; int?idNivel6 = dataItem.GetDataKeyValue("IdNivel6") != null?int.Parse(dataItem.GetDataKeyValue("IdNivel6").ToString()) : (int?)null; int?idNivel7 = dataItem.GetDataKeyValue("IdNivel7") != null?int.Parse(dataItem.GetDataKeyValue("IdNivel7").ToString()) : (int?)null; e.DetailTableView.DataSource = GetDataOptions(idArea, idNivel1, idNivel2, idNivel3, idNivel4, idNivel5, idNivel6, idNivel7); break; } } } catch (Exception ex) { throw new Exception(ex.Message); } }
protected void rgdPayDetails_DetailTableDataBind(object source, Telerik.Web.UI.GridDetailTableDataBindEventArgs e) { GridDataItem dataItem = (GridDataItem)e.DetailTableView.ParentItem; switch (e.DetailTableView.Name) { case "Items": { DataTable dtDeliverItems = new DataTable(); string strReqCode = dataItem.GetDataKeyValue("REQUISITION_CODE").ToString(); string strVesselCode = dataItem.GetDataKeyValue("Vessel_Code").ToString(); string strDeliverCode = dataItem.GetDataKeyValue("DELIVERY_CODE").ToString(); string strCatalogId = cmbCatalog.SelectedValue.ToString(); dtDeliverItems = BindDeliveredItemsInHirarchy(strReqCode, strVesselCode, strDeliverCode, strCatalogId); //dtDeliverItems.DefaultView.RowFilter ="SYSTEM_CODE ='" + cmbCatalog.SelectedValue.ToString() + "'"; //e.DetailTableView.DataSource = dtDeliverItems.DefaultView; e.DetailTableView.DataSource = dtDeliverItems; break; } //case "ItemsDetails": // { // string REQUISITION_CODE = dataItem.GetDataKeyValue("REQUISITION_CODE").ToString(); // e.DetailTableView.DataSource = GetDataTable("SELECT DISTINCT itv.[ID],itv.[Part_Number],itv.[Short_Description],itv.[Unit_and_Packings], SITEM.[REQUESTED_QTY],SITEM.[ITEM_COMMENT], SITEM.REQUISITION_CODE,slib.SYSTEM_Description FROM dbo.PURC_Dtl_Supply_Items SITEM INNER jOIN dbo.PMS_INV_Lib_Systems_Library Slib on SITEM.ITEM_SYSTEM_CODE=slib.SYSTEM_CODE INNER jOIN dbo.PMS_INV_Lib_Items itv on itv.[ID]=SITEM.[ITEM_REF_CODE] where SITEM.REQUISITION_CODE ='" + REQUISITION_CODE + "'"); // break; // } } }
protected void radGridMenu_DetailTableDataBind(object source, Telerik.Web.UI.GridDetailTableDataBindEventArgs e) { GridDataItem dataItem = (GridDataItem)e.DetailTableView.ParentItem; string menuId = dataItem.GetDataKeyValue("ID").ToString(); e.DetailTableView.DataSource = _menuManagement.GetRoutesByMenu(Convert.ToInt32(menuId)); }
protected void rgFamilyPayment_DetailTableDataBind(object sender, Telerik.Web.UI.GridDetailTableDataBindEventArgs e) { try { GridDataItem dataItem = (GridDataItem)e.DetailTableView.ParentItem; switch (e.DetailTableView.DataMember) { case "Payment": { DayCareBAL.FamilyPaymentService proxyFamilyPayment = new DayCareBAL.FamilyPaymentService(); List <DayCarePL.FamilyPaymentProperties> lstFamilyPayment = proxyFamilyPayment.GetFamilyWisePayment(new Guid(dataItem.GetDataKeyValue("ChildFamilyId").ToString())); if (lstFamilyPayment != null) { if (lstFamilyPayment != null) { if (lstFamilyPayment.Count > 0) { e.DetailTableView.DataSource = lstFamilyPayment.OrderByDescending(i => i.PostDate); } else { e.DetailTableView.DataSource = new List <DayCarePL.FamilyPaymentProperties>(); } } } break; } } } catch (Exception ex) { } }
protected void rgAdminSMS_DetailTableDataBind(object source, Telerik.Web.UI.GridDetailTableDataBindEventArgs e) { GridDataItem dataItem = (GridDataItem)e.DetailTableView.ParentItem; switch (e.DetailTableView.Name) { case "AccountType": { int LoginId = Convert.ToInt32(dataItem.GetDataKeyValue("LoginId")); e.DetailTableView.DataSource = new AdministrationBAL().GetAccountType(LoginId); break; } case "Account": { int LoginId = Convert.ToInt32(dataItem.GetDataKeyValue("LoginId")); int AccountTypeId = Convert.ToInt32(dataItem.GetDataKeyValue("AccountTypeId")); DataTable dtAccountType = new AdministrationBAL().GetSMSDetails(LoginId, AccountTypeId); foreach (DataRow dr in dtAccountType.Rows) { dr["CreatedOn"] = TimeZoneInfo.ConvertTimeBySystemTimeZoneId(Convert.ToDateTime(dr["CreatedOn"]), "India Standard Time"); } e.DetailTableView.DataSource = dtAccountType; //e.DetailTableView.DataSource = new AdministrationBAL().GetSMSDetails(LoginId, AccountTypeId); break; } } }
protected void radGridCurrentOrder_DetailTableDataBind(object source, Telerik.Web.UI.GridDetailTableDataBindEventArgs e) { GridDataItem dataItem = (GridDataItem)e.DetailTableView.ParentItem; string orderId = dataItem.GetDataKeyValue("OrderId").ToString(); e.DetailTableView.DataSource = _orderManagement.GetOrderDetailsbyOrderId(Convert.ToInt32(orderId)); }
protected void RadGrid1_DetailTableDataBind(object sender, Telerik.Web.UI.GridDetailTableDataBindEventArgs e) { System.Data.DataSet ds = (System.Data.DataSet)ViewState["DATA.RESULT"]; Telerik.Web.UI.GridDataItem dataItem = (Telerik.Web.UI.GridDataItem)e.DetailTableView.ParentItem; string kdInduk = dataItem.GetDataKeyValue("ID_IKU").ToString(); DataTable dt = ds.Tables[1].Select("ID_IKU = " + kdInduk).CopyToDataTable(); e.DetailTableView.DataSource = dt; }
void grdOrders_DetailTableDataBind(object source, Telerik.Web.UI.GridDetailTableDataBindEventArgs e) { int orderID = int.Parse(e.DetailTableView.ParentItem.GetDataKeyValue("OrderID").ToString()); DataSet ds = OrderData; DataView dv = ds.Tables[0].DefaultView; if (e.DetailTableView.DataMember == "OrderDetails") { dv.RowFilter = "OrderID = " + orderID.ToString(); e.DetailTableView.DataSource = dv; } }
protected void grd_Show_DetailTableDataBind(object sender, Telerik.Web.UI.GridDetailTableDataBindEventArgs e) { GridDataItem dataItem = (GridDataItem)e.DetailTableView.ParentItem; switch (e.DetailTableView.Name) { case "info": { string ID = dataItem.GetDataKeyValue("ID").ToString(); e.DetailTableView.DataSource = FRB.DepartmanProf(int.Parse(ID)); break; } } }
protected void radGridCurrentOrder_DetailTableDataBind(object source, Telerik.Web.UI.GridDetailTableDataBindEventArgs e) { try { GridDataItem dataItem = (GridDataItem)e.DetailTableView.ParentItem; string orderId = dataItem.GetDataKeyValue("OrderId").ToString(); e.DetailTableView.DataSource = _orderManagement.GetOrderDetailsbyOrderId(Convert.ToInt32(orderId)); } catch (Exception ex) { //write to Elma ErrorSignal.FromCurrentContext().Raise(ex); } }
protected void rdAssetTypeGrid_DetailTableDataBind(object source, Telerik.Web.UI.GridDetailTableDataBindEventArgs e) { if (_assetReclamationServiceLocation != null) { GridDataItem dataItem = (GridDataItem)e.DetailTableView.ParentItem; Hashtable values = new Hashtable(); dataItem.ExtractValues(values); int assetCategoryId = Convert.ToInt32(values["AssetCategoryId"].ToString()); AssetCategoryEntity assetCategory = new AssetCategoryEntity(assetCategoryId); var assetTypes = from at in _db.AssetType where at.AssetCategoryId == assetCategory.AssetCategoryId orderby at.Name select at; var serviceLocationAssetTypes = from slat in _db.ServiceLocationAssetType join at in _db.AssetType on slat.AssetTypeId equals at.AssetTypeId join ac in _db.AssetCategory on at.AssetCategoryId equals ac.AssetCategoryId where at.AssetCategoryId == assetCategory.AssetCategoryId && slat.ServiceLocationId == _assetReclamationServiceLocation.ServiceLocationId select slat; List <ServiceLocationAssetTypeEntity> slats = new List <ServiceLocationAssetTypeEntity>(); foreach (AssetTypeEntity ate in assetTypes) { if (serviceLocationAssetTypes.Where(x => x.AssetTypeId == ate.AssetTypeId).Count() > 0) { slats.Add(serviceLocationAssetTypes.Where(x => x.AssetTypeId == ate.AssetTypeId).First()); } else { ServiceLocationAssetTypeEntity slat = new ServiceLocationAssetTypeEntity(); slat.ServiceLocationId = _assetReclamationServiceLocation.ServiceLocationId; slat.AssetTypeId = ate.AssetTypeId; slat.PricePerUnit = 0; slat.Save(); slats.Add(slat); } } e.DetailTableView.DataSource = slats.OrderBy(x => x.AssetType.Name); } else { e.DetailTableView.DataSource = null; } }
protected void grdCuestionarios_DetailTableDataBind(object sender, Telerik.Web.UI.GridDetailTableDataBindEventArgs e) { GridDataItem vDataItem = (GridDataItem)e.DetailTableView.ParentItem; switch (e.DetailTableView.Name) { case "gtvEvaluadores": int vIdEmpleado = int.Parse(vDataItem.GetDataKeyValue("ID_EMPLEADO").ToString()); int vIdEvaluado = int.Parse(vDataItem.GetDataKeyValue("ID_EVALUADO").ToString()); e.DetailTableView.DataSource = CrearDataTableEvaluacion(vIdEmpleado, vIdEvaluado); break; } }
protected void RadGrid1_DetailTableDataBind(object source, Telerik.Web.UI.GridDetailTableDataBindEventArgs e) { GridDataItem dataItem = (GridDataItem)e.DetailTableView.ParentItem; switch (e.DetailTableView.Name) { case "Items": { string REQUISITION_CODE = dataItem.GetDataKeyValue("REQUISITION_CODE").ToString(); string DocumentCode = dataItem.GetDataKeyValue("document_code").ToString(); string Vessel_Code = dataItem.GetDataKeyValue("Vessel_Code").ToString(); e.DetailTableView.DataSource = BindItemsInHirarchy(REQUISITION_CODE, Vessel_Code, DocumentCode); break; } } }
protected void grdCuestionarios_DetailTableDataBind(object sender, Telerik.Web.UI.GridDetailTableDataBindEventArgs e) { GridDataItem vDataItem = (GridDataItem)e.DetailTableView.ParentItem; switch (e.DetailTableView.Name) { case "gtvEvaluadores": int vIdEvaluado = 0; if (int.TryParse(vDataItem.GetDataKeyValue("ID_EVALUADO").ToString(), out vIdEvaluado)) { PeriodoNegocio nPeriodo = new PeriodoNegocio(); e.DetailTableView.DataSource = nPeriodo.ObtenerEvaluadoresAutorizacion(vIdEvaluado); } break; } }
protected void rdAssetTypeGrid_DetailTableDataBind(object source, Telerik.Web.UI.GridDetailTableDataBindEventArgs e) { GridDataItem dataItem = (GridDataItem)e.DetailTableView.ParentItem; Hashtable values = new Hashtable(); dataItem.ExtractValues(values); int assetCategoryId = Convert.ToInt32(values["AssetCategoryId"].ToString()); AssetCategoryEntity assetCategory = new AssetCategoryEntity(assetCategoryId); var assetTypes = from at in _db.AssetType where at.AssetCategoryId == assetCategory.AssetCategoryId orderby at.Name select at; e.DetailTableView.DataSource = assetTypes; }
protected void rgCursos_DetailTableDataBind(object sender, Telerik.Web.UI.GridDetailTableDataBindEventArgs e) { GridDataItem vDataItem = (GridDataItem)e.DetailTableView.ParentItem; switch (e.DetailTableView.Name) { case "gtvMaterial": int vIdEvento; ConsultasFYDNegocio neg = new ConsultasFYDNegocio(); vIdEvento = int.Parse(vDataItem.GetDataKeyValue("ID_EVENTO").ToString()); e.DetailTableView.DataSource = ConvertToDataTable(neg.ReporteMaterialesPorEvento(vIdEvento)); break; default: break; } }
protected void rgProgramEnrollment_DetailTableDataBind(object sender, Telerik.Web.UI.GridDetailTableDataBindEventArgs e) { try { GridDataItem dataItem = (GridDataItem)e.DetailTableView.ParentItem; List <DayCarePL.ChildProgEnrollmentProperties> lstChildProgEnrollment = new List <DayCarePL.ChildProgEnrollmentProperties>(); lstChildProgEnrollment = GetChildProgEnrollment(); if (lstChildProgEnrollment != null && lstChildProgEnrollment.Count > 0) { lstChildProgEnrollment = lstChildProgEnrollment.FindAll(d => d.SchoolProgramId == new Guid(dataItem.GetDataKeyValue("SchoolProgramId").ToString())); if (lstChildProgEnrollment != null) { e.DetailTableView.DataSource = lstChildProgEnrollment.OrderBy(i => i.DayIndex); } } } catch (Exception ex) { } }
protected void rgAdminHospitalList_DetailTableDataBind(object source, Telerik.Web.UI.GridDetailTableDataBindEventArgs e) { GridDataItem dataItem = (GridDataItem)e.DetailTableView.ParentItem; string mobileId = dataItem.GetDataKeyValue("Mobile").ToString(); DataTable dtDepartment = new AdministrationBAL().GetExistingHospital(mobileId); dtDepartment.Columns.Add("Address", typeof(string)); foreach (DataRow dr in dtDepartment.Rows) { if (!string.IsNullOrEmpty(dr["AddressLine"].ToString())) { dr["Address"] += dr["AddressLine"].ToString(); } if (!string.IsNullOrEmpty(dr["CityName"].ToString())) { dr["Address"] += ", " + dr["CityName"].ToString(); } if (!string.IsNullOrEmpty(dr["StateName"].ToString())) { dr["Address"] += ", " + dr["StateName"].ToString(); } if (!string.IsNullOrEmpty(dr["CountryName"].ToString())) { dr["Address"] += ", " + dr["CountryName"].ToString(); } if (!string.IsNullOrEmpty(dr["PostalCode"].ToString())) { dr["Address"] += ", " + dr["PostalCode"].ToString(); } } dtDepartment.AcceptChanges(); e.DetailTableView.DataSource = dtDepartment; //if (!IsRebind) // rgAdminHospitalList.DataBind(); }
protected void rgAdminLogIn_DetailTableDataBind(object source, Telerik.Web.UI.GridDetailTableDataBindEventArgs e) { GridDataItem dataItem = (GridDataItem)e.DetailTableView.ParentItem; switch (e.DetailTableView.Name) { case "AccountType": { int LoginId = Convert.ToInt32(dataItem.GetDataKeyValue("LoginId")); e.DetailTableView.DataSource = GetAccountType(LoginId); break; } case "Account": { int LoginId = Convert.ToInt32(dataItem.GetDataKeyValue("LoginId")); int AccountTypeId = Convert.ToInt32(dataItem.GetDataKeyValue("AccountTypeId")); e.DetailTableView.DataSource = GetLoginTable(LoginId, AccountTypeId); break; } } }
protected void rdAccountGrid_DetailTableDataBind(object source, Telerik.Web.UI.GridDetailTableDataBindEventArgs e) { GridDataItem dataItem = (GridDataItem)e.DetailTableView.ParentItem; Hashtable values = new Hashtable(); dataItem.ExtractValues(values); int accountId = Convert.ToInt32(values["AccountId"].ToString()); AccountEntity account = new AccountEntity(accountId); var accountEmployeeAssignment = from aea in _db.AccountEmployeeAssignment where aea.AccountId == account.AccountId select aea; if (accountEmployeeAssignment.Count() == 0) { AccountEmployeeAssignmentEntity aeae = new AccountEmployeeAssignmentEntity(); aeae.AccountId = accountId; aeae.Save(); } e.DetailTableView.DataSource = account.AccountEmployeeAssignment.ToList(); }
protected void RadGridUsers_DetailTableDataBind(object sender, Telerik.Web.UI.GridDetailTableDataBindEventArgs e) { GridTableView tableView = RadGridUsers.MasterTableView.Items[0].ChildItem.NestedTableViews[0] as GridTableView; tableView.HierarchyLoadMode = GridChildLoadMode.ServerBind; }
protected void RadGridUsers_DetailTableDataBind1(object sender, Telerik.Web.UI.GridDetailTableDataBindEventArgs e) { GridDataItem dataItem = (GridDataItem)e.DetailTableView.ParentItem; switch (e.DetailTableView.Name) { case "ProjectsDetails": { UserID = Convert.ToInt32(dataItem.GetDataKeyValue("UserID").ToString()); /* var projects = (from pm in _db.ProjectMembers * join p in _db.Projects * on pm.projectId equals p.projectId * where pm.userId == UserID * select new * { * projectID = p.projectId, * name = p.name, * StartDate = p.startDate, * DueDate = p.dueDate, * description = p.description, * owner = p.ownerId * }).ToList(); */ var projMembers = _db.ProjectMembers.Where(p => p.userId == UserID).Select(s => s.projectId).ToList <int>(); var projects = _db.Projects.Where(p => projMembers.Contains(p.projectId)); List <ProjectDTO> dt = new List <ProjectDTO>(); foreach (Project pr in projects) { var owner = _db.Users.Where(p => p.userId == pr.ownerId).FirstOrDefault().username; ProjectDTO d = new ProjectDTO(); d.projectId = pr.projectId; d.description = pr.description; d.dueDate = pr.dueDate; d.name = pr.name; d.startDate = pr.startDate; d.owner = owner; dt.Add(d); } e.DetailTableView.DataSource = dt; break; } case "TasksDetails": { int projectID = Convert.ToInt32(dataItem.GetDataKeyValue("ProjectID")); int userID = Convert.ToInt32(dataItem.OwnerTableView.ParentItem.GetDataKeyValue("UserID")); /* var tasks = (from tu in _db.UsersTasks * join t in _db.Tasks * on tu.taskId equals t.taskId * where tu.userId == UserID * select new * { * TaskID = t.taskId, * name = t.name, * description = t.description, * status = t.status * }).ToList(); */ var userTsk = _db.UsersTasks.Where(p => p.userId == userID).Select(s => s.taskId).ToList <int>(); var tasks = _db.Tasks.Where(t => t.projectId == projectID && userTsk.Contains(t.taskId)); e.DetailTableView.DataSource = tasks.ToList(); break; } } }