/// <summary> /// Loads the data and data bind. /// </summary> /// <param name="sortExpression">The sort expression.</param> private void LoadDataAndDataBind(string sortExpression) { SegmentDto dto = SegmentManager.GetSegmentDto(); if (dto.Segment != null) { DataView view = dto.Segment.DefaultView; view.Sort = sortExpression; MyListView.DataSource = view; } MyListView.CurrentListView.PrimaryKeyId = EcfListView.MakePrimaryKeyIdString("SegmentId"); MyListView.DataBind(); }
/// <summary> /// Loads the data and data bind. /// </summary> /// <param name="sortExpression">The sort expression.</param> private void LoadDataAndDataBind(string sortExpression) { CatalogTaxDto dto = CatalogTaxManager.GetTaxCategories(); if (dto.TaxCategory != null) { DataView view = dto.TaxCategory.DefaultView; view.Sort = sortExpression; MyListView.DataSource = view; } MyListView.CurrentListView.PrimaryKeyId = EcfListView.MakePrimaryKeyIdString("TaxCategoryId"); MyListView.DataBind(); }
/// <summary> /// Loads the data and data bind. /// </summary> /// <param name="sortExpression">The sort expression.</param> private void LoadDataAndDataBind(string sortExpression) { ShippingMethodDto dto = ShippingManager.GetShippingMethods("", true); if (dto.ShippingOption != null) { DataView view = dto.ShippingOption.DefaultView; view.Sort = sortExpression; MyListView.DataSource = view; } MyListView.CurrentListView.PrimaryKeyId = EcfListView.MakePrimaryKeyIdString("ShippingOptionId"); MyListView.DataBind(); }
/// <summary> /// Loads the data and data bind. /// </summary> /// <param name="sortExpression">The sort expression.</param> private void LoadDataAndDataBind(string sortExpression) { CampaignDto dto = CampaignManager.GetCampaignDto(); if (dto.Campaign != null) { DataView view = dto.Campaign.DefaultView; view.Sort = sortExpression; MyListView.DataSource = view; } MyListView.CurrentListView.PrimaryKeyId = EcfListView.MakePrimaryKeyIdString("CampaignId"); MyListView.DataBind(); }
/// <summary> /// Loads the data and data bind. /// </summary> /// <param name="sortExpression">The sort expression.</param> private void LoadDataAndDataBind(string sortExpression) { ExpressionDto dto = ExpressionManager.GetExpressionDto(ExpressionCategory); if (dto.Expression != null) { DataView view = dto.Expression.DefaultView; view.Sort = sortExpression; MyListView.DataSource = view; } MyListView.CurrentListView.PrimaryKeyId = EcfListView.MakePrimaryKeyIdString("ExpressionId"); MyListView.DataBind(); }
/// <summary> /// Loads the data and data bind. /// </summary> /// <param name="sortExpression">The sort expression.</param> private void LoadDataAndDataBind(string sortExpression) { DataTable table = mc.Language.GetAllLanguagesDT(); if (table != null) { DataView view = table.DefaultView; view.Sort = sortExpression; MyListView.DataSource = view; } MyListView.CurrentListView.PrimaryKeyId = EcfListView.MakePrimaryKeyIdString("LangId"); MyListView.DataBind(); }
/// <summary> /// Loads the data and data bind. /// </summary> /// <param name="sortExpression">The sort expression.</param> private void LoadDataAndDataBind(string sortExpression) { CountryDto dto = CountryManager.GetCountries(true); if (dto.Country != null) { DataView view = dto.Country.DefaultView; view.Sort = sortExpression; MyListView.DataSource = view; } MyListView.CurrentListView.PrimaryKeyId = EcfListView.MakePrimaryKeyIdString("CountryId"); MyListView.DataBind(); }
/// <summary> /// Loads the data and data bind. /// </summary> /// <param name="sortExpression">The sort expression.</param> private void LoadDataAndDataBind(string sortExpression) { int totalRecords = 0; DataTable table = GetDataSource(out totalRecords); DataView view = table.DefaultView; view.Sort = sortExpression; MyListView.CurrentListView.PrimaryKeyId = EcfListView.MakePrimaryKeyIdString("ID", "Type", "OutlineNumber"); MyListView.DataSource = view; MyListView.DataBind(); m_TotalRecords = totalRecords; //MyListView.Grid.RecordCount = totalRecords; }
/// <summary> /// Loads the data and data bind. /// </summary> /// <param name="sortExpression">The sort expression.</param> private void LoadDataAndDataBind(string sortExpression) { WarehouseDto dto = WarehouseManager.GetWarehouseDto(); if (dto.Warehouse != null) { DataView view = dto.Warehouse.DefaultView; view.Sort = sortExpression; MyListView.DataSource = view; } MyListView.CurrentListView.PrimaryKeyId = EcfListView.MakePrimaryKeyIdString("WarehouseId"); MyListView.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 (!IsPostBack || String.Compare(Request.Form["__EVENTTARGET"], CommandManager.GetCurrent(this.Page).ID, false) == 0) { if (!IsPostBack) { MyListView2.CurrentListView.PrimaryKeyId = EcfListView.MakePrimaryKeyIdString("ID", "Type"); } //MyListView2.CurrentListView.CurrentPageSize = GetMaximumRows(); InitDataSource(_StartRowIndex, GetMaximumRows(), true, "" /*EcfListView.MakeSortExpression(EcfListView.GetSavedSorting(this.Page, MyListView2.ViewId, * new SortViewState("Type", SortDirection.Ascending)))*/); DataBind(); } }
/// <summary> /// Loads the data and data bind. /// </summary> /// <param name="sortExpression">The sort expression.</param> private void LoadDataAndDataBind(string sortExpression) { JurisdictionDto dto = JurisdictionManager.GetJurisdictions(JurisdictionType); if (dto.Jurisdiction != null) { DataView view = dto.Jurisdiction.DefaultView; view.Sort = sortExpression; MyListView.DataSource = view; } MyListView.CurrentListView.SetSortProperties(sortExpression); MyListView.CurrentListView.PrimaryKeyId = EcfListView.MakePrimaryKeyIdString("JurisdictionId", "JurisdictionType"); MyListView.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 (!IsPostBack) { MyListView1.CurrentListView.PrimaryKeyId = EcfListView.MakePrimaryKeyIdString("LogId"); InitDataSource(_StartRowIndex, GetMaximumRows(), true); DataBind(); } if (String.Compare(Request.Form["__EVENTTARGET"], CommandManager.GetCurrent(this.Page).ID, false) == 0) { InitDataSource(_StartRowIndex, GetMaximumRows(), true); DataBind(); } }
/// <summary> /// Loads the data and data bind. /// </summary> /// <param name="sortExpression">The sort expression.</param> private void LoadDataAndDataBind(string sortExpression) { PolicyDto dto = PolicyManager.GetPolicyDto(); if (dto.Policy != null && dto.Policy.Count > 0) { DataView view = null; if (String.IsNullOrEmpty(Group)) { view = dto.Policy.DefaultView; view.Sort = sortExpression; MyListView.DataSource = view; } else { // filter dto by specified group PolicyDto.GroupPolicyRow[] gpRows = (PolicyDto.GroupPolicyRow[])dto.GroupPolicy.Select(String.Format("GroupName = '{0}'", Group)); string query = ""; foreach (PolicyDto.GroupPolicyRow gpRow in gpRows) { query = String.Concat(query, String.Format("OR PolicyId={0}", gpRow.PolicyId)); } if (query.StartsWith("OR ")) { query = query.Substring(3); } else { query = "1 = 0"; } dto.Policy.DefaultView.Sort = sortExpression; PolicyDto.PolicyRow[] policyRows = (PolicyDto.PolicyRow[])dto.Policy.Select(query); MyListView.DataSource = policyRows; } } else { MyListView.DataSource = null; } MyListView.CurrentListView.PrimaryKeyId = EcfListView.MakePrimaryKeyIdString("PolicyId"); MyListView.DataBind(); }
protected void Page_Load(object sender, EventArgs e) { if (!this.IsPostBack) { this.Page.ClientScript.RegisterStartupScript(this.Page.GetType(), "SetTitleScriptKey", string.Format("CSManagementClient.SetPageTitle('{0}');", (object)this.GetPageTitle()), true); } if (this.IsPostBack && string.Compare(this.Request.Form["__EVENTTARGET"], CommandManager.GetCurrent(this.Page).ID, false) != 0) { return; } if (!this.IsPostBack) { this.MyListView.CurrentListView.PrimaryKeyId = EcfListView.MakePrimaryKeyIdString("OrderGroupId", "CustomerId"); } this.InitDataSource(this._StartRowIndex, this.GetMaximumRows(), true, ""); this.DataBind(); }
/// <summary> /// Loads the data and data bind. /// </summary> /// <param name="sortExpression">The sort expression.</param> private void LoadDataAndDataBind(string sortExpression) { IDataReader reader = mc.WorkflowStatus.LoadByWorkflowId(WorkflowId); DataTable table = ManagementHelper.ConvertToTable(reader); reader.Close(); MyListView.DataSource = table.DefaultView; if (table != null) { DataView view = table.DefaultView; view.Sort = sortExpression; MyListView.DataSource = view; } MyListView.CurrentListView.PrimaryKeyId = EcfListView.MakePrimaryKeyIdString("StatusId"); MyListView.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 (!IsPostBack || String.Compare(Request.Form["__EVENTTARGET"], CommandManager.GetCurrent(this.Page).ID, false) == 0) { if (!IsPostBack) { MyListView.CurrentListView.PrimaryKeyId = EcfListView.MakePrimaryKeyIdString("OrderGroupId", "CustomerId"); } LoadDataAndDataBind(); if (IsPostBack) { InitDataSource(_StartRowIndex, _MaximumRows, true, MyListView.CurrentListView.SortExpression); } DataBind(); } }
/// <summary> /// Loads the data and data bind. /// </summary> private void LoadDataAndDataBind(string sortExpression) { DataTable dt = NavigationManager.GetByPageId(PageId); dt.Columns.Add(new DataColumn("Name", typeof(string))); foreach (DataRow row in dt.Rows) { row["Name"] = NavigationManager.GetItemNameById((int)row["ItemId"]); } DataView view = dt.DefaultView; view.Sort = sortExpression; MyListView.DataSource = view; MyListView.CurrentListView.PrimaryKeyId = EcfListView.MakePrimaryKeyIdString("Id", "UrlUID"); MyListView.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 (!IsPostBack) { MyListView.CurrentListView.PrimaryKeyId = EcfListView.MakePrimaryKeyIdString("PrincipalId"); StringBuilder script = new StringBuilder("this.disabled = true;\r\n"); script.AppendFormat("__doPostBack('{0}', '');", btnSearch.UniqueID); btnSearch.OnClientClick = script.ToString(); DataBind(); } if (!IsPostBack) { BindOrganizationsList(); } if (String.Compare(Request.Form["__EVENTTARGET"], CommandManager.GetCurrent(this.Page).ID, false) == 0) { InitDataSource(_StartRowIndex, _MaximumRows, true, MyListView.CurrentListView.SortExpression); 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 (!IsPostBack) { MyListView.CurrentListView.PrimaryKeyId = EcfListView.MakePrimaryKeyIdString("CatalogEntryId", "ClassTypeId"); LoadDataAndDataBind(); // Dont search on first load if (IsPostBack) { InitDataSource(_StartRowIndex, _MaximumRows, true, MyListView.CurrentListView.SortExpression); } DataBind(); } if (String.Compare(Request.Form["__EVENTTARGET"], CommandManager.GetCurrent(this.Page).ID, false) == 0) { InitDataSource(_StartRowIndex, _MaximumRows, true, MyListView.CurrentListView.SortExpression); DataBind(); } }
/// <summary> /// Loads the data and data bind. /// </summary> /// <param name="sortExpression">The sort expression.</param> private void LoadDataAndDataBind(string sortExpression) { DataTable table = new DataTable(); table.Columns.Add(new DataColumn("Name", typeof(string))); string[] roles = Roles.GetAllRoles(); if (roles != null && roles.Length > 0) { foreach (string role in roles) { DataRow row = table.NewRow(); row[0] = role; table.Rows.Add(row); } DataView view = table.DefaultView; view.Sort = sortExpression; MyListView.DataSource = view; } MyListView.CurrentListView.PrimaryKeyId = EcfListView.MakePrimaryKeyIdString("Name"); MyListView.DataBind(); }
/// <summary> /// Loads the data and data bind. /// </summary> private void LoadDataAndDataBind(string sortExpression) { MyListView.CurrentListView.PrimaryKeyId = EcfListView.MakePrimaryKeyIdString("SiteId", "Name"); MyListView.DataSource = CMSContext.Current.GetSitesDto(CmsConfiguration.Instance.ApplicationId, true).Site; DataBind(); }
/// <summary> /// Loads the data and data bind. /// </summary> /// <param name="sortExpression">The sort expression.</param> private void LoadDataAndDataBind(string sortExpression) { TaxDto dto = TaxManager.GetTaxDto(null); if (dto.Tax != null) { //string taxCategoryColumnKey = "TaxCategory"; //string percentageColumnKey = "Percentage"; string taxTypeNameColumnKey = "TaxTypeName"; DataTable taxesTable = dto.Tax; //taxesTable.Columns.Add(percentageColumnKey, typeof(double)); //taxesTable.Columns.Add(taxCategoryColumnKey, typeof(string)); taxesTable.Columns.Add(taxTypeNameColumnKey, typeof(string)); /*var tbl1 = from tax in dto.Tax * join taxValue in dto.TaxValue * on tax.TaxId equals taxValue.TaxId * select new { tax.TaxId, tax.Name, tax.TaxType, tax.SortOrder, Percentage = taxValue.Percentage, TaxCategory = taxValue.TaxCategory };*/ for (int i = 0; i < dto.Tax.Rows.Count; i++) { TaxDto.TaxRow currentTaxRow = (TaxDto.TaxRow)dto.Tax.Rows[i]; switch ((TaxType)currentTaxRow.TaxType) { case TaxType.SalesTax: currentTaxRow[taxTypeNameColumnKey] = Resources.SharedStrings.Sales; break; case TaxType.ShippingTax: currentTaxRow[taxTypeNameColumnKey] = Resources.SharedStrings.Shipping; break; default: currentTaxRow[taxTypeNameColumnKey] = String.Empty; break; } } //for (int i = 0; i < dto.Tax.Rows.Count; i++) //{ // TaxDto.TaxRow currentTaxRow = (TaxDto.TaxRow)dto.Tax.Rows[i]; // var valueRow = from taxValue in dto.TaxValue where taxValue.TaxId == currentTaxRow.TaxId select taxValue; // bool fillWithEmptyValues = true; // if (valueRow != null) // { // DataView dv = valueRow.AsDataView(); // if (dv.Count > 0) // must be 1 // { // taxesTable.Rows[i][percentageColumnKey] = dv[0]["Percentage"]; // taxesTable.Rows[i][taxCategoryColumnKey] = dv[0]["TaxCategory"]; // fillWithEmptyValues = false; // } // } // if (fillWithEmptyValues) // { // taxesTable.Rows[i][percentageColumnKey] = 0; // taxesTable.Rows[i][taxCategoryColumnKey] = ""; // } //} DataView view = taxesTable.DefaultView; view.Sort = sortExpression; MyListView.DataSource = view; } MyListView.CurrentListView.PrimaryKeyId = EcfListView.MakePrimaryKeyIdString("TaxId"); MyListView.DataBind(); }
/// <summary> /// Loads the data and data bind. /// </summary> /// <param name="sortExpression">The sort expression.</param> private void LoadDataAndDataBind(string sortExpression) { MyListView.CurrentListView.PrimaryKeyId = EcfListView.MakePrimaryKeyIdString("Id"); MyListView.DataSource = MetaField.GetList(ProfileContext.MetaDataContext, FieldNamespace); MyListView.DataBind(); }