protected void Display_All() { System.Collections.Generic.List<TaxClassData> TaxClassList = new System.Collections.Generic.List<TaxClassData>(); Ektron.Cms.Common.Criteria<TaxClassProperty> TaxClasscriteria = new Ektron.Cms.Common.Criteria<TaxClassProperty>(TaxClassProperty.Name, Ektron.Cms.Common.EkEnumeration.OrderByDirection.Ascending); Ektron.Cms.Common.Criteria<TaxRateProperty> taxCriteria = new Ektron.Cms.Common.Criteria<TaxRateProperty>(TaxRateProperty.TaxClassName, Ektron.Cms.Common.EkEnumeration.OrderByDirection.Ascending); Ektron.Cms.Common.Criteria<TaxRateProperty> postalCriteria = new Ektron.Cms.Common.Criteria<TaxRateProperty>(TaxRateProperty.PostalCode, EkEnumeration.OrderByDirection.Ascending); CountryApi m_refCountryTaxRate = new CountryApi(); int page_Data = _CurrentPageNumber; int i = 0; TaxApi taxApi = new TaxApi(); List<TaxRateData> postalRateList; int iCount = 0; int k = 0; int p = 0; int q = 0; int r = 0; dg_viewall.AutoGenerateColumns = false; dg_viewall.Columns.Clear(); _Criteria.PagingInfo.RecordsPerPage = 10; taxCriteria.PagingInfo.RecordsPerPage = 10; taxCriteria.Filters.Capacity = 1000; ///'' postalCriteria.AddFilter(TaxRateProperty.TaxTypeId, CriteriaFilterOperator.EqualTo, TaxRateType.PostalSalesTax); TaxClassList = _TaxClassApi.GetList(TaxClasscriteria); int iCount1 = System.Convert.ToInt32(taxApi.GetList(postalCriteria).Count() / TaxClassList.Count); int totalPages = postalCriteria.PagingInfo.TotalPages; postalCriteria.PagingInfo.CurrentPage = _CurrentPageNumber; postalRateList = taxApi.GetList(postalCriteria); iCount = System.Convert.ToInt32(postalRateList.Count / TaxClassList.Count); string[] Postal = new string[postalRateList.Count - 1 + 1]; long[] Region = new long[postalRateList.Count - 1 + 1]; foreach (PostalCodeTaxRateData PostalRate in postalRateList) { Postal[k] = PostalRate.PostalCode; Region[k] = PostalRate.TypeItemId; k++; } string[] zipcode = new string[iCount + 1]; long[] regionId = new long[iCount + 1]; if (Region.Length > 0) { regionId[p] = Region[r]; } if (Postal.Length > 0) { zipcode[q] = Postal[p]; } q++; r++; for (p = 1; p <= postalRateList.Count - 1; p++) { if (Postal[p] != Postal[p - 1]) { zipcode[q] = Postal[p]; q++; } } for (p = 1; p <= postalRateList.Count - 1; p++) { if (Region[p] != Region[p - 1]) { regionId[r] = Region[p]; r++; } } ///' //_TotalPagesNumber = System.Convert.ToInt32(System.Math.Ceiling(Convert.ToDouble(iCount1 / 10))); if (totalPages <= 1) { TotalPages.Visible = false; CurrentPage.Visible = false; lnkBtnPreviousPage.Visible = false; NextPage.Visible = false; LastPage.Visible = false; FirstPage.Visible = false; PageLabel.Visible = false; OfLabel.Visible = false; } else { lnkBtnPreviousPage.Enabled = true; FirstPage.Enabled = true; LastPage.Enabled = true; NextPage.Enabled = true; TotalPages.Visible = true; CurrentPage.Visible = true; lnkBtnPreviousPage.Visible = true; NextPage.Visible = true; LastPage.Visible = true; FirstPage.Visible = true; PageLabel.Visible = true; OfLabel.Visible = true; //TotalPages.Text = (System.Math.Ceiling(Convert.ToDouble(_TotalPagesNumber))).ToString(); TotalPages.Text = totalPages.ToString(); TotalPages.ToolTip = TotalPages.Text; CurrentPage.Text = _CurrentPageNumber.ToString(); CurrentPage.ToolTip = CurrentPage.Text; if (_CurrentPageNumber == 1) { lnkBtnPreviousPage.Enabled = false; FirstPage.Enabled = false; } else if (_CurrentPageNumber == _TotalPagesNumber) { NextPage.Enabled = false; LastPage.Enabled = false; } } System.Web.UI.WebControls.BoundColumn colBound = new System.Web.UI.WebControls.BoundColumn(); colBound.DataField = "Id"; colBound.HeaderText = m_refMsg.GetMessage("generic id"); colBound.ItemStyle.Wrap = false; colBound.ItemStyle.VerticalAlign = VerticalAlign.Top; colBound.ItemStyle.HorizontalAlign = HorizontalAlign.Left; dg_viewall.Columns.Add(colBound); colBound = new System.Web.UI.WebControls.BoundColumn(); colBound.DataField = "Postal Code"; colBound.HeaderText = m_refMsg.GetMessage("lbl address postal"); // + "(" + m_refMsg.GetMessage("lbl view tax rate for region") + ")"; colBound.ItemStyle.Wrap = false; colBound.ItemStyle.VerticalAlign = VerticalAlign.Top; colBound.ItemStyle.HorizontalAlign = HorizontalAlign.Left; dg_viewall.Columns.Add(colBound); dg_viewall.BorderColor = System.Drawing.Color.White; DataTable dt = new DataTable(); DataRow dr; dt.Columns.Add(new DataColumn("Id", typeof(string))); dt.Columns.Add(new DataColumn("Postal Code", typeof(string))); if (!(postalRateList == null)) { for (i = 0; i <= (zipcode.Length - 1); i++) { if (!string.IsNullOrEmpty(zipcode[i])) { dr = dt.NewRow(); dr[0] = "<a href=\"postaltaxtables.aspx?action=View&postalid=" + zipcode[i].ToString() + "&id=" + regionId[i] + "\">" + regionId[i] + "</a>"; dr[1] = "<a onmouseover=\"expandcontent(\'sc" + i + "\')\" onmouseout=\"expandcontent(\'sc" + i + "\')\" href=\"postaltaxtables.aspx?action=View&postalid=" + zipcode[i].ToString() + "&id=" + regionId[i] + "\">" + zipcode[i] + "</a>"; dr[1] += "<div class=\"switchcontent\" style=\"position:absolute;\" id=\"sc" + i + "\">"; dr[1] += "<table>"; foreach (TaxClassData taxClass in TaxClassList) { dr[1] += "<tr><td width=\"50%\"><label id=\"" + taxClass.Name + "\">" + taxClass.Name + "</label></td>"; dr[1] += "<td width=\"20px\"><label id=\"value\">" + GetRate(taxClass.Id, regionId[i]) * 100 + "</label>" + "<label id=\"lblPercentage\">" + " %" + "</label></td></tr>"; } dr[1] += "</table></div>"; dt.Rows.Add(dr); } } } DataView dv = new DataView(dt); dg_viewall.DataSource = dv; dg_viewall.DataBind(); }
protected void Display_AddEdit() { int page_data = _CurrentPageNumber; Ektron.Cms.Common.Criteria<TaxClassProperty> TaxClasscriteria = new Ektron.Cms.Common.Criteria<TaxClassProperty>(TaxClassProperty.Name, Ektron.Cms.Common.EkEnumeration.OrderByDirection.Ascending); System.Collections.Generic.List<TaxClassData> TaxClassList = new System.Collections.Generic.List<TaxClassData>(); Ektron.Cms.Common.Criteria<TaxRateProperty> postalCriteria = new Ektron.Cms.Common.Criteria<TaxRateProperty>(TaxRateProperty.PostalCode, EkEnumeration.OrderByDirection.Ascending); string postalCode = "0"; long id = 0; TaxApi taxApi = new TaxApi(); RegionData rRegion = new RegionData(); Ektron.Cms.Common.Criteria<RegionProperty> criteria = new Ektron.Cms.Common.Criteria<RegionProperty>(RegionProperty.Name, Ektron.Cms.Common.EkEnumeration.OrderByDirection.Ascending); int cCountryId = 0; int txtClassList = 0; Util_BindCountries(); if (Request.QueryString["postalid"] != "") { postalCode = Request.QueryString["postalid"]; } if (Request.QueryString["id"] != "") { id = Convert.ToInt64(Request.QueryString["id"]); } postalCriteria.PagingInfo.CurrentPage = page_data; postalCriteria.AddFilter(TaxRateProperty.TaxTypeId, CriteriaFilterOperator.EqualTo, TaxRateType.PostalSalesTax); List<TaxRateData> postalRateList; postalRateList = taxApi.GetList(postalCriteria); TaxClassList = _TaxClassApi.GetList(TaxClasscriteria); txt_name.Text = postalCode; if (txt_name.Text == "0" || 0 == txt_name.Text.Length) { txt_name.Enabled = true; } else { txt_name.Enabled = false; } lbl_id.Text = id.ToString(); _RegionList = _RegionApi.GetList(criteria); cCountryId = System.Convert.ToInt32(drp_country.SelectedValue); Util_BindRegions(cCountryId); ltr_txtClass.Text = "<table class=\"ektronGrid\">"; for (txtClassList = 0; txtClassList <= TaxClassList.Count - 1; txtClassList++) { PostalCodeTaxRateData postalRegion = new PostalCodeTaxRateData(); postalRegion = (PostalCodeTaxRateData)taxApi.GetItemByPostalId(TaxClassList[txtClassList].Id, id); if (postalRegion != null) { criteria.AddFilter(RegionProperty.Id, CriteriaFilterOperator.EqualTo, postalRegion.RegionId); _RegionList = _RegionApi.GetList(criteria); drp_region.SelectedValue = _RegionList[0].Id.ToString(); cCountryId = System.Convert.ToInt32(_RegionList[0].CountryId); drp_country.SelectedValue = cCountryId.ToString(); Util_BindRegions(cCountryId); } ltr_txtClass.Text += "<tr>"; ltr_txtClass.Text += " <td class=\"label\">" + TaxClassList[txtClassList].Name + "</td>"; if (taxApi.GetItemByPostalId(TaxClassList[txtClassList].Id, id) == null) { ltr_txtClass.Text += " <td class=\"value\">"; ltr_txtClass.Text += " <input type=\"text\" name=\"txtClassRate" + txtClassList + "\" id=\"txtClassRate" + txtClassList + "\" value=\"0\" />%"; ltr_txtClass.Text += " </td>"; } else { ltr_txtClass.Text += " <td class=\"value\">"; ltr_txtClass.Text += " <input type=\"text\" name=\"txtClassRate" + txtClassList + "\" id=\"txtClassRate" + txtClassList + "\" value=\"" + taxApi.GetItemByPostalId(TaxClassList[txtClassList].Id, id).Rate * 100 + "\"/>%"; ltr_txtClass.Text += " </td>"; } ltr_txtClass.Text += "</tr>"; } ltr_txtClass.Text += "</table>"; tr_id.Visible = m_iID > 0; pnl_view.Visible = true; pnl_viewall.Visible = false; if (this.m_iID > 0) { drp_country.Enabled = false; drp_region.Enabled = false; } TotalPages.Visible = false; CurrentPage.Visible = false; lnkBtnPreviousPage.Visible = false; NextPage.Visible = false; LastPage.Visible = false; FirstPage.Visible = false; PageLabel.Visible = false; OfLabel.Visible = false; }
private void Display_DeleteEntries() { CatalogEntry CatalogManager = new CatalogEntry(_ContentApi.RequestInformationRef); System.Collections.Generic.List<EntryData> entryList = new System.Collections.Generic.List<EntryData>(); Ektron.Cms.Common.Criteria<EntryProperty> entryCriteria = new Ektron.Cms.Common.Criteria<EntryProperty>(); entryCriteria.AddFilter(EntryProperty.CatalogId, Ektron.Cms.Common.CriteriaFilterOperator.EqualTo, _Id); if (_ContentApi.RequestInformationRef.ContentLanguage > 0) { entryCriteria.AddFilter(EntryProperty.LanguageId, Ektron.Cms.Common.CriteriaFilterOperator.EqualTo, _ContentApi.RequestInformationRef.ContentLanguage); } entryCriteria.OrderByDirection = Ektron.Cms.Common.EkEnumeration.OrderByDirection.Ascending; entryCriteria.OrderByField = EntryProperty.Title; entryCriteria.PagingInfo.RecordsPerPage = _ContentApi.RequestInformationRef.PagingSize; entryCriteria.PagingInfo.CurrentPage = _CurrentPageId; if (_ShowArchive == false) { entryCriteria.AddFilter(EntryProperty.IsArchived, Ektron.Cms.Common.CriteriaFilterOperator.EqualTo, false); } else { entryCriteria.AddFilter(EntryProperty.IsArchived, Ektron.Cms.Common.CriteriaFilterOperator.EqualTo, true); } entryList = CatalogManager.GetList(entryCriteria); _TotalPagesNumber = System.Convert.ToInt32(entryCriteria.PagingInfo.TotalPages); DeleteContentByCategoryToolBar(); PageSettings(); Populate_DeleteCatalogGrid(entryList); folder_id.Value =Convert.ToString(_Id); }
protected void Display_All() { System.Collections.Generic.List<TaxRateData> RateList = new System.Collections.Generic.List<TaxRateData>(); System.Collections.Generic.List<TaxClassData> TaxClassList = new System.Collections.Generic.List<TaxClassData>(); Ektron.Cms.Common.Criteria<TaxClassProperty> TaxClasscriteria = new Ektron.Cms.Common.Criteria<TaxClassProperty>(TaxClassProperty.Name, Ektron.Cms.Common.EkEnumeration.OrderByDirection.Ascending); Ektron.Cms.Common.Criteria<CountryProperty> countryCriteria = new Ektron.Cms.Common.Criteria<CountryProperty>(CountryProperty.Name, Ektron.Cms.Common.EkEnumeration.OrderByDirection.Ascending); int i = 0; dg_viewall.PageSize = m_refContentApi.RequestInformationRef.PagingSize; countryCriteria.PagingInfo.RecordsPerPage = m_refContentApi.RequestInformationRef.PagingSize; countryCriteria.PagingInfo.CurrentPage = _CurrentPageNumber; _TaxApi = new TaxApi(); TaxClassList = _TaxClassApi.GetList(TaxClasscriteria); dg_viewall.AutoGenerateColumns = false; dg_viewall.Columns.Clear(); System.Collections.Generic.List<CountryData> CountryRateList = new System.Collections.Generic.List<CountryData>(); CountryApi m_refCountryTaxRate = new CountryApi(); m_refCountryTaxRate = new CountryApi(); countryCriteria.Condition = LogicalOperation.Or; if (_SearchCriteria != "") { countryCriteria.AddFilter(CountryProperty.Name, Ektron.Cms.Common.CriteriaFilterOperator.Contains, _SearchCriteria); } if (_SearchCriteria != "") { countryCriteria.AddFilter(CountryProperty.LongIsoCode, Ektron.Cms.Common.CriteriaFilterOperator.Contains, _SearchCriteria); } if (_SearchCriteria != "") { countryCriteria.AddFilter(CountryProperty.ShortIsoCode, Ektron.Cms.Common.CriteriaFilterOperator.Contains, _SearchCriteria); } CountryRateList = m_refCountryTaxRate.GetList(countryCriteria); _TotalPagesNumber = System.Convert.ToInt32(countryCriteria.PagingInfo.TotalPages); TotalPages.ToolTip = _TotalPagesNumber.ToString(); if (_TotalPagesNumber <= 1) { TotalPages.Visible = false; CurrentPage.Visible = false; lnkBtnPreviousPage.Visible = false; NextPage.Visible = false; LastPage.Visible = false; FirstPage.Visible = false; PageLabel.Visible = false; OfLabel.Visible = false; } else { lnkBtnPreviousPage.Enabled = true; FirstPage.Enabled = true; LastPage.Enabled = true; NextPage.Enabled = true; TotalPages.Visible = true; CurrentPage.Visible = true; lnkBtnPreviousPage.Visible = true; NextPage.Visible = true; LastPage.Visible = true; FirstPage.Visible = true; PageLabel.Visible = true; OfLabel.Visible = true; TotalPages.Text = (System.Math.Ceiling(Convert.ToDouble(_TotalPagesNumber))).ToString(); TotalPages.ToolTip = TotalPages.Text; CurrentPage.Text = _CurrentPageNumber.ToString(); CurrentPage.ToolTip = CurrentPage.Text; if (_CurrentPageNumber == 1) { lnkBtnPreviousPage.Enabled = false; FirstPage.Enabled = false; } else if (_CurrentPageNumber == _TotalPagesNumber) { NextPage.Enabled = false; LastPage.Enabled = false; } } System.Web.UI.WebControls.BoundColumn colBound = new System.Web.UI.WebControls.BoundColumn(); colBound.DataField = "Id"; colBound.HeaderText = this.GetMessage("generic id"); colBound.ItemStyle.Wrap = false; colBound.ItemStyle.VerticalAlign = VerticalAlign.Top; colBound.ItemStyle.HorizontalAlign = HorizontalAlign.Left; dg_viewall.Columns.Add(colBound); colBound = new System.Web.UI.WebControls.BoundColumn(); colBound.DataField = "Name"; colBound.HeaderText = this.GetMessage("generic name")+" (" + m_refMsg.GetMessage("lbl view tax rate for region") + ")"; colBound.ItemStyle.Wrap = false; colBound.ItemStyle.VerticalAlign = VerticalAlign.Top; colBound.ItemStyle.HorizontalAlign = HorizontalAlign.Left; dg_viewall.Columns.Add(colBound); colBound = new System.Web.UI.WebControls.BoundColumn(); colBound.DataField = "Enabled"; colBound.HeaderText = this.GetMessage("enabled"); colBound.ItemStyle.Wrap = false; colBound.HeaderStyle.HorizontalAlign = HorizontalAlign.Center; colBound.ItemStyle.VerticalAlign = VerticalAlign.Top; colBound.ItemStyle.HorizontalAlign = HorizontalAlign.Center; dg_viewall.Columns.Add(colBound); colBound = new System.Web.UI.WebControls.BoundColumn(); colBound.DataField = "Code"; colBound.HeaderText = this.GetMessage("lbl code"); colBound.ItemStyle.Wrap = false; colBound.ItemStyle.VerticalAlign = VerticalAlign.Top; colBound.ItemStyle.HorizontalAlign = HorizontalAlign.Left; dg_viewall.Columns.Add(colBound); dg_viewall.BorderColor = System.Drawing.Color.White; DataTable dt = new DataTable(); DataRow dr; dt.Columns.Add(new DataColumn("Id", typeof(string))); dt.Columns.Add(new DataColumn("Name", typeof(string))); dt.Columns.Add(new DataColumn("Enabled", typeof(string))); dt.Columns.Add(new DataColumn("Code", typeof(string))); dt.Columns.Add(new DataColumn("Country", typeof(string))); if (!(CountryRateList == null)) { for (i = 0; i <= (CountryRateList.Count - 1); i++) { dr = dt.NewRow(); dr[0] = "<a href=\"countrytaxtables.aspx?action=View&id=" + CountryRateList[i].Id + "\">" + CountryRateList[i].Id + "</a>"; dr[1] = "<a href=\"#ExpandContent\" onclick=\"expandcontent(\'sc" + i + "\');return false;\">" + CountryRateList[i].Name + "</a><br />"; dr[1] += "<div class=\"switchcontent\" id=\"sc" + i + "\"><table class=\"ektronForm\"><a onclick=\"expandcontent(\'sc" + i + "\')\" href=\"countrytaxtables.aspx?action=View&id=" + CountryRateList[i].Id + "\">" + m_refMsg.GetMessage("lbl view tax rate") + "</a><br />"; foreach (TaxClassData taxClass in TaxClassList) { dr[1] += "<tr><td><br/><label class=\"label\" id=\"" + taxClass.Name + "\">" + taxClass.Name + "</label></td>"; dr[1] += "<td><input type=\"text\" size=\"10\" align=\"right\" name=\"value\" readonly=\"true\" id=\"value\" value=\"" + GetRate(taxClass.Id, CountryRateList[i].Id) * 100 + "\"/>" + "<label id=\"lblPercentage\">" + "%" + "</label></td></tr>"; } dr[1] += "</table></div>"; dr[2] = "<input type=\"CheckBox\" ID=\"chk_enabled" + i + "\" disabled=\"true\" " + ((CountryRateList[i].Enabled) ? "Checked=\"checked\"" : "") + "/>"; dr[3] = "<a href=\"countrytaxtables.aspx?action=View&id=" + CountryRateList[i].Id + "\">" + CountryRateList[i].ShortIsoCode + "</a>"; dt.Rows.Add(dr); } } DataView dv = new DataView(dt); dg_viewall.DataSource = dv; dg_viewall.DataBind(); }
protected void Display_All() { System.Collections.Generic.List<RegionData> RegionList = new System.Collections.Generic.List<RegionData>(); Ektron.Cms.Common.Criteria<RegionProperty> criteria = new Ektron.Cms.Common.Criteria<RegionProperty>(RegionProperty.Name, Ektron.Cms.Common.EkEnumeration.OrderByDirection.Ascending); int i = 0; dg_viewall.PageSize = m_refContentApi.RequestInformationRef.PagingSize; dg_viewall.AutoGenerateColumns = false; dg_viewall.Columns.Clear(); criteria.PagingInfo.RecordsPerPage = m_refContentApi.RequestInformationRef.PagingSize; criteria.PagingInfo.CurrentPage = _currentPageNumber; if (searchCriteria != "") { criteria.AddFilter(RegionProperty.Name, Ektron.Cms.Common.CriteriaFilterOperator.Contains, searchCriteria); } RegionList = m_refRegion.GetList(criteria); TotalPagesNumber = System.Convert.ToInt32(criteria.PagingInfo.TotalPages); if (TotalPagesNumber <= 1) { TotalPages.Visible = false; CurrentPage.Visible = false; lnkBtnPreviousPage.Visible = false; NextPage.Visible = false; LastPage.Visible = false; FirstPage.Visible = false; PageLabel.Visible = false; OfLabel.Visible = false; } else { lnkBtnPreviousPage.Enabled = true; FirstPage.Enabled = true; LastPage.Enabled = true; NextPage.Enabled = true; TotalPages.Visible = true; CurrentPage.Visible = true; lnkBtnPreviousPage.Visible = true; NextPage.Visible = true; LastPage.Visible = true; FirstPage.Visible = true; PageLabel.Visible = true; OfLabel.Visible = true; TotalPages.Text = (System.Math.Ceiling(Convert.ToDouble(TotalPagesNumber))).ToString(); TotalPages.ToolTip = TotalPages.Text; CurrentPage.Text = _currentPageNumber.ToString(); CurrentPage.ToolTip = CurrentPage.Text; if (_currentPageNumber == 1) { lnkBtnPreviousPage.Enabled = false; FirstPage.Enabled = false; } else if (_currentPageNumber == TotalPagesNumber) { NextPage.Enabled = false; LastPage.Enabled = false; } } System.Web.UI.WebControls.BoundColumn colBound = new System.Web.UI.WebControls.BoundColumn(); colBound.DataField = "Id"; colBound.HeaderText = this.GetMessage("generic id"); colBound.ItemStyle.Wrap = false; colBound.ItemStyle.VerticalAlign = VerticalAlign.Top; colBound.ItemStyle.HorizontalAlign = HorizontalAlign.Left; colBound.HeaderStyle.CssClass = "title-header"; dg_viewall.Columns.Add(colBound); colBound = new System.Web.UI.WebControls.BoundColumn(); colBound.DataField = "Name"; colBound.HeaderText = this.GetMessage("lbl address name"); colBound.ItemStyle.Wrap = false; colBound.ItemStyle.VerticalAlign = VerticalAlign.Top; colBound.ItemStyle.HorizontalAlign = HorizontalAlign.Left; colBound.HeaderStyle.CssClass = "title-header"; dg_viewall.Columns.Add(colBound); colBound = new System.Web.UI.WebControls.BoundColumn(); colBound.DataField = "Enabled"; colBound.HeaderText = this.GetMessage("lbl overlay data enabled"); colBound.ItemStyle.Wrap = false; colBound.HeaderStyle.HorizontalAlign = HorizontalAlign.Center; colBound.ItemStyle.VerticalAlign = VerticalAlign.Top; colBound.ItemStyle.HorizontalAlign = HorizontalAlign.Center; colBound.HeaderStyle.CssClass = "title-header"; dg_viewall.Columns.Add(colBound); colBound = new System.Web.UI.WebControls.BoundColumn(); colBound.DataField = "Code"; colBound.HeaderText = this.GetMessage("lbl code"); colBound.ItemStyle.Wrap = false; colBound.ItemStyle.VerticalAlign = VerticalAlign.Top; colBound.ItemStyle.HorizontalAlign = HorizontalAlign.Left; colBound.HeaderStyle.CssClass = "title-header"; dg_viewall.Columns.Add(colBound); colBound = new System.Web.UI.WebControls.BoundColumn(); colBound.DataField = "Country"; colBound.HeaderText = this.GetMessage("lbl address country"); colBound.ItemStyle.Wrap = false; colBound.ItemStyle.VerticalAlign = VerticalAlign.Top; colBound.ItemStyle.HorizontalAlign = HorizontalAlign.Left; colBound.HeaderStyle.CssClass = "title-header"; dg_viewall.Columns.Add(colBound); dg_viewall.BorderColor = System.Drawing.Color.White; DataTable dt = new DataTable(); DataRow dr; dt.Columns.Add(new DataColumn("Id", typeof(string))); dt.Columns.Add(new DataColumn("Name", typeof(string))); dt.Columns.Add(new DataColumn("Enabled", typeof(string))); dt.Columns.Add(new DataColumn("Code", typeof(string))); dt.Columns.Add(new DataColumn("Country", typeof(string))); if (!(RegionList == null)) { for (i = 0; i <= RegionList.Count - 1; i++) { dr = dt.NewRow(); dr[0] = "<a href=\"region.aspx?action=View&id=" + RegionList[i].Id + "\">" + RegionList[i].Id + "</a>"; dr[1] = "<a href=\"region.aspx?action=View&id=" + RegionList[i].Id + "\">" + RegionList[i].Name + "</a>"; dr[2] = "<input type=\"CheckBox\" ID=\"chk_enabled" + i + "\" disabled=\"true\" " + ((RegionList[i].Enabled) ? "Checked=\"checked\"" : "") + "/>"; dr[3] = "<a href=\"region.aspx?action=View&id=" + RegionList[i].Id + "\">" + RegionList[i].Code + "</a>"; dr[4] = "<label id=\"lblCountry\" >" + Util_GetCountryName(System.Convert.ToInt32(RegionList[i].CountryId)) + "</label>"; dt.Rows.Add(dr); } } DataView dv = new DataView(dt); dg_viewall.DataSource = dv; dg_viewall.DataBind(); }
protected void Display_Commerce() { Ektron.Cms.Commerce.OrderApi orderApi = new Ektron.Cms.Commerce.OrderApi(); Ektron.Cms.Common.Criteria<OrderProperty> reportCriteria = new Ektron.Cms.Common.Criteria<OrderProperty>(); reportCriteria.AddFilter(OrderProperty.ProductId, Ektron.Cms.Common.CriteriaFilterOperator.EqualTo, m_iID); reportData = orderApi.GetReport(reportCriteria); if (reportData.Orders.Count > 0) { if (Request.Url.Scheme.ToLower() != "https") { this.Util_BindData(); this.ltr_description.Text = "<img src=\"http://chart.apis.google.com/chart?cht=p3&chd=t:" + reportData.WithCoupons + "," + reportData.WithoutCoupons + "&chs=250x75&chl=Coupon-" + reportData.WithCoupons + "|No Coupon-" + reportData.WithoutCoupons + "\"/>"; this.ltr_description.Text += "<br/><img src=\"http://chart.apis.google.com/chart?cht=p3&chd=t:" + reportData.ByNewCustomers + "," + reportData.ByReturningCustomers + "&chs=250x75&chl=New-" + reportData.ByNewCustomers + "|Returning-" + reportData.ByReturningCustomers + "\"/>"; } else { TrendTimeLineChart.Visible = false; ltr_description.Visible = false; } dg_cctypes.DataSource = reportData.Orders; dg_cctypes.DataBind(); Util_ShowSites(); } else { ltr_noOrders.Text = m_refMsg.GetMessage("lbl no orders"); TrendTimeLineChart.Visible = false; ltr_description.Visible = false; } }
private void DisplayUsers() { List<CustomerData> customerList = new List<CustomerData>(); Ektron.Cms.Common.Criteria<CustomerProperty> CustomerCriteria = new Ektron.Cms.Common.Criteria<CustomerProperty>(CustomerProperty.UserName, Ektron.Cms.Common.EkEnumeration.OrderByDirection.Ascending); //CustomerCriteria.AddFilter(CustomerProperty.TotalOrders, CriteriaFilterOperator.GreaterThan, 0) //CustomerCriteria.AddFilter(CustomerProperty.TotalOrderValue, CriteriaFilterOperator.GreaterThan, 0) CustomerManager = new CustomerApi(); m_strKeyWords = Request.Form["txtSearch"]; m_strSelectedItem = Request.Form["searchlist"]; switch (m_strSelectedItem) { //Case "-1 selected " ' All // CustomerCriteria.AddFilter(CustomerProperty.FirstName, CriteriaFilterOperator.Contains, m_strKeyWords) // CustomerCriteria.AddFilter(CustomerProperty.LastName, CriteriaFilterOperator.Contains, m_strKeyWords) // CustomerCriteria.AddFilter(CustomerProperty.UserName, CriteriaFilterOperator.Contains, m_strKeyWords) //Case "-1" ' All // CustomerCriteria.AddFilter(CustomerProperty.FirstName, CriteriaFilterOperator.Contains, m_strKeyWords) // CustomerCriteria.AddFilter(CustomerProperty.LastName, CriteriaFilterOperator.Contains, m_strKeyWords) // CustomerCriteria.AddFilter(CustomerProperty.UserName, CriteriaFilterOperator.Contains, m_strKeyWords) case "last_name": // Last Name CustomerCriteria.AddFilter(CustomerProperty.LastName, CriteriaFilterOperator.Contains, m_strKeyWords); break; case "first_name": // First Name CustomerCriteria.AddFilter(CustomerProperty.FirstName, CriteriaFilterOperator.Contains, m_strKeyWords); break; case "user_name": // User Name CustomerCriteria.AddFilter(CustomerProperty.UserName, CriteriaFilterOperator.Contains, m_strKeyWords); break; } customerList = CustomerManager.GetList(CustomerCriteria); ViewAllUsersToolBar(); literal1.Text = ""; if (customerList != null) { if (customerList.Count != 0) { if (customerList.Count > 0) { dg_customers.DataSource = customerList; dg_customers.DataBind(); } else { literal1.Text = "<br/><label style=\"color:#2E6E9E;\" id=\"lbl_noUsers\">" + this.GetMessage("lbl no users") + "</label>"; } } else { literal1.Text = "<br/><label style=\"color:#2E6E9E;\" id=\"lbl_noUsers\">" + this.GetMessage("lbl no users") + "</label>"; } } else { literal1.Text = "<br/><label style=\"color:#2E6E9E;\" id=\"lbl_noUsers\">" + this.GetMessage("lbl no users") + "</label>"; } dg_customers.DataSource = customerList; dg_customers.DataBind(); }
private void Display_EntryTab() { System.Collections.Generic.List<TaxClassData> TaxClassList = new System.Collections.Generic.List<TaxClassData>(); Ektron.Cms.Common.Criteria<TaxClassProperty> criteria = new Ektron.Cms.Common.Criteria<TaxClassProperty>(TaxClassProperty.Id, Ektron.Cms.Common.EkEnumeration.OrderByDirection.Ascending); //Excluding the shipping Tax class that comes in to the system.5 is the shipping tax id. criteria.AddFilter(TaxClassProperty.Id, CriteriaFilterOperator.NotEqualTo, 5); m_refTaxClass = new TaxClass(this.m_refContentApi.RequestInformationRef); TaxClassList = m_refTaxClass.GetList(criteria); drp_taxclass.DataTextField = "name"; drp_taxclass.DataValueField = "id"; drp_taxclass.DataSource = TaxClassList; drp_taxclass.DataBind(); if (m_refContentApi.RequestInformationRef.MeasurementSystem == Ektron.Cms.Common.EkEnumeration.MeasurementSystem.English) { ltr_heightmeasure.Text = GetMessage("lbl inches"); ltr_lengthmeasure.Text = GetMessage("lbl inches"); ltr_widthmeasure.Text = GetMessage("lbl inches"); ltr_weightmeasure.Text = GetMessage("lbl pounds"); } else { ltr_heightmeasure.Text = GetMessage("lbl centimeters"); ltr_lengthmeasure.Text = GetMessage("lbl centimeters"); ltr_widthmeasure.Text = GetMessage("lbl centimeters"); ltr_weightmeasure.Text = GetMessage("lbl kilograms"); } Util_BindFieldList(); if (entry_edit_data != null) { txt_sku.Text = entry_edit_data.Sku; txt_quantity.Text = entry_edit_data.QuantityMultiple.ToString(); drp_taxclass.SelectedValue = entry_edit_data.TaxClassId.ToString(); chk_avail.Checked = entry_edit_data.IsArchived; // chk_markdel.Checked = entry_edit_data.IsMarkedForDeletion if (entry_edit_data.Id == 0) { chk_buyable.Checked = true; } if (entry_edit_data.IsArchived) { Page.ClientScript.RegisterStartupScript(Page.GetType(), "chk_buyable", "document.getElementById(\'chk_buyable\').disabled = true;", true); } if (!entry_edit_data.IsArchived) { chk_buyable.Checked = entry_edit_data.IsBuyable; } else { chk_buyable.Checked = false; } chk_tangible.Checked = entry_edit_data.IsTangible; chk_disableInv.Enabled = Util_IsEditable(); if (Util_IsEditable() == false || !entry_edit_data.IsTangible) { txt_height.Enabled = false; txt_length.Enabled = false; txt_width.Enabled = false; txt_weight.Enabled = false; } txt_height.Text = entry_edit_data.Dimensions.Height.ToString(); txt_length.Text = entry_edit_data.Dimensions.Length.ToString(); txt_width.Text = entry_edit_data.Dimensions.Width.ToString(); txt_weight.Text = entry_edit_data.Weight.Amount.ToString(); InventoryApi inventoryApi = new InventoryApi(); InventoryData inventoryData = inventoryApi.GetInventory(entry_edit_data.Id); chk_disableInv.Checked = entry_edit_data.DisableInventoryManagement; chk_disableInv.Enabled = Util_IsEditable(); if (Util_IsEditable() == false || entry_edit_data.DisableInventoryManagement) { txt_instock.Enabled = false; txt_onorder.Enabled = false; txt_reorder.Enabled = false; } txt_instock.Text = inventoryData.UnitsInStock.ToString(); txt_onorder.Text = inventoryData.UnitsOnOrder.ToString(); txt_reorder.Text = inventoryData.ReorderLevel.ToString(); } else { txt_height.Enabled = false; txt_length.Enabled = false; txt_width.Enabled = false; txt_weight.Enabled = false; txt_instock.Enabled = false; txt_onorder.Enabled = false; txt_reorder.Enabled = false; } Util_ToggleProperties(Util_IsEditable()); }
protected void Display_ViewAddress(bool WithEdit) { pnl_view.Visible = false; pnl_viewall.Visible = false; AddressData aAddress = null; RegionManager = new RegionApi(); Ektron.Cms.Common.Criteria<RegionProperty> regioncriteria = new Ektron.Cms.Common.Criteria<RegionProperty>(RegionProperty.Name, Ektron.Cms.Common.EkEnumeration.OrderByDirection.Ascending); if (!(this.m_iID > 0)) { regioncriteria.AddFilter(RegionProperty.CountryId, CriteriaFilterOperator.EqualTo, drp_address_country.SelectedIndex); } regioncriteria.PagingInfo.RecordsPerPage = 1000; drp_address_region.DataTextField = "Name"; drp_address_region.DataValueField = "Id"; drp_address_region.DataSource = RegionManager.GetList(regioncriteria); drp_address_region.DataBind(); Ektron.Cms.Common.Criteria<CountryProperty> addresscriteria = new Ektron.Cms.Common.Criteria<CountryProperty>(CountryProperty.Name, Ektron.Cms.Common.EkEnumeration.OrderByDirection.Ascending); addresscriteria.PagingInfo.RecordsPerPage = 1000; drp_address_country.DataTextField = "Name"; drp_address_country.DataValueField = "Id"; drp_address_country.DataSource = CountryManager.GetList(addresscriteria); drp_address_country.DataBind(); if (this.m_iID > 0) { cCustomer = CustomerManager.GetItem(this.m_iCustomerId); aAddress = AddressManager.GetItem(this.m_iID); regioncriteria.AddFilter(RegionProperty.CountryId, CriteriaFilterOperator.EqualTo, aAddress.Country.Id); drp_address_region.DataSource = RegionManager.GetList(regioncriteria); ltr_address_id.Text = aAddress.Id.ToString(); txt_address_name.Text = aAddress.Name; txt_address_company.Text = aAddress.Company; txt_address_line1.Text = aAddress.AddressLine1; txt_address_line2.Text = aAddress.AddressLine2; txt_address_city.Text = aAddress.City; drp_address_country.SelectedIndex = FindItem(aAddress.Country.Id, "country"); Util_BindRegions(aAddress.Country.Id); drp_address_region.SelectedValue = aAddress.Region.Id.ToString(); txt_address_postal.Text = aAddress.PostalCode; txt_address_phone.Text = aAddress.Phone; chk_default_billing.Checked = aAddress.Id == cCustomer.BillingAddressId; chk_default_shipping.Checked = aAddress.Id == cCustomer.ShippingAddressId; } ToggleAddressFields(WithEdit); }
protected void Util_BindRegions(int cCountryId) { System.Collections.Generic.List<RegionData> RegionList = new System.Collections.Generic.List<RegionData>(); RegionApi m_refRegion; m_refRegion = new RegionApi(); //(Me.m_refContentApi.RequestInformationRef) Ektron.Cms.Common.Criteria<RegionProperty> criteria = new Ektron.Cms.Common.Criteria<RegionProperty>(RegionProperty.Name, Ektron.Cms.Common.EkEnumeration.OrderByDirection.Ascending); criteria.AddFilter(RegionProperty.CountryId, CriteriaFilterOperator.EqualTo, cCountryId); criteria.AddFilter(RegionProperty.IsEnabled, CriteriaFilterOperator.EqualTo, true); criteria.PagingInfo.RecordsPerPage = 10000; RegionList = m_refRegion.GetList(criteria); if ((RegionList != null) && RegionList.Count > 0) { drp_address_region.DataSource = RegionList; drp_address_region.DataTextField = "Name"; drp_address_region.DataValueField = "Id"; drp_address_region.DataBind(); } else { drp_address_region.DataSource = ""; drp_address_region.DataTextField = "Name"; drp_address_region.DataValueField = "Id"; drp_address_region.DataBind(); } }
private void DisplayProducts() { CatalogEntryApi CatalogManager = new CatalogEntryApi(); System.Collections.Generic.List<EntryData> entryList = new System.Collections.Generic.List<EntryData>(); Ektron.Cms.Common.Criteria<EntryProperty> entryCriteria = new Ektron.Cms.Common.Criteria<EntryProperty>(); entryCriteria.PagingInfo.RecordsPerPage = this._FolderApi.EkContentRef.RequestInformation.PagingSize; entryCriteria.PagingInfo.CurrentPage = this.uxPaging.SelectedPage + 1; entryCriteria.AddFilter(EntryProperty.CatalogId, Ektron.Cms.Common.CriteriaFilterOperator.EqualTo, this._FolderId); entryCriteria.AddFilter(EntryProperty.LanguageId, Ektron.Cms.Common.CriteriaFilterOperator.EqualTo, long.Parse(Request.QueryString["languageId"])); entryList = CatalogManager.GetList(entryCriteria); if (entryCriteria.PagingInfo.TotalPages > 1) { this.uxPaging.Visible = true; this.uxPaging.TotalPages = entryCriteria.PagingInfo.TotalPages; this.uxPaging.CurrentPageIndex = this.uxPaging.SelectedPage; } else { this.uxPaging.Visible = false; } gvProducts.DataSource = entryList; gvProducts.DataBind(); }
protected void Display_ViewAddress(bool WithEdit) { pnl_view.Visible = false; pnl_viewall.Visible = false; AddressData aAddress = null; //Dim regioncriteria As New Ektron.Cms.Common.Criteria(Of RegionProperty)(RegionProperty.Name, Ektron.Cms.Common.EkEnumeration.OrderByDirection.Ascending) //RegionManager = New RegionApi() //regioncriteria.AddFilter(RegionProperty.IsEnabled, CriteriaFilterOperator.EqualTo, True) //If Not Me.m_iID > 0 Then // regioncriteria.AddFilter(RegionProperty.CountryId, CriteriaFilterOperator.EqualTo, drp_address_country.SelectedIndex) //End If //regioncriteria.PagingInfo.RecordsPerPage = 1000 //drp_address_region.DataTextField = "Name" //drp_address_region.DataValueField = "Id" //drp_address_region.DataSource = RegionManager.GetList(regioncriteria) //drp_address_region.DataBind() Ektron.Cms.Common.Criteria<CountryProperty> addresscriteria = new Ektron.Cms.Common.Criteria<CountryProperty>(CountryProperty.Name, Ektron.Cms.Common.EkEnumeration.OrderByDirection.Ascending); addresscriteria.AddFilter(CountryProperty.IsEnabled, CriteriaFilterOperator.EqualTo, true); addresscriteria.PagingInfo.RecordsPerPage = 1000; drp_address_country.DataTextField = "Name"; drp_address_country.DataValueField = "Id"; drp_address_country.DataSource = CountryManager.GetList(addresscriteria); drp_address_country.DataBind(); if (this.m_iID > 0) { order = orderApi.GetItem(this.m_iID); if (addressType == "billing") { aAddress = AddressManager.GetItem(order.BillingAddressId); } else if (addressType == "shipping") { aAddress = AddressManager.GetItem(order.Parts[0].ShippingAddressId); } if (!Page.IsPostBack) { ltr_address_id.Text = aAddress.Id.ToString(); txt_address_name.Text = aAddress.Name; txt_address_company.Text = aAddress.Company; txt_address_line1.Text = aAddress.AddressLine1; txt_address_line2.Text = aAddress.AddressLine2; txt_address_city.Text = aAddress.City; drp_address_country.SelectedIndex = Util_FindItem(aAddress.Country.Id, "country"); Util_BindRegions(aAddress.Country.Id); drp_address_region.SelectedValue = aAddress.Region.Id.ToString(); txt_address_postal.Text = aAddress.PostalCode; txt_address_phone.Text = aAddress.Phone; } } }
public bool ViewContentByCategory() { _CurrentUserId = _ContentApi.UserId; _AppImgPath = _ContentApi.AppImgPath; _AppPath = _ContentApi.AppPath; _SitePath = _ContentApi.SitePath; _EnableMultilingual = _ContentApi.EnableMultilingual; url_action.Text = _PageAction; url_id.Text = _Id.ToString(); if (_FolderData == null) { _FolderData = _ContentApi.GetFolderById(_Id); } if (_FolderData == null) { Response.Redirect((string)("reterror.aspx?info=" + _MessageHelper.GetMessage("com: folder does not exist")), true); return false; } else { if (_FolderData.XmlConfiguration != null) { _HasXmlConfig = true; } _PermissionData = _ContentApi.LoadPermissions(_Id, "folder", 0); _FolderType = _FolderData.FolderType; } //Setting JS Variable for global use through workarea.aspx page. pasteFolderType.Text = Convert.ToString(_FolderData.FolderType); pasteFolderId.Text = Convert.ToString(_FolderData.Id); pasteParentId.Text = Convert.ToString(_FolderData.ParentId); if (!string.IsNullOrEmpty(Request.QueryString["IsArchivedEvent"])) { _IsArchivedEvent = Convert.ToBoolean(Request.QueryString["IsArchivedEvent"]); is_archived.Text = Convert.ToString(_IsArchivedEvent); } _AssetInfoData = _ContentApi.GetAssetSupertypes(); if ((Ektron.Cms.Common.EkConstants.CMSContentType_Content == Convert.ToInt32(_ContentTypeSelected)) || (Ektron.Cms.Common.EkConstants.CMSContentType_Archive_Content == Convert.ToInt32(_ContentTypeSelected)) || (Ektron.Cms.Common.EkConstants.CMSContentType_XmlConfig == Convert.ToInt32(_ContentTypeSelected))) { _ContentType = int.Parse(_ContentTypeSelected); } else if (Ektron.Cms.Common.EkConstants.CMSContentType_Forms == Convert.ToInt32(_ContentTypeSelected) || Ektron.Cms.Common.EkConstants.CMSContentType_Archive_Forms == Convert.ToInt32(_ContentTypeSelected)) { _ContentType = int.Parse(_ContentTypeSelected); } else if (_ManagedAsset_Min <= Convert.ToInt32(_ContentTypeSelected) && Convert.ToInt32(_ContentTypeSelected) <= _ManagedAsset_Max) { if (DoesAssetSupertypeExist(_AssetInfoData, int.Parse(_ContentTypeSelected))) { _ContentType = int.Parse(_ContentTypeSelected); } } else if (Convert.ToInt32(_ContentTypeSelected) == _CMSContentType_AllTypes) { _ContentType = Ektron.Cms.Common.EkConstants.CMSContentType_NonLibraryForms; } else if (_IsArchivedEvent == true && (Convert.ToInt32(_ContentTypeSelected) == EkConstants.CMSContentType_Archive_ManagedFiles || Convert.ToInt32(_ContentTypeSelected) == EkConstants.CMSContentType_Archive_OfficeDoc || Convert.ToInt32(_ContentTypeSelected) == EkConstants.CMSContentType_Archive_MultiMedia || Convert.ToInt32(_ContentTypeSelected) == EkConstants.CMSContentType_Archive_Images)) { _ContentType = int.Parse(_ContentTypeSelected); } _ContentTypeSelected = _ContentType.ToString(); _PageData = new Microsoft.VisualBasic.Collection(); _PageData.Add(_Id, "FolderID", null, null); if (_FolderData.FolderType == 1) //blog { _PageData.Add("BlogPost", "OrderBy", null, null); } else { _PageData.Add(_OrderBy, "OrderBy", null, null); } if (Request.QueryString["orderbydirection"] == "desc") direction = "desc"; else direction = "asc"; _OrderByDirection = direction; _PageData.Add(_OrderByDirection, "OrderByDirection", null, null); _PageData.Add(_ContentLanguage, "m_intContentLanguage", null, null); switch ((Ektron.Cms.Common.EkEnumeration.FolderType)_FolderData.FolderType) { case Ektron.Cms.Common.EkEnumeration.FolderType.Blog: _ContentType = Ektron.Cms.Common.EkConstants.CMSContentType_Content; _PageData.Add(_ContentType, "ContentType", null, null); break; case Ektron.Cms.Common.EkEnumeration.FolderType.DiscussionForum: _ContentType = Ektron.Cms.Common.EkConstants.CMSContentType_Content; _PageData.Add(_ContentType, "ContentType", null, null); break; default: if (_ContentType > 0) { _PageData.Add(_ContentType, "ContentType", null, null); } break; } if (_ContentType == 1 && _ContentSubTypeSelected != Ektron.Cms.Common.EkEnumeration.CMSContentSubtype.AllTypes) { _PageData.Add(_ContentSubTypeSelected, "ContentSubType", null, null); } if ((Ektron.Cms.Common.EkEnumeration.FolderType)(_FolderData.FolderType) == Ektron.Cms.Common.EkEnumeration.FolderType.Calendar) { calendardisplay.Visible = true; pnlThreadedDiscussions.Visible = false; if ((Request.QueryString["showAddEventForm"] != null) && Request.QueryString["showAddEventForm"] == "true") { if (ViewState["AddEventFormDisplay"] == null || System.Convert.ToBoolean(ViewState["AddEventFormDisplay"]) == false) //only show once { ViewState.Add("AddEventFormDisplay", true); DateTime startDT = DateTime.Now.Date.AddHours(8); if (Request.QueryString["startDT"] != null) { startDT = DateTime.ParseExact(Request.QueryString["startDT"], "yyyyMMddHHmm", new System.Globalization.CultureInfo(1033)); } calendardisplay.ShowInsertForm(startDT); } } if (Request.QueryString["editEvent"] != null) { if (ViewState["editEvent"] == null || System.Convert.ToBoolean(ViewState["editEvent"]) == false) //only show once { ViewState.Add("editEvent", true); calendardisplay.ShowEditForm(Request.QueryString["editEvent"]); } } ScriptManager.RegisterClientScriptBlock(Page, typeof(UserControl), "CalendarCleanup", "try{ window.EditorCleanup(); }catch(ex){}", true); } _PagingPageSize = _ContentApi.RequestInformationRef.PagingSize; if ((Ektron.Cms.Common.EkEnumeration.FolderType)(_FolderData.FolderType) == Ektron.Cms.Common.EkEnumeration.FolderType.Blog) { _BlogData = _ContentApi.BlogObject(_FolderData); } //if it's a calendar then we do it on prerender if ((Ektron.Cms.Common.EkEnumeration.FolderType)(_FolderData.FolderType) != Ektron.Cms.Common.EkEnumeration.FolderType.Calendar) { if (_PageAction == "viewarchivecontentbycategory") { _EkContentCol = _EkContent.GetAllViewArchiveContentInfov5_0(_PageData, _PagingCurrentPageNumber, _PagingPageSize, ref _PagingTotalPagesNumber); _NextActionType = "ViewContentByCategory"; } else if (_PageAction == "viewcontentbycategory") { _EkContentCol = _EkContent.GetAllViewableChildContentInfoV5_0(_PageData, _PagingCurrentPageNumber, _PagingPageSize, ref _PagingTotalPagesNumber); _NextActionType = "ViewArchiveContentByCategory"; } //paging goes here int i; for (i = 0; i <= _EkContentCol.Count - 1; i++) { if (_EkContentCol.get_Item(i).ContentStatus == "A") { _TakeAction = true; _CheckedInOrApproved = true; break; } else { if (_EkContentCol.get_Item(i).ContentStatus == "I") { _CheckedInOrApproved = true; } } } } else { if (_PageAction == "viewarchivecontentbycategory") { _NextActionType = "ViewContentByCategory"; } else if (_PageAction == "viewcontentbycategory") { _NextActionType = "ViewArchiveContentByCategory"; } } switch ((Ektron.Cms.Common.EkEnumeration.FolderType)(_FolderData.FolderType)) { case Ektron.Cms.Common.EkEnumeration.FolderType.Catalog: if (_PageAction == "viewarchivecontentbycategory") { _NextActionType = "ViewContentByCategory"; } else if (_PageAction == "viewcontentbycategory") { _NextActionType = "ViewArchiveContentByCategory"; } Page.ClientScript.RegisterClientScriptBlock(typeof(string), "objselnotice", "<script type=\"text/javascript\">var objSelSupertype = null;</script>"); CatalogEntry CatalogManager = new CatalogEntry(_ContentApi.RequestInformationRef); System.Collections.Generic.List<EntryData> entryList = new System.Collections.Generic.List<EntryData>(); Ektron.Cms.Common.Criteria<EntryProperty> entryCriteria = new Ektron.Cms.Common.Criteria<EntryProperty>(); entryCriteria.AddFilter(EntryProperty.CatalogId, Ektron.Cms.Common.CriteriaFilterOperator.EqualTo, _Id); entryCriteria.PagingInfo.CurrentPage = Convert.ToInt32(_PagingCurrentPageNumber.ToString()); entryCriteria.PagingInfo.RecordsPerPage = _ContentApi.RequestInformationRef.PagingSize; if (_ContentApi.RequestInformationRef.ContentLanguage > 0) { entryCriteria.AddFilter(EntryProperty.LanguageId, Ektron.Cms.Common.CriteriaFilterOperator.EqualTo, _ContentApi.RequestInformationRef.ContentLanguage); } switch (this._ContentTypeQuerystringParam) { case "0": long[] IdList = new long[3]; IdList[0] = Convert.ToInt64(Ektron.Cms.Common.EkEnumeration.CatalogEntryType.Product); IdList[1] = Convert.ToInt64(Ektron.Cms.Common.EkEnumeration.CatalogEntryType.ComplexProduct); entryCriteria.AddFilter(EntryProperty.EntryType, Ektron.Cms.Common.CriteriaFilterOperator.In, IdList); break; case "2": entryCriteria.AddFilter(EntryProperty.EntryType, Ektron.Cms.Common.CriteriaFilterOperator.EqualTo, Ektron.Cms.Common.EkEnumeration.CatalogEntryType.Kit); break; case "3": entryCriteria.AddFilter(EntryProperty.EntryType, Ektron.Cms.Common.CriteriaFilterOperator.EqualTo, Ektron.Cms.Common.EkEnumeration.CatalogEntryType.Bundle); break; case "4": entryCriteria.AddFilter(EntryProperty.EntryType, Ektron.Cms.Common.CriteriaFilterOperator.EqualTo, Ektron.Cms.Common.EkEnumeration.CatalogEntryType.SubscriptionProduct); break; } if (_PageAction == "viewarchivecontentbycategory") { entryCriteria.AddFilter(EntryProperty.IsArchived, Ektron.Cms.Common.CriteriaFilterOperator.EqualTo, true); } else { entryCriteria.AddFilter(EntryProperty.IsArchived, Ektron.Cms.Common.CriteriaFilterOperator.EqualTo, false); } if (Request.QueryString["orderbydirection"] == "desc") direction = "desc"; else direction = "asc"; if(direction == "desc") entryCriteria.OrderByDirection = (EkEnumeration.OrderByDirection)OrderByDirection.Descending; else entryCriteria.OrderByDirection = (EkEnumeration.OrderByDirection)OrderByDirection.Ascending; switch (_OrderBy.ToLower()) { case "language": entryCriteria.OrderByField = EntryProperty.LanguageId; break; case "id": entryCriteria.OrderByField = EntryProperty.Id; break; case "status": entryCriteria.OrderByField = EntryProperty.ContentStatus; break; case "entrytype": entryCriteria.OrderByField = EntryProperty.EntryType; break; case "sale": entryCriteria.OrderByField = EntryProperty.SalePrice; break; case "list": entryCriteria.OrderByField = EntryProperty.ListPrice; break; default: //"title" entryCriteria.OrderByField = EntryProperty.Title; break; } entryList = CatalogManager.GetList(entryCriteria); for (int j = 0; j <= entryList.Count - 1; j++) { if (entryList[j].Status == "A") { _TakeAction = true; _CheckedInOrApproved = true; break; } else { if (entryList[j].Status == "I") { _CheckedInOrApproved = true; } } } _PagingTotalPagesNumber = System.Convert.ToInt32(entryCriteria.PagingInfo.TotalPages); //paging goes here ViewCatalogToolBar(entryList.Count); Populate_ViewCatalogGrid(_EkContentCol, entryList); _ContentType = int.Parse(_ContentTypeSelected); break; case Ektron.Cms.Common.EkEnumeration.FolderType.Blog: _IsMyBlog = System.Convert.ToBoolean((_BlogData.Id == _ContentApi.GetUserBlog(_ContentApi.UserId)) ? true : false); Page.ClientScript.RegisterClientScriptBlock(typeof(string), "objselnotice", "<script type=\"text/javascript\">var objSelSupertype = null;</script>"); if (!string.IsNullOrEmpty(Request.QueryString["ContType"]) && (Request.QueryString["ContType"] == Ektron.Cms.Common.EkConstants.CMSContentType_BlogComments.ToString())) { _ContentType = System.Convert.ToInt32(Request.QueryString["ContType"]); _Task = _ContentApi.EkTaskRef; if (!string.IsNullOrEmpty(Request.QueryString["contentid"])) { _PostID = Convert.ToInt64(Request.QueryString["contentid"]); _ContentData = _ContentApi.GetContentById(_PostID, 0); Ektron.Cms.PageRequestData null_EktronCmsPageRequestData = null; _Comments = _Task.GetTasks(_PostID, -1, -1, Convert.ToInt32(Ektron.Cms.Common.EkEnumeration.CMSTaskItemType.BlogCommentItem), "postcomment", 0, ref null_EktronCmsPageRequestData, ""); } else { Ektron.Cms.PageRequestData null_EktronCmsPageRequestData2 = null; _Comments = _Task.GetTasks(-1, -1, -1, Convert.ToInt32(Ektron.Cms.Common.EkEnumeration.CMSTaskItemType.BlogCommentItem), "", 0, ref null_EktronCmsPageRequestData2, ""); } ViewBlogContentByCategoryToolBar(); Populate_ViewBlogCommentsByCategoryGrid(_Comments); } else { Hashtable BlogPostCommentTally = new Hashtable(); BlogPostCommentTally = _EkContent.TallyCommentsForBlogPosts(_Id); ViewBlogContentByCategoryToolBar(); Populate_ViewBlogPostsByCategoryGrid(_EkContentCol, BlogPostCommentTally); } break; case Ektron.Cms.Common.EkEnumeration.FolderType.Media: Page.ClientScript.RegisterClientScriptBlock(typeof(string), "objselnotice", "<script type=\"text/javascript\">var objSelSupertype = null;</script>"); ViewContentByCategoryToolBar(); Populate_ViewMediaGrid(_EkContentCol); break; case Ektron.Cms.Common.EkEnumeration.FolderType.DiscussionBoard: Page.ClientScript.RegisterClientScriptBlock(typeof(string), "objselnotice", "<script type=\"text/javascript\">var objSelSupertype = null;</script>"); ViewDiscussionBoardToolBar(); Populate_ViewDiscussionBoardGrid(); break; case Ektron.Cms.Common.EkEnumeration.FolderType.DiscussionForum: Page.ClientScript.RegisterClientScriptBlock(typeof(string), "objselnotice", "<script type=\"text/javascript\">var objSelSupertype = null;</script>"); bool bCanModerate = false; int itotalpages = 1; int icurrentpage = 1; if (!string.IsNullOrEmpty(Request.QueryString["ContType"]) && (Request.QueryString["ContType"] == Ektron.Cms.Common.EkConstants.CMSContentType_BlogComments.ToString())) { _ContentType = System.Convert.ToInt32(Request.QueryString["ContType"]); if (this._ContentApi.UserId > 0 && ((!(_PermissionData == null) && _PermissionData.CanAddToImageLib == true) || _PermissionData.IsAdmin)) { bCanModerate = true; } _DiscussionBoard = _ContentApi.GetTopic(_ContentId, true); if (_DiscussionBoard == null) { throw new Exception("You may not have permission to view this object or it has been deleted."); } _BoardID = _DiscussionBoard.Id; _ContentData = (ContentData)(_DiscussionBoard.Forums[0].Topics[0]); _PermissionData = _ContentApi.LoadPermissions(_ContentId, "content", ContentAPI.PermissionResultType.All); ViewRepliesToolBar(); _Task = _ContentApi.EkTaskRef; if (!string.IsNullOrEmpty(Request.QueryString["contentid"])) { _PostID = Convert.ToInt64(Request.QueryString["contentid"]); _Comments = _Task.GetTopicReplies(_PostID, _DiscussionBoard.Id, ref icurrentpage, 0, 0, ref itotalpages, bCanModerate); } else { Ektron.Cms.PageRequestData null_EktronCmsPageRequestData3 = null; _Comments = _Task.GetTasks(-1, -1, -1, Convert.ToInt32(Ektron.Cms.Common.EkEnumeration.CMSTaskItemType.TopicReplyItem), "", 0, ref null_EktronCmsPageRequestData3, ""); } Populate_ViewTopicRepliesGrid(_Comments); } else { ArrayList ForumPostCommentTally = new ArrayList(); DiscussionBoard thisboard; bool bModerator = false; if (_PermissionData.IsAdmin == true || _PermissionData.CanAddToImageLib == true) { bModerator = true; } thisboard = _EkContent.GetForumbyID(_Id.ToString(), bModerator, _PagingCurrentPageNumber, ref this._PagingTotalPagesNumber, "", this._ContentApi.RequestInformationRef.PagingSize); //paging here ForumPostCommentTally = _EkContent.GetRepliesForTopics(_Id); ViewDiscussionForumToolBar(); Populate_ViewForumPostsByCategoryGrid(thisboard.Forums[0].Topics, ForumPostCommentTally); } break; case Ektron.Cms.Common.EkEnumeration.FolderType.Calendar: ViewCalendarToolBar(); break; default: ViewContentByCategoryToolBar(); Populate_ViewContentByCategoryGrid(_EkContentCol); break; } Util_SetJs(); return true; }
protected void Process_AddEdit() { TaxRateData tTax = null; Ektron.Cms.Common.Criteria<TaxClassProperty> TaxClasscriteria = new Ektron.Cms.Common.Criteria<TaxClassProperty>(TaxClassProperty.Name, Ektron.Cms.Common.EkEnumeration.OrderByDirection.Ascending); System.Collections.Generic.List<TaxClassData> TaxClassList = new System.Collections.Generic.List<TaxClassData>(); int page_data = _CurrentPageNumber; Ektron.Cms.Common.Criteria<TaxRateProperty> postalCriteria = new Ektron.Cms.Common.Criteria<TaxRateProperty>(TaxRateProperty.PostalCode, EkEnumeration.OrderByDirection.Ascending); string postalCode = "0"; long id = 0; TaxApi taxApi = new TaxApi(); TaxClassList = _TaxClassApi.GetList(TaxClasscriteria); if (Request.QueryString["postalid"] != "") { postalCode = Request.QueryString["postalid"]; } if (Request.QueryString["id"] != "") { id = Convert.ToInt64(Request.QueryString["id"]); } postalCriteria.PagingInfo.CurrentPage = page_data; postalCriteria.AddFilter(TaxRateProperty.TaxTypeId, CriteriaFilterOperator.EqualTo, TaxRateType.PostalSalesTax); List<TaxRateData> postalRateList; postalRateList = taxApi.GetList(postalCriteria); if (this.m_iID > 0 && Page.IsPostBack) { try { for (int i = 0; i <= TaxClassList.Count - 1; i++) { PostalCodeTaxRateData postalCodeData = new PostalCodeTaxRateData(); tTax = taxApi.GetItemByPostalId(TaxClassList[i].Id, id); if (tTax == null) { tTax = new PostalCodeTaxRateData(postalCode, Convert.ToInt64(drp_region.SelectedValue), TaxClassList[i].Id, 0); if (Information.IsNumeric(Request.Form["txtClassRate" + i])) { tTax.Rate = System.Convert.ToDecimal(Convert.ToDecimal(Request.Form["txtClassRate" + i]) / 100); taxApi.Add(tTax); } } else { if (Information.IsNumeric(Request.Form["txtClassRate" + i])) { postalCodeData = new PostalCodeTaxRateData(txt_name.Text, Convert.ToInt64(drp_region.SelectedValue), TaxClassList[i].Id, System.Convert.ToDecimal(Convert.ToDecimal(Request.Form["txtClassRate" + i]) / 100)); taxApi.Update(postalCodeData); } } } Response.Redirect(_PageName + "?action=view&id=" + m_iID.ToString() + "&postalid=" + postalCode, false); } catch (CmsException exc) { Utilities.ShowError(EkFunctions.GetAllValidationMessages(exc.ValidationResults)); } } else { try { PostalCodeTaxRateData postalrate = new PostalCodeTaxRateData(); for (int i = 0; i <= TaxClassList.Count - 1; i++) { if (Information.IsNumeric(Request.Form["txtClassRate" + i])) { postalrate = new PostalCodeTaxRateData(txt_name.Text, Convert.ToInt64(drp_region.SelectedValue), TaxClassList[i].Id, System.Convert.ToDecimal(Convert.ToDecimal(Request.Form["txtClassRate" + i]) / 100)); taxApi.Add(postalrate); } } Response.Redirect(_PageName, false); } catch (CmsException exc) { Utilities.ShowError(EkFunctions.GetAllValidationMessages(exc.ValidationResults)); } } TotalPages.Visible = false; CurrentPage.Visible = false; lnkBtnPreviousPage.Visible = false; NextPage.Visible = false; LastPage.Visible = false; FirstPage.Visible = false; PageLabel.Visible = false; OfLabel.Visible = false; }
protected void Util_BindRegions(string countryId) { int cCountryId = System.Convert.ToInt32(drp_address_country.SelectedValue); Ektron.Cms.Common.Criteria<RegionProperty> criteria = new Ektron.Cms.Common.Criteria<RegionProperty>(RegionProperty.Name, Ektron.Cms.Common.EkEnumeration.OrderByDirection.Ascending); drp_address_region.DataSource = ""; criteria.AddFilter(RegionProperty.CountryId, Ektron.Cms.Common.CriteriaFilterOperator.EqualTo, cCountryId); criteria.PagingInfo.RecordsPerPage = 10000; RegionList = m_refRegion.GetList(criteria); if ((RegionList != null) && RegionList.Count > 0) { drp_address_region.DataSource = RegionList; drp_address_region.DataTextField = "Name"; drp_address_region.DataValueField = "Id"; drp_address_region.DataBind(); } else { drp_address_region.DataSource = ""; drp_address_region.DataTextField = ""; drp_address_region.DataValueField = ""; drp_address_region.DataBind(); } }
protected void Util_BindRegions(int cCountryId) { Ektron.Cms.Common.Criteria<RegionProperty> criteria = new Ektron.Cms.Common.Criteria<RegionProperty>(RegionProperty.Name, Ektron.Cms.Common.EkEnumeration.OrderByDirection.Ascending); criteria.AddFilter(RegionProperty.CountryId, CriteriaFilterOperator.EqualTo, cCountryId); if (Request.QueryString["postalid"] == null || 0 == Request.QueryString["postalid"].Length) { criteria.AddFilter(RegionProperty.IsEnabled, CriteriaFilterOperator.EqualTo, "True"); } criteria.PagingInfo.RecordsPerPage = 10000; _RegionList = _RegionApi.GetList(criteria); try { if ((_RegionList != null) && _RegionList.Count > 0) { drp_region.DataSource = _RegionList; drp_region.DataTextField = "Name"; drp_region.DataValueField = "Id"; drp_region.DataBind(); } else { drp_region.DataSource = ""; drp_region.DataTextField = "Name"; drp_region.DataValueField = "Id"; drp_region.DataBind(); } } catch (Exception) { } }
protected void Display_Audit() { CommerceAuditApi auditApi = new CommerceAuditApi(); List<CommerceAuditData> auditLog = new List<CommerceAuditData>(); Ektron.Cms.Common.Criteria<CommerceAuditProperty> auditCriteria = new Ektron.Cms.Common.Criteria<CommerceAuditProperty>(); auditCriteria.OrderByField = sortcriteria; auditCriteria.OrderByDirection = sortdirection; auditCriteria.PagingInfo.CurrentPage = _currentPageNumber; auditCriteria.PagingInfo.RecordsPerPage = m_refContentApi.RequestInformationRef.PagingSize; if (!string.IsNullOrEmpty(searchCriteria)) { switch (searchField) { case CommerceAuditProperty.DateCreated: DateTime searchDate = DateTime.Now; if (DateTime.TryParse(searchCriteria, out searchDate) && !(searchDate == DateTime.MinValue)) { auditCriteria.AddFilter(searchField, CriteriaFilterOperator.GreaterThanOrEqualTo, searchDate.Date); auditCriteria.AddFilter(searchField, CriteriaFilterOperator.LessThan, searchDate.Date.AddDays(1)); auditLog = auditApi.GetList(auditCriteria); } break; case CommerceAuditProperty.OrderId: case CommerceAuditProperty.UserId: long searchId = 0; if (long.TryParse(searchCriteria, out searchId)) { auditCriteria.AddFilter(searchField, CriteriaFilterOperator.EqualTo, searchId); auditLog = auditApi.GetList(auditCriteria); } break; default: // CommerceAuditProperty.IPAddress, CommerceAuditProperty.FormattedMessage auditCriteria.AddFilter(searchField, CriteriaFilterOperator.Contains, searchCriteria); auditLog = auditApi.GetList(auditCriteria); break; } } else { auditLog = auditApi.GetList(auditCriteria); } if (auditLog.Count == 0 || auditCriteria.PagingInfo.TotalRecords == 0) ltr_noEntries.Visible = true; dg_audit.DataSource = auditLog; TotalPagesNumber = auditCriteria.PagingInfo.TotalPages; if (TotalPagesNumber <= 1) { TotalPages.Visible = false; CurrentPage.Visible = false; lnkBtnPreviousPage.Visible = false; NextPage.Visible = false; LastPage.Visible = false; FirstPage.Visible = false; PageLabel.Visible = false; OfLabel.Visible = false; } else { lnkBtnPreviousPage.Enabled = true; FirstPage.Enabled = true; LastPage.Enabled = true; NextPage.Enabled = true; TotalPages.Visible = true; CurrentPage.Visible = true; lnkBtnPreviousPage.Visible = true; NextPage.Visible = true; LastPage.Visible = true; FirstPage.Visible = true; PageLabel.Visible = true; OfLabel.Visible = true; TotalPages.Text = (System.Math.Ceiling(Convert.ToDouble(TotalPagesNumber))).ToString(); TotalPages.ToolTip = TotalPages.Text; CurrentPage.Text = _currentPageNumber.ToString(); CurrentPage.ToolTip = CurrentPage.Text; if (_currentPageNumber == 1) { lnkBtnPreviousPage.Enabled = false; FirstPage.Enabled = false; } else if (_currentPageNumber == TotalPagesNumber) { NextPage.Enabled = false; LastPage.Enabled = false; } } // dg_audit.Columns(0).HeaderText = GetMessage("generic id") dg_audit.Columns[0].HeaderText = GetMessage("lbl generic date"); // dg_audit.Columns(1).HeaderText = GetMessage("generic type") dg_audit.Columns[1].HeaderText = GetMessage("lbl ip address"); dg_audit.Columns[2].HeaderText = GetMessage("lbl desc"); dg_audit.Columns[3].HeaderText = GetMessage("lbl order id"); dg_audit.Columns[4].HeaderText = GetMessage("lbl user id"); dg_audit.DataBind(); }
protected void Display_All() { System.Collections.Generic.List<CountryData> CountryList = new System.Collections.Generic.List<CountryData>(); Ektron.Cms.Common.Criteria<CountryProperty> criteria = new Ektron.Cms.Common.Criteria<CountryProperty>(CountryProperty.Name, Ektron.Cms.Common.EkEnumeration.OrderByDirection.Ascending); criteria.PagingInfo.RecordsPerPage = m_refContentApi.RequestInformationRef.PagingSize; criteria.PagingInfo.CurrentPage = _currentPageNumber; if (sortCriteria.IndexOf("-") > -1) { criteria.OrderByDirection = Ektron.Cms.Common.EkEnumeration.OrderByDirection.Descending; } switch (sortCriteria.Replace("-", "")) { case "id": criteria.OrderByField = CountryProperty.Id; break; case "enabled": criteria.OrderByField = CountryProperty.IsEnabled; break; case "longiso": criteria.OrderByField = CountryProperty.LongIsoCode; break; case "shortiso": criteria.OrderByField = CountryProperty.ShortIsoCode; break; default: criteria.OrderByField = CountryProperty.Name; break; } if (searchCriteria != "") { criteria.AddFilter(CountryProperty.Name, Ektron.Cms.Common.CriteriaFilterOperator.Contains, searchCriteria); } CountryList = m_refCountry.GetList(criteria); TotalPagesNumber = System.Convert.ToInt32(criteria.PagingInfo.TotalPages); if (TotalPagesNumber <= 1) { TotalPages.Visible = false; CurrentPage.Visible = false; lnkBtnPreviousPage.Visible = false; NextPage.Visible = false; LastPage.Visible = false; FirstPage.Visible = false; PageLabel.Visible = false; OfLabel.Visible = false; } else { lnkBtnPreviousPage.Enabled = true; FirstPage.Enabled = true; LastPage.Enabled = true; NextPage.Enabled = true; TotalPages.Visible = true; CurrentPage.Visible = true; lnkBtnPreviousPage.Visible = true; NextPage.Visible = true; LastPage.Visible = true; FirstPage.Visible = true; PageLabel.Visible = true; OfLabel.Visible = true; TotalPages.Text = (System.Math.Ceiling(Convert.ToDouble(TotalPagesNumber))).ToString(); TotalPages.ToolTip = TotalPages.Text; CurrentPage.Text = _currentPageNumber.ToString(); CurrentPage.ToolTip = CurrentPage.Text; if (_currentPageNumber == 1) { lnkBtnPreviousPage.Enabled = false; FirstPage.Enabled = false; } else if (_currentPageNumber == TotalPagesNumber) { NextPage.Enabled = false; LastPage.Enabled = false; } } dg_viewall.DataSource = CountryList; dg_viewall.DataBind(); }
private void Display_ViewAllSubscriptionMessages() { TR_ViewAllFont.Visible = true; EmailMessageData[] subscriptionMessage_data_list; List<EmailMessageData> messageList = new List<EmailMessageData>(); Ektron.Cms.Common.Criteria<EmailMessageProperty> criteria = new Ektron.Cms.Common.Criteria<EmailMessageProperty>(); List<int> typeList = new List<int>(); bool showIsDefault = System.Convert.ToBoolean(m_strPageMode == "userprop" || m_strPageMode == "forum" || m_strPageMode == "commerce"); switch (m_strPageMode) { case "commerce": typeList.Add(Convert.ToInt32(Ektron.Cms.Common.EkEnumeration.EmailMessageTypes.OrderReceived)); typeList.Add(Convert.ToInt32(Ektron.Cms.Common.EkEnumeration.EmailMessageTypes.OrderCancelled)); typeList.Add(Convert.ToInt32(Ektron.Cms.Common.EkEnumeration.EmailMessageTypes.OrderShipped)); typeList.Add(Convert.ToInt32(Ektron.Cms.Common.EkEnumeration.EmailMessageTypes.OrderCompleted)); typeList.Add(Convert.ToInt32(Ektron.Cms.Common.EkEnumeration.EmailMessageTypes.OrderReceivedToAdmin)); criteria.AddFilter(EmailMessageProperty.Type, CriteriaFilterOperator.In, typeList); criteria.AddFilter(EmailMessageProperty.LanguageId, CriteriaFilterOperator.EqualTo, m_refSiteAPI.ContentLanguage); m_refSiteAPI.EmailMessagesRef.GetEmailMessageList(criteria); subscriptionMessage_data_list = messageList.ToArray(); break; case "forum": typeList.Add(Convert.ToInt32(Ektron.Cms.Common.EkEnumeration.EmailMessageTypes.NewForumTopic)); typeList.Add(Convert.ToInt32(Ektron.Cms.Common.EkEnumeration.EmailMessageTypes.ForumPost)); typeList.Add(Convert.ToInt32(Ektron.Cms.Common.EkEnumeration.EmailMessageTypes.ReportForumPost)); typeList.Add(Convert.ToInt32(Ektron.Cms.Common.EkEnumeration.EmailMessageTypes.NewModeratedForumTopic)); break; case "userprop": typeList.Add(Convert.ToInt32(Ektron.Cms.Common.EkEnumeration.EmailMessageTypes.Verification)); typeList.Add(Convert.ToInt32(Ektron.Cms.Common.EkEnumeration.EmailMessageTypes.FriendInvitation)); typeList.Add(Convert.ToInt32(Ektron.Cms.Common.EkEnumeration.EmailMessageTypes.SiteInvitation)); typeList.Add(Convert.ToInt32(Ektron.Cms.Common.EkEnumeration.EmailMessageTypes.GroupInvitation)); typeList.Add(Convert.ToInt32(Ektron.Cms.Common.EkEnumeration.EmailMessageTypes.PrivateMessage)); typeList.Add(Convert.ToInt32(Ektron.Cms.Common.EkEnumeration.EmailMessageTypes.BlogComment)); typeList.Add(Convert.ToInt32(Ektron.Cms.Common.EkEnumeration.EmailMessageTypes.UserJournalComment)); typeList.Add(Convert.ToInt32(Ektron.Cms.Common.EkEnumeration.EmailMessageTypes.BlogPost)); typeList.Add(Convert.ToInt32(Ektron.Cms.Common.EkEnumeration.EmailMessageTypes.GroupBlogPost)); typeList.Add(Convert.ToInt32(Ektron.Cms.Common.EkEnumeration.EmailMessageTypes.UserJournalPost)); typeList.Add(Convert.ToInt32(Ektron.Cms.Common.EkEnumeration.EmailMessageTypes.GroupBlogComment)); typeList.Add(Convert.ToInt32(Ektron.Cms.Common.EkEnumeration.EmailMessageTypes.ModeratedBlogComment)); typeList.Add(Convert.ToInt32(Ektron.Cms.Common.EkEnumeration.EmailMessageTypes.ResetPassword)); typeList.Add(Convert.ToInt32(Ektron.Cms.Common.EkEnumeration.EmailMessageTypes.RequestResetPassword)); break; case "": typeList.Add(Convert.ToInt32(Ektron.Cms.Common.EkEnumeration.EmailMessageTypes.DefaultMessage)); typeList.Add(Convert.ToInt32(Ektron.Cms.Common.EkEnumeration.EmailMessageTypes.Unsubscribe)); typeList.Add(Convert.ToInt32(Ektron.Cms.Common.EkEnumeration.EmailMessageTypes.OptOut)); break; } if (typeList.Count > 0) { criteria.AddFilter(EmailMessageProperty.Type, CriteriaFilterOperator.In, typeList); } criteria.AddFilter(EmailMessageProperty.LanguageId, CriteriaFilterOperator.EqualTo, m_refSiteAPI.ContentLanguage); criteria.PagingInfo.RecordsPerPage = m_refSiteAPI.RequestInformationRef.PagingSize; criteria.PagingInfo.CurrentPage = _currentPageNumber; criteria.OrderByField = EmailMessageProperty.Type; messageList = m_refSiteAPI.EmailMessagesRef.GetEmailMessageList(criteria); TotalPagesNumber = System.Convert.ToInt32(criteria.PagingInfo.TotalPages); if (TotalPagesNumber <= 1) { TotalPages.Visible = false; CurrentPage.Visible = false; lnkBtnPreviousPage.Visible = false; NextPage.Visible = false; LastPage.Visible = false; FirstPage.Visible = false; PageLabel.Visible = false; OfLabel.Visible = false; } else { lnkBtnPreviousPage.Enabled = true; FirstPage.Enabled = true; LastPage.Enabled = true; NextPage.Enabled = true; TotalPages.Visible = true; CurrentPage.Visible = true; lnkBtnPreviousPage.Visible = true; NextPage.Visible = true; LastPage.Visible = true; FirstPage.Visible = true; PageLabel.Visible = true; OfLabel.Visible = true; TotalPages.Text = (System.Math.Ceiling(Convert.ToDecimal(TotalPagesNumber))).ToString(); TotalPages.ToolTip = TotalPages.Text; CurrentPage.Text = _currentPageNumber.ToString(); CurrentPage.ToolTip = CurrentPage.Text; if (_currentPageNumber == 1) { lnkBtnPreviousPage.Enabled = false; FirstPage.Enabled = false; } else if (_currentPageNumber == TotalPagesNumber) { NextPage.Enabled = false; LastPage.Enabled = false; } } subscriptionMessage_data_list = messageList.ToArray(); if (!(subscriptionMessage_data_list == null)) { System.Web.UI.WebControls.BoundColumn colBound = new System.Web.UI.WebControls.BoundColumn(); colBound.DataField = "TITLE"; colBound.HeaderText = m_refMsg.GetMessage("generic Title"); colBound.ItemStyle.Wrap = false; colBound.ItemStyle.VerticalAlign = VerticalAlign.Top; colBound.ItemStyle.HorizontalAlign = HorizontalAlign.Left; colBound.HeaderStyle.CssClass = "title-header"; colBound.HeaderStyle.VerticalAlign = VerticalAlign.Top; colBound.HeaderStyle.Wrap = false; ViewSubscriptionGrid.Columns.Add(colBound); colBound = new System.Web.UI.WebControls.BoundColumn(); colBound.DataField = "ID"; colBound.HeaderText = m_refMsg.GetMessage("generic SubscriptionID"); colBound.ItemStyle.Wrap = false; colBound.ItemStyle.VerticalAlign = VerticalAlign.Top; colBound.ItemStyle.HorizontalAlign = HorizontalAlign.Left; colBound.HeaderStyle.CssClass = "title-header"; ViewSubscriptionGrid.Columns.Add(colBound); colBound = new System.Web.UI.WebControls.BoundColumn(); colBound.DataField = "TYPE"; colBound.HeaderText = m_refMsg.GetMessage("generic Type"); colBound.ItemStyle.Wrap = false; colBound.ItemStyle.VerticalAlign = VerticalAlign.Top; colBound.ItemStyle.HorizontalAlign = HorizontalAlign.Left; colBound.HeaderStyle.CssClass = "title-header"; ViewSubscriptionGrid.Columns.Add(colBound); colBound = new System.Web.UI.WebControls.BoundColumn(); colBound.DataField = "Language"; colBound.HeaderText = m_refMsg.GetMessage("generic SubscriptionLanguageID"); colBound.ItemStyle.Wrap = false; colBound.ItemStyle.VerticalAlign = VerticalAlign.Top; colBound.ItemStyle.HorizontalAlign = HorizontalAlign.Left; colBound.HeaderStyle.CssClass = "title-header"; ViewSubscriptionGrid.Columns.Add(colBound); if (showIsDefault) { colBound = new System.Web.UI.WebControls.BoundColumn(); colBound.DataField = "Default"; colBound.HeaderText = m_refMsg.GetMessage("Default label"); colBound.ItemStyle.Wrap = false; colBound.ItemStyle.VerticalAlign = VerticalAlign.Top; colBound.ItemStyle.HorizontalAlign = HorizontalAlign.Left; colBound.HeaderStyle.CssClass = "title-header"; ViewSubscriptionGrid.Columns.Add(colBound); } DataTable dt = new DataTable(); DataRow dr; int i = 0; dt.Columns.Add(new DataColumn("TITLE", typeof(string))); dt.Columns.Add(new DataColumn("ID", typeof(string))); dt.Columns.Add(new DataColumn("TYPE", typeof(string))); dt.Columns.Add(new DataColumn("Language", typeof(string))); //----- Show the default checkbox for new validation email message. if (showIsDefault) { dt.Columns.Add(new DataColumn("Default", typeof(string))); } for (i = 0; i <= subscriptionMessage_data_list.Length - 1; i++) { dr = dt.NewRow(); dr[0] = "<a href=\"" + PAGE_NAME + "?action=View&id=" + subscriptionMessage_data_list[i].Id + m_strModeQueryString + "\" title=\'" + m_refMsg.GetMessage("alt Click Here to View the Email Message") + " \"" + Strings.Replace(subscriptionMessage_data_list[i].Title, "\'", "`", 1, -1, 0) + "\"\'>" + subscriptionMessage_data_list[i].Title + "</a>"; dr[1] = subscriptionMessage_data_list[i].Id.ToString(); dr[2] = GetResourceText( subscriptionMessage_data_list[i].Type.ToString()); dr[3] = subscriptionMessage_data_list[i].LanguageId; if (showIsDefault && (subscriptionMessage_data_list[i].DefaultMessage == 1)) { dr[4] = "<img src=\"" + imagePath + "check.png\" alt=\"Default Message\"/>"; } dt.Rows.Add(dr); } ViewSubscriptionGrid.BorderColor = System.Drawing.Color.White; DataView dv = new DataView(dt); ViewSubscriptionGrid.DataSource = dv; ViewSubscriptionGrid.DataBind(); } ViewAllSubscriptionsToolBar(); }
private void Display_ExchangeRate() { Ektron.Cms.Common.Criteria<CurrencyProperty> criteria = new Ektron.Cms.Common.Criteria<CurrencyProperty>(sortCriteria, Ektron.Cms.Common.EkEnumeration.OrderByDirection.Ascending); System.Collections.Generic.List<CurrencyData> currencyList; criteria.PagingInfo = new PagingInfo(1000); criteria.PagingInfo.CurrentPage = _currentPageNumber; criteria.AddFilter(CurrencyProperty.Enabled, Ektron.Cms.Common.CriteriaFilterOperator.EqualTo, true); criteria.AddFilter(CurrencyProperty.Id, Ektron.Cms.Common.CriteriaFilterOperator.NotEqualTo, m_refCurrency.RequestInformation.CommerceSettings.DefaultCurrencyId); currencyList = m_refCurrency.GetList(criteria); ExchangeRateApi exchangeRateApi = new ExchangeRateApi(); Ektron.Cms.Common.Criteria<Ektron.Cms.Commerce.ExchangeRateProperty> exchangeRateCriteria = new Ektron.Cms.Common.Criteria<Ektron.Cms.Commerce.ExchangeRateProperty>(); System.Collections.Generic.List<long> currencyIDList = new System.Collections.Generic.List<long>(); for (int i = 0; i <= (currencyList.Count - 1); i++) { currencyIDList.Add(currencyList[i].Id); } if (currencyIDList.Count > 0) { exchangeRateCriteria.AddFilter(ExchangeRateProperty.BaseCurrencyId, Ektron.Cms.Common.CriteriaFilterOperator.EqualTo, m_refContentApi.RequestInformationRef.CommerceSettings.DefaultCurrencyId); exchangeRateCriteria.AddFilter(ExchangeRateProperty.ExchangeCurrencyId, Ektron.Cms.Common.CriteriaFilterOperator.In, currencyIDList.ToArray()); exchangeRateList = exchangeRateApi.GetCurrentList(exchangeRateCriteria); dg_xc.DataSource = currencyList; dg_xc.DataBind(); } else { ltr_ExchangeRateMsg.Text = GetMessage("ecomm no enabled currencies"); } Util_SetJs(); paginglinks.Visible = false; Util_SetLabels(); }
private void Display_MoveEntries() { CatalogEntry CatalogManager = new CatalogEntry(m_refContentApi.RequestInformationRef); System.Collections.Generic.List<EntryData> entryList = new System.Collections.Generic.List<EntryData>(); Ektron.Cms.Common.Criteria<EntryProperty> entryCriteria = new Ektron.Cms.Common.Criteria<EntryProperty>(); security_data = m_refContentApi.LoadPermissions(m_intId, "folder", 0); entryCriteria.AddFilter(EntryProperty.CatalogId, Ektron.Cms.Common.CriteriaFilterOperator.EqualTo, m_intId); if (m_refContentApi.RequestInformationRef.ContentLanguage > 0) { entryCriteria.AddFilter(EntryProperty.LanguageId, Ektron.Cms.Common.CriteriaFilterOperator.EqualTo, m_refContentApi.RequestInformationRef.ContentLanguage); } entryCriteria.AddFilter(EntryProperty.IsArchived, Ektron.Cms.Common.CriteriaFilterOperator.EqualTo, false); entryCriteria.OrderByDirection = Ektron.Cms.Common.EkEnumeration.OrderByDirection.Ascending; entryCriteria.OrderByField = EntryProperty.Title; entryCriteria.PagingInfo.RecordsPerPage = m_refContentApi.RequestInformationRef.PagingSize; entryCriteria.PagingInfo.CurrentPage = m_intCurrentPage; entryList = CatalogManager.GetList(entryCriteria); m_intTotalPages = System.Convert.ToInt32(entryCriteria.PagingInfo.TotalPages); // td_copy.Visible = False MoveContentByCategoryToolBar(); FolderId = folder_data.Id.ToString(); source_folder_is_xml.Value = "1"; Page.ClientScript.RegisterHiddenField("xmlinherited", "false"); lblDestinationFolder.Text = "<input id=\"move_folder_id\" size=\"50%\" name=\"move_folder_id\" value=\"\\\" readonly=\"true\"/> <a href=\"#\" onclick=\"LoadSelectCatalogFolderChildPage();return true;\">" + m_refMsg.GetMessage("lbl ecomm coupon select folder") + "</a>"; folder_id.Value = m_intId.ToString(); PageSettings(); Populate_MoveCatalogGrid(entryList); }