/// <summary> /// Binds the form. /// </summary> private void BindForm() { //autoComplete.ServiceMethod = this.ServiceMethod; GridHelper.BindGrid(EntryRelationDefaultGrid, "Catalog", Request.QueryString["_v"].ToString()); if (CatalogEntryId > 0) { CatalogRelationDto relation = CatalogContext.Current.GetCatalogRelationDto(ParentCatalogId, ParentCatalogNodeId, CatalogEntryId, String.Empty, new CatalogRelationResponseGroup(CatalogRelationResponseGroup.ResponseGroup.CatalogEntry)); DataTable table = new DataTable(); table.Columns.Add(new DataColumn("ID", typeof(int))); table.Columns.Add(new DataColumn("Name", typeof(string))); table.Columns.Add(new DataColumn("Quantity", typeof(decimal))); table.Columns.Add(new DataColumn("GroupName", typeof(string))); table.Columns.Add(new DataColumn("SortOrder", typeof(int))); foreach (CatalogRelationDto.CatalogEntryRelationRow row in relation.CatalogEntryRelation) { DataRow newRow = table.NewRow(); newRow["ID"] = row.ChildEntryId; newRow["Name"] = CatalogContext.Current.GetCatalogEntryDto(row.ChildEntryId).CatalogEntry[0].Name; newRow["Quantity"] = row.Quantity; newRow["GroupName"] = row.GroupName; newRow["SortOrder"] = row.SortOrder; table.Rows.Add(newRow); } EntryRelationDefaultGrid.DataSource = table; } EntryRelationDefaultGrid.DataBind(); }
/// <summary> /// Binds a data source to the invoked server control and all its child controls. /// </summary> public override void DataBind() { base.DataBind(); if (!this.IsPostBack) { GridHelper.BindGrid(AssociationItemsGrid, "Catalog", "ProductAssociations"); } }
/// <summary> /// Binds the form. /// </summary> private void BindForm() { GridHelper.BindGrid(RegionsGrid, "Order", "CountryRegions"); if (_Country != null) { BindGridData(); } }
/* * public IEnumerable<LineItem> GetLineItems(PurchaseOrder po) * { * foreach (OrderForm orderForm in po.OrderForms) * { * foreach (LineItem lineItem in orderForm.LineItems) * { * yield return lineItem; * } * } * } * */ /// <summary> /// Binds the form. /// </summary> private void BindForm() { GridHelper.BindGrid(DefaultGrid, "Marketing", "PromotionCond-List"); if (_promotion != null) { SecurityManager.CheckRolePermission("marketing:expr:mng:edit"); DataTable table = _promotion.PromotionCondition.Copy(); table.Columns.Add(new DataColumn(_ExpressionNameString)); table.Columns.Add(new DataColumn(_CatalogNodeNameString)); table.Columns.Add(new DataColumn(_CatalogEntryNameString)); foreach (DataRow row in table.Rows) { if (row[_ExpressionIdString] != DBNull.Value && !String.IsNullOrEmpty(row[_ExpressionIdString].ToString())) { row[_ExpressionNameString] = GetExpressionName(Int32.Parse(row[_ExpressionIdString].ToString())); } if (row[_CatalogNodeIdString] != DBNull.Value && !String.IsNullOrEmpty(row[_CatalogNodeIdString].ToString())) { row[_CatalogNodeNameString] = GetCatalogNodeName(row[_CatalogNodeIdString].ToString()); } if (row[_CatalogEntryIdString] != DBNull.Value && !String.IsNullOrEmpty(row[_CatalogEntryIdString].ToString())) { row[_CatalogEntryNameString] = GetCatalogEntryName(row[_CatalogEntryIdString].ToString()); } } DefaultGrid.DataSource = table; DefaultGrid.DataBind(); /* * DataTable tbl = _promotion.PromotionCondition.Copy(); * DataColumn column = tbl.Columns.Add(); * column.ColumnName = _ExpressionNameString; * */ /* * ArrayList list = new ArrayList(); * foreach(LineItem li in GetLineItems(_po)) * { * list.Add(li); * } * DefaultGrid.DataSource = list; * DefaultGrid.DataBind(); * */ } else { SecurityManager.CheckRolePermission("marketing:expr:mng:create"); } }
/// <summary> /// Binds the grid. /// </summary> protected void BindGrid() { GridHelper.BindGrid(DefaultGrid, GridAppId, GridViewId); DirectoryInfo dir = new DirectoryInfo(MapPath(Folder)); FileInfo[] files = dir.GetFiles(); // sort files by created date desc IEnumerable <FileInfo> filesQuery = from file in files orderby file.CreationTime descending select file; // set sorted result as datasource DefaultGrid.DataSource = filesQuery.ToArray <FileInfo>(); DefaultGrid.DataBind(); }
/// <summary> /// Binds the form. /// </summary> private void BindForm() { GridHelper.BindGrid(SiteSettingsDefaultGrid, "Content", "Site-Edit"); if (SiteId != Guid.Empty && _SiteDtoDest != null && _SiteDtoDest.Site.Count > 0) { string variablesFilter = MakeVariablesFilter(); SiteDto.main_GlobalVariablesRow[] rows = (SiteDto.main_GlobalVariablesRow[])_SiteDtoDest.main_GlobalVariables.Select(variablesFilter, "KEY"); SiteSettingsDefaultGrid.DataSource = rows; } SiteSettingsDefaultGrid.DataBind(); }
/// <summary> /// Handles the Load event of the Page control. /// </summary> /// <param name="sender">The source of the event.</param> /// <param name="e">The <see cref="System.EventArgs"/> instance containing the event data.</param> protected void Page_Load(object sender, EventArgs e) { if (!DefaultGrid.IsCallback) { DataBind(); } else { GridHelper.BindGrid(DefaultGrid, GridAppId, GridViewId); base.DataBind(); } Page.ClientScript.RegisterClientScriptBlock(this.GetType(), "ecf-catalog-filelist-select" + this.ID, "function " + this.ID + "_FilesListDefaultGrid_onItemSelect(sender, eventArgs){ id = '" + this.SelectedBtnId + "'; if (id != '' ){var btn = $get(id);if (btn != null)btn.disabled = false;} var obj = $get('" + hfSelectedItems.ClientID + "'); if (obj != null) obj.value = eventArgs.get_item().Index; }", true); Response.Cache.SetNoStore(); }
/// <summary> /// Binds the form. /// </summary> private void BindForm() { GridHelper.BindGrid(PolicyGrid, "Marketing", "PromotionPolicy-List"); if (_promotion != null) { //first check permissions //if permissions not present, deny SecurityManager.CheckRolePermission("marketing:policies:mng:edit"); PolicyGrid.DataSource = _promotion.PromotionPolicy; PolicyGrid.DataBind(); } else { SecurityManager.CheckRolePermission("marketing:policies:mng:create"); } }
/// <summary> /// Binds the form. /// </summary> private void BindForm() { GridHelper.BindGrid(AssetsDefaultGrid, "Catalog", "Assets-List"); DataTable table = new DataTable(); table.Columns.Add(new DataColumn("ID", typeof(int))); table.Columns.Add(new DataColumn("AssetType", typeof(string))); table.Columns.Add(new DataColumn("Name", typeof(string))); table.Columns.Add(new DataColumn("GroupName", typeof(string))); table.Columns.Add(new DataColumn("SortOrder", typeof(int))); foreach (DataRow row in _AssetTable.Rows) { DataRow newRow = table.NewRow(); newRow["ID"] = row["AssetKey"]; newRow["AssetType"] = row["AssetType"]; if (row["AssetType"].Equals("folder")) { Folder[] folders = Folder.List <Folder>(Folder.GetAssignedMetaClass(), new FilterElement[] { new FilterElement("FolderId", FilterElementType.Equal, row["AssetKey"]) }); if (folders != null && folders.Length > 0) { newRow["Name"] = BuildFullPath(folders[0]) + folders[0].Name; } } else { FolderElement[] elements = FolderElement.List <FolderElement>(FolderElement.GetAssignedMetaClass(), new FilterElement[] { new FilterElement("FolderElementId", FilterElementType.Equal, row["AssetKey"]) }); if (elements != null && elements.Length > 0) { newRow["Name"] = BuildFullPath(elements[0]) + elements[0].Name; } } newRow["GroupName"] = row["GroupName"]; newRow["SortOrder"] = row["SortOrder"]; table.Rows.Add(newRow); } AssetsDefaultGrid.DataSource = table; AssetsDefaultGrid.DataBind(); }
/// <summary> /// Binds the form. /// </summary> private void BindForm() { GridHelper.BindGrid(LineItemsGrid, "Order", "LineItems"); BindLineItemsGrid(); }
public void BindGrid <T>(IQueryable <T> q) { GridHelper.BindGrid(this, q); }
/// <summary> /// Binds the grid. /// </summary> private void BindGrid() { GridHelper.BindGrid(AssociationItemsGrid, "Catalog", "ProductAssociations"); SetAssociationItemsGridDataSource(SelectedAssociationId); AssociationItemsGrid.DataBind(); }
/// <summary> /// Binds the form. /// </summary> private void BindForm() { GridHelper.BindGrid(PaymentOptionList, "Order", "Payments"); BindPaymentOptions(); }
/// <summary> /// Binds the form. /// </summary> private void BindForm() { BindLists(); if (CatalogEntryId > 0) { CatalogDto catalogDto = CatalogContext.Current.GetCatalogDto(_CatalogEntryDto.CatalogEntry[0].CatalogId); if (_CatalogEntryDto.CatalogEntry.Count > 0) { if (_CatalogEntryDto.Variation.Count != 0) { CatalogEntryDto.VariationRow variationRow = _CatalogEntryDto.Variation[0]; ListPrice.Text = variationRow.ListPrice.ToString("#0.00"); //"N2"); DisplayPriceCurrency.Text = catalogDto.Catalog[0].DefaultCurrency; MinQty.Text = variationRow.MinQuantity.ToString(); MaxQty.Text = variationRow.MaxQuantity.ToString(); Weight.Text = variationRow.Weight.ToString(); if (!variationRow.IsMerchantIdNull()) { ManagementHelper.SelectListItem(MerchantList, variationRow.MerchantId); } ManagementHelper.SelectListItem(PackageList, variationRow.PackageId); ManagementHelper.SelectListItem(WarehouseList, variationRow.WarehouseId); ManagementHelper.SelectListItem(TaxList, variationRow.TaxCategoryId); TrackInventory.IsSelected = variationRow.TrackInventory; } if (_CatalogEntryDto.Inventory.Count != 0) { CatalogEntryDto.InventoryRow inventoryRow = _CatalogEntryDto.Inventory[0]; ManagementHelper.SelectListItem(InventoryStatusList, inventoryRow.InventoryStatus); InStockQty.Text = inventoryRow.InStockQuantity.ToString(); ReservedQty.Text = inventoryRow.ReservedQuantity.ToString(); ReorderMinQty.Text = inventoryRow.ReorderMinQuantity.ToString(); AllowPreorder.IsSelected = inventoryRow.AllowPreorder; PreorderQty.Text = inventoryRow.PreorderQuantity.ToString(); PreorderAvail.Value = ManagementHelper.GetUserDateTime(inventoryRow.PreorderAvailabilityDate); AllowBackorder.IsSelected = inventoryRow.AllowBackorder; BackorderQty.Text = inventoryRow.BackorderQuantity.ToString(); BackorderAvail.Value = ManagementHelper.GetUserDateTime(inventoryRow.BackorderAvailabilityDate); } // Bind SalePrices GridHelper.BindGrid(SalePricesGrid, "Catalog", "EntrySalePrice"); BindSalePricesGrid(); } } else // set defaults { InStockQty.Text = "10"; ReservedQty.Text = "2"; ReorderMinQty.Text = "1"; AllowPreorder.IsSelected = false; PreorderQty.Text = "10"; PreorderAvail.Value = ManagementHelper.GetUserDateTime(DateTime.Now.ToUniversalTime()); AllowBackorder.IsSelected = false; BackorderQty.Text = "10"; BackorderAvail.Value = ManagementHelper.GetUserDateTime(DateTime.Now.ToUniversalTime()); MinQty.Text = "1"; MaxQty.Text = "100"; Weight.Text = Decimal.Parse("1.0", System.Globalization.CultureInfo.InvariantCulture).ToString(); GridHelper.BindGrid(SalePricesGrid, "Catalog", "EntrySalePrice"); } }
/// <summary> /// Binds the form. /// </summary> private void BindForm() { GridHelper.BindGrid(TaxValuesGrid, "Order", "TaxValues"); BindTaxValuesGrid(); }
/// <summary> /// Binds the form. /// </summary> private void BindForm() { GridHelper.BindGrid(ShipmentList, "Order", "Shipments"); BindShipmentsGrid(); }
/// <summary> /// Binds the form. /// </summary> private void BindForm() { GridHelper.BindGrid(CurrencyRatesGrid, "Catalog", "CurrencyRates"); BindCurrencyRatesGrid(); }
/// <summary> /// Binds the form. /// </summary> private void BindForm() { GridHelper.BindGrid(AddressList, "Order", "Addresses"); BindAddresses(); }