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();
        }
Exemple #2
0
    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();
    }
Exemple #3
0
    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();
    }
    protected void Process_Delete()
    {
        _TaxApi = new TaxApi();
        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.Commerce.CountryTaxRateData m_CountryTax = new Ektron.Cms.Commerce.CountryTaxRateData();
        TaxClasscriteria.PagingInfo.RecordsPerPage = 10;
        TaxClassList = _TaxClassApi.GetList(TaxClasscriteria);

        if (this.m_iID > 0)
        {
            for (int j = 0; j <= TaxClassList.Count - 1; j++)
            {
                long tTax = new long();
                tTax = _TaxApi.GetItemByPostalId(TaxClassList[j].Id, m_iID).Id;
                _TaxApi.Delete(tTax);
            }
        }

        Response.Redirect(_PageName, false);
    }
    protected void Util_SetJS()
    {
        StringBuilder sbJS = new StringBuilder();
        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>();

        TaxClassList = _TaxClassApi.GetList(TaxClasscriteria);

        sbJS.Append("<script type=\'text/javascript\'>").Append(Environment.NewLine);

        sbJS.Append("   var aSubmitErr = new Array();").Append(Environment.NewLine);
        sbJS.Append(JSLibrary.AddError("aSubmitErr"));
        sbJS.Append(JSLibrary.ShowError("aSubmitErr"));
        sbJS.Append(JSLibrary.ResetError("aSubmitErr"));
        sbJS.Append(JSLibrary.HasIllegalCharacters(workareajavascript.ErrorType.ErrorCollection));

        sbJS.Append(" function validate_Title() {").Append(Environment.NewLine);
        sbJS.Append("   var sTitle = Trim(document.getElementById(\'").Append(txt_name.UniqueID).Append("\').value); ").Append(Environment.NewLine);
        sbJS.Append("   var cCountryId = Trim(document.getElementById(\'").Append(drp_country.UniqueID).Append("\').value);").Append(Environment.NewLine);
        sbJS.Append("   if (sTitle == \'\' || sTitle == 0) { ").Append(JSLibrary.AddErrorFunctionName).Append("(\'").Append(GetMessage("js err postal code title req")).Append("\'); document.forms[\'form1\'].isCPostData.value = \'false\'; } ").Append(Environment.NewLine);
        sbJS.Append("   if(cCountryId == \'840\' ){").Append(Environment.NewLine);
        sbJS.Append("       if(!ValidatePostalCode(sTitle)&& sTitle != \'\' && sTitle != 0)").Append(Environment.NewLine);
        sbJS.Append("       {").Append(JSLibrary.AddErrorFunctionName).Append("(\'").Append(GetMessage("js err postal code title req")).Append("\');  ").Append(Environment.NewLine);
        sbJS.Append("           document.forms[\"form1\"].isCPostData.value = \'false\';").Append(Environment.NewLine);
        sbJS.Append("       }").Append(Environment.NewLine);
        sbJS.Append("   }").Append(Environment.NewLine);
        sbJS.Append("   HasIllegalChar(\'").Append(txt_name.UniqueID).Append("\',\"").Append(GetMessage("lbl region disallowed chars")).Append("\"); ").Append(Environment.NewLine);
        sbJS.Append(" } ").Append(Environment.NewLine);

        sbJS.Append("   function ValidatePostalCode(postalCodeText){").Append(Environment.NewLine);
        sbJS.Append("       var regEx = /^\\d{5}(-\\d{4})?$/; ").Append(Environment.NewLine);
        sbJS.Append("       return (regEx.test(postalCodeText));").Append(Environment.NewLine);
        sbJS.Append("    }").Append(Environment.NewLine);

        sbJS.Append("function SubmitForm()").Append(Environment.NewLine);
        sbJS.Append("{").Append(Environment.NewLine);
        sbJS.Append("   ").Append(JSLibrary.ResetErrorFunctionName).Append("();").Append(Environment.NewLine);
        sbJS.Append("   var taxClass = ").Append(TaxClassList.Count).Append(";").Append(Environment.NewLine);
        sbJS.Append("   var i = 0;").Append(Environment.NewLine);
        sbJS.Append("   var drp_region = document.getElementById(\"").Append(drp_region.UniqueID).Append("\");" + Environment.NewLine);
        sbJS.Append("   if(drp_region.selectedIndex == -1)").Append(Environment.NewLine);
        sbJS.Append("    {").Append(Environment.NewLine);
        sbJS.Append("       alert(\"" + base.GetMessage("js null postalcode region msg") + "\");" + Environment.NewLine);
        sbJS.Append("       document.forms[\"form1\"].isCPostData.value = \'false\';").Append(Environment.NewLine);
        sbJS.Append("       return false;").Append(Environment.NewLine);
        sbJS.Append("    }").Append(Environment.NewLine);
        sbJS.Append("   for (i = 0; i < taxClass; i++)").Append(Environment.NewLine);
        sbJS.Append("   {").Append(Environment.NewLine);
        sbJS.Append("       var taxField = Trim(document.getElementById(\'txtClassRate\' + i)); ").Append(Environment.NewLine);
        sbJS.Append("       if(taxField.value == \'\')").Append(Environment.NewLine);
        sbJS.Append("       {").Append(Environment.NewLine);
        sbJS.Append("           taxField.value = 0;").Append(Environment.NewLine);
        sbJS.Append("       }").Append(Environment.NewLine);
        sbJS.Append("       if(isNaN(taxField.value) || taxField.value > 99)").Append(Environment.NewLine);
        sbJS.Append("       {").Append(Environment.NewLine);
        sbJS.Append("          ").Append(JSLibrary.AddErrorFunctionName).Append("(\'").Append(GetMessage("js err postal code tax value")).Append("\');").Append(Environment.NewLine);
        sbJS.Append("           break;").Append(Environment.NewLine);
        sbJS.Append("       }").Append(Environment.NewLine);
        sbJS.Append("   }").Append(Environment.NewLine);
        sbJS.Append("   validate_Title(); ").Append(Environment.NewLine);
        sbJS.Append("   ").Append(JSLibrary.ShowErrorFunctionName).Append("(\'document.forms[0].submit();\');").Append(Environment.NewLine);
        sbJS.Append("   return false; ").Append(Environment.NewLine);
        sbJS.Append(" } ").Append(Environment.NewLine);
        sbJS.Append("</script>").Append(Environment.NewLine);

        ltr_js.Text += sbJS.ToString();
    }
    protected void Util_SetJS()
    {
        StringBuilder sbJS = new StringBuilder();
        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>();

        TaxClassList = _TaxClassApi.GetList(TaxClasscriteria);

        sbJS.Append("<script language=\"javascript\">").Append(Environment.NewLine);

        sbJS.Append("   var aSubmitErr = new Array();").Append(Environment.NewLine);
        sbJS.Append(JSLibrary.AddError("aSubmitErr"));
        sbJS.Append(JSLibrary.ShowError("aSubmitErr"));
        sbJS.Append(JSLibrary.ResetError("aSubmitErr"));
        sbJS.Append(JSLibrary.HasIllegalCharacters(workareajavascript.ErrorType.ErrorCollection));

        sbJS.Append(" function validate_Title() { ").Append(Environment.NewLine);
        sbJS.Append("   var sTitle = Trim(document.getElementById(\'").Append(txt_name.UniqueID).Append("\').value); ").Append(Environment.NewLine);
        sbJS.Append("   var iNumISO = Trim(document.getElementById(\'").Append(txt_numeric.UniqueID).Append("\').value); ").Append(Environment.NewLine);
        sbJS.Append("   var shortISO = Trim(document.getElementById(\'").Append(txt_short.UniqueID).Append("\').value); ").Append(Environment.NewLine);
        sbJS.Append("   var slngISO = Trim(document.getElementById(\'").Append(txt_long.UniqueID).Append("\').value); ").Append(Environment.NewLine);
        sbJS.Append("   if (sTitle == \'\' || iNumISO == \'\' || isNaN(iNumISO) || shortISO == \'\' || slngISO == \'\') { ").Append(JSLibrary.AddErrorFunctionName).Append("(\'").Append(GetMessage("js err fields req")).Append("\'); } ").Append(Environment.NewLine);
        //sbJS.Append("   if (sTitle == '') { ").Append(JSLibrary.AddErrorFunctionName).Append("('").Append(GetMessage("js err region title req")).Append("'); } ").Append(Environment.NewLine)
        sbJS.Append("   HasIllegalChar(\'").Append(txt_name.UniqueID).Append("\',\"").Append(GetMessage("lbl region disallowed chars")).Append("\"); ").Append(Environment.NewLine);
        sbJS.Append(" } ").Append(Environment.NewLine);

        sbJS.Append(" function SubmitForm() {").Append(Environment.NewLine);
        sbJS.Append("   ").Append(JSLibrary.ResetErrorFunctionName).Append("();").Append(Environment.NewLine);
        sbJS.Append("   var taxClass = ").Append(TaxClassList.Count).Append(";").Append(Environment.NewLine);
        sbJS.Append("   var i = 0;").Append(Environment.NewLine);
        sbJS.Append("   for (i = 0; i < taxClass; i++)").Append(Environment.NewLine);
        sbJS.Append("   {").Append(Environment.NewLine);
        sbJS.Append("       var taxField = Trim(document.getElementById(\'txtClassRate\' + i)); ").Append(Environment.NewLine);
        sbJS.Append("       if(taxField.value == \'\')").Append(Environment.NewLine);
        sbJS.Append("       {").Append(Environment.NewLine);
        sbJS.Append("           taxField.value = 0;").Append(Environment.NewLine);
        sbJS.Append("       }").Append(Environment.NewLine);
        sbJS.Append("       if(isNaN(taxField.value) || taxField.value > 99)").Append(Environment.NewLine);
        sbJS.Append("       {").Append(Environment.NewLine);
        sbJS.Append("          ").Append(JSLibrary.AddErrorFunctionName).Append("(\'").Append(GetMessage("js err postal code tax value")).Append("\');").Append(Environment.NewLine);
        sbJS.Append("           break;").Append(Environment.NewLine);
        sbJS.Append("       }").Append(Environment.NewLine);
        sbJS.Append("   }").Append(Environment.NewLine);
        sbJS.Append("   validate_Title(); ").Append(Environment.NewLine);
        sbJS.Append("   ").Append(JSLibrary.ShowErrorFunctionName).Append("(\'document.forms[0].submit();\');").Append(Environment.NewLine);
        sbJS.Append("   return false; ").Append(Environment.NewLine);
        sbJS.Append(" } ").Append(Environment.NewLine);

        sbJS.Append(" function searchCountry() { ").Append(Environment.NewLine);
        sbJS.Append("   var sSearchTerm = Trim(document.getElementById(\'txtSearch\').value); ").Append(Environment.NewLine);
        sbJS.Append("   if (sSearchTerm != \'\') { window.location.href = \'").Append(_PageName).Append("?search=\' + sSearchTerm;} else { alert(\'").Append(GetMessage("js err please enter text")).Append("\'); } ").Append(Environment.NewLine);
        sbJS.Append(" } ").Append(Environment.NewLine);

        sbJS.Append("</script>").Append(Environment.NewLine);

        ltr_js.Text += sbJS.ToString();
    }
    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;
    }
Exemple #8
0
    protected void Process_AddEdit()
    {
        RegionData rRegion = null;
        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>();

        TaxClassList = _TaxClassApi.GetList(TaxClasscriteria);
        _TaxApi = new TaxApi();

        if (this.m_iID > 0)
        {
            rRegion = _RegionApi.GetItem(this.m_iID);
            rRegion.Name = (string)txt_name.Text;
            rRegion.CountryId = Convert.ToInt64(drp_country.SelectedValue);
            rRegion.Code = (string)txt_code.Text;
            rRegion.Enabled = System.Convert.ToBoolean(chk_enabled.Checked);
            _RegionApi.Update(rRegion);

            for (int i = 0; i <= TaxClassList.Count - 1; i++)
            {
                tTax = _TaxApi.GetItemByRegionId(TaxClassList[i].Id, rRegion.Id);
                if (tTax == null)
                {
                    tTax = new RegionTaxRateData(rRegion.Id, 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]))
                    {
                        tTax.Rate = System.Convert.ToDecimal(Convert.ToDecimal(Request.Form["txtClassRate" + i]) / 100);
                        _TaxApi.Update(tTax);
                    }
                }
            }

            Response.Redirect(_PageName + "?action=view&id=" + m_iID.ToString(), false);
        }
        else
        {
            rRegion = new RegionData(txt_name.Text, Convert.ToInt64(drp_country.SelectedValue), txt_code.Text, chk_enabled.Checked);
            _RegionApi.Add(rRegion);
            string Country = (string)drp_country.SelectedValue;

            for (int i = 0; i <= TaxClassList.Count - 1; i++)
            {
                tTax = new RegionTaxRateData(rRegion.Id, 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);
                }
            }
            Response.Redirect(_PageName, 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;
    }
Exemple #9
0
    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();
    }
Exemple #10
0
    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();
        }
    }
Exemple #11
0
    protected void Display_View()
    {
        RegionData rRegion = 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>();

        Util_BindCountries();

        TaxClassList = _TaxClassApi.GetList(TaxClasscriteria);
        _TaxApi = new TaxApi();
        rRegion = _RegionApi.GetItem(this.m_iID);

        txt_name.Text = rRegion.Name;
        lbl_id.Text = rRegion.Id.ToString();
        chk_enabled.Checked = rRegion.Enabled;
        txt_code.Text = rRegion.Code;
        drp_country.SelectedIndex = Util_GetCountryIndex(Convert.ToInt32(rRegion.CountryId));

        int txtClassList = 0;
        ltr_txtClass.Text = "<table class=\"ektronForm\">";
        for (txtClassList = 0; txtClassList <= TaxClassList.Count - 1; txtClassList++)
        {
            ltr_txtClass.Text += "<tr>";
            ltr_txtClass.Text += "   <td class=\"label\">";
            ltr_txtClass.Text += "       <label id=\"taxClass" + txtClassList + "\" value=\"" + TaxClassList[txtClassList].Name + "\">" + TaxClassList[txtClassList].Name + ":</label>";
            ltr_txtClass.Text += "   </td>";
            if (_TaxApi.GetItemByRegionId(TaxClassList[txtClassList].Id, rRegion.Id) == null)
            {
                ltr_txtClass.Text += "   <td class=\"value\">";
                ltr_txtClass.Text += "       <input disabled=\"true\" 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 disabled=\"true\" type=\"text\" id=\"txtClassRate" + txtClassList + "\" name=\"txtClassRate" + txtClassList + "\" value=\"" + _TaxApi.GetItemByRegionId(TaxClassList[txtClassList].Id, rRegion.Id).Rate * 100 + "\"/>%  ";
                ltr_txtClass.Text += "   </td>";
            }
            ltr_txtClass.Text += "</tr>";
        }
        ltr_txtClass.Text += "</table>";

        Util_SetEnabled(false);
        pnl_view.Visible = true;
        pnl_viewall.Visible = 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;
    }
Exemple #12
0
 public void drp_address_country_ServerChange(object sender, System.EventArgs e)
 {
     Ektron.Cms.Common.Criteria<RegionProperty> regioncriteria = new Ektron.Cms.Common.Criteria<RegionProperty>(RegionProperty.Name, Ektron.Cms.Common.EkEnumeration.OrderByDirection.Ascending);
     int cCountryId = Convert.ToInt32(Request.Form["drp_address_country"]);
     Util_BindRegions(cCountryId);
 }
Exemple #13
0
    protected void Display_View_All()
    {
        System.Collections.Generic.List<CustomerData> aCustomers = new System.Collections.Generic.List<CustomerData>();
        Ektron.Cms.Common.Criteria<CustomerProperty> cCriteria = new Ektron.Cms.Common.Criteria<CustomerProperty>();
        cCriteria.PagingInfo.RecordsPerPage = m_refContentApi.RequestInformationRef.PagingSize;
        cCriteria.PagingInfo.CurrentPage = _currentPageNumber;
        // aCustomers = Customer.GetAllCustomers(1, 1, 1, 1, Me.m_refContentApi.RequestInformationRef)

        aCustomers = CustomerManager.GetList(cCriteria);
        TotalPagesNumber = System.Convert.ToInt32(cCriteria.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;
            }
        }
        dg_customers.DataSource = aCustomers;
        dg_customers.DataBind();
    }
Exemple #14
0
    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 Process_AddEdit()
    {
        CountryData cCountry = null;
        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>();
        Ektron.Cms.Commerce.CountryTaxRateData m_CountryTax = new Ektron.Cms.Commerce.CountryTaxRateData();
        TaxClassList = _TaxClassApi.GetList(TaxClasscriteria);
        m_CountryTax = new CountryTaxRateData();
        _TaxApi = new TaxApi();

        if (this.m_iID > 0)
        {
            cCountry = _CountryApi.GetItem(Convert.ToInt32(this.m_iID));
            cCountry.Name = (string)txt_name.Text;
            cCountry.LongIsoCode = (string)txt_long.Text;
            cCountry.ShortIsoCode = (string)txt_short.Text;
            cCountry.Enabled = System.Convert.ToBoolean(chk_enabled.Checked);
            _CountryApi.Update(cCountry);

            for (int i = 0; i <= TaxClassList.Count - 1; i++)
            {
                tTax = _TaxApi.GetItemByCountryId(TaxClassList[i].Id, cCountry.Id);
                if (tTax == null)
                {
                    tTax = new CountryTaxRateData(cCountry.Id, 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]))
                    {
                        tTax.Rate = System.Convert.ToDecimal(Convert.ToDecimal(Request.Form["txtClassRate" + i]) / 100);
                        _TaxApi.Update(tTax);
                    }
                }
            }

            Response.Redirect(_PageName + "?action=view&id=" + m_iID.ToString(), false);
        }
        else
        {
            cCountry = new CountryData(Convert.ToInt32(txt_numeric.Text), txt_name.Text, txt_short.Text, txt_long.Text, chk_enabled.Checked);
            _CountryApi.Add(cCountry);

            for (int i = 0; i <= TaxClassList.Count - 1; i++)
            {
                tTax = new CountryTaxRateData(cCountry.Id, 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);
                }
            }

            Response.Redirect(_PageName, 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;
    }
Exemple #16
0
    protected void Display_View_All()
    {
        Ektron.Cms.Common.Criteria<WarehouseProperty> warehouseCriteria = new Ektron.Cms.Common.Criteria<WarehouseProperty>(WarehouseProperty.Name, Ektron.Cms.Common.EkEnumeration.OrderByDirection.Ascending);
        System.Collections.Generic.List<WarehouseData> WarehouseList = new System.Collections.Generic.List<WarehouseData>();
        int i = 0;

        m_refWarehouse = new WarehouseApi();

        dg_warehouse.AutoGenerateColumns = false;
        dg_warehouse.Columns.Clear();

        warehouseCriteria.PagingInfo.RecordsPerPage = m_refContentApi.RequestInformationRef.PagingSize;
        warehouseCriteria.PagingInfo.CurrentPage = _currentPageNumber;

        WarehouseList = m_refWarehouse.GetList(warehouseCriteria);

        TotalPagesNumber = System.Convert.ToInt32(warehouseCriteria.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 = "Radio";
        colBound.HeaderText = "";
        colBound.ItemStyle.Wrap = false;
        colBound.ItemStyle.VerticalAlign = VerticalAlign.Top;
        colBound.ItemStyle.HorizontalAlign = HorizontalAlign.Center;

        dg_warehouse.Columns.Add(colBound);

        colBound = new System.Web.UI.WebControls.BoundColumn();
        colBound.DataField = "Name";
        colBound.HeaderText = this.GetMessage("generic name");
        colBound.ItemStyle.Wrap = false;
        colBound.ItemStyle.VerticalAlign = VerticalAlign.Top;
        colBound.ItemStyle.HorizontalAlign = HorizontalAlign.Left;

        dg_warehouse.Columns.Add(colBound);

        colBound = new System.Web.UI.WebControls.BoundColumn();
        colBound.DataField = "ID";
        colBound.HeaderText = this.GetMessage("generic id");
        colBound.ItemStyle.Wrap = false;
        colBound.HeaderStyle.HorizontalAlign = HorizontalAlign.Center;
        colBound.ItemStyle.VerticalAlign = VerticalAlign.Top;
        colBound.ItemStyle.HorizontalAlign = HorizontalAlign.Center;

        dg_warehouse.Columns.Add(colBound);
        dg_warehouse.BorderColor = System.Drawing.Color.White;

        colBound = new System.Web.UI.WebControls.BoundColumn();
        colBound.DataField = "IsDefaultWarehouse";
        colBound.HeaderText = this.GetMessage("lbl default");
        colBound.ItemStyle.Wrap = false;
        colBound.HeaderStyle.HorizontalAlign = HorizontalAlign.Center;
        colBound.ItemStyle.VerticalAlign = VerticalAlign.Top;
        colBound.ItemStyle.HorizontalAlign = HorizontalAlign.Center;

        dg_warehouse.Columns.Add(colBound);
        dg_warehouse.BorderColor = System.Drawing.Color.White;

        DataTable dt = new DataTable();
        DataRow dr;

        dt.Columns.Add(new DataColumn("Radio", typeof(string)));
        dt.Columns.Add(new DataColumn("Name", typeof(string)));
        dt.Columns.Add(new DataColumn("Id", typeof(string)));
        dt.Columns.Add(new DataColumn("IsDefaultWarehouse", typeof(string)));

        if (!(WarehouseList == null))
        {
            for (i = 0; i <= WarehouseList.Count - 1; i++)
            {
                m_bIsDefault = System.Convert.ToBoolean(WarehouseList[i].IsDefaultWarehouse);
                dr = dt.NewRow();
                dr[0] = "<input type=\"radio\" id=\"radio_warehouse\" name=\"radio_warehouse\" value=\"" + WarehouseList[i].Id + "\" />";
                dr[1] = "<a href=\"shippingsource.aspx?action=View&id=" + WarehouseList[i].Id + "\">" + WarehouseList[i].Name + "</a>";
                dr[2] = "<label id=\"lbl_warehouseId\">" + WarehouseList[i].Id + "</label>";
                dr[3] = "<input type=\"CheckBox\" id=\"chk_default" + i + "\" name=\"chk_default" + i + "\" disabled=\"true\" " + (m_bIsDefault ? "Checked=\"checked\"" : "") + "/>";
                dt.Rows.Add(dr);
            }
        }

        DataView dv = new DataView(dt);
        dg_warehouse.DataSource = dv;
        dg_warehouse.DataBind();
    }
    protected void Display_AddEdit()
    {
        CountryData cCountry = new CountryData();
        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>();

        TaxClassList = _TaxClassApi.GetList(TaxClasscriteria);
        _TaxApi = new TaxApi();

        if (m_iID > 0)
        {
            cCountry = _CountryApi.GetItem(Convert.ToInt32(this.m_iID));
            txt_name.Enabled = false;
            chk_enabled.Enabled = false;
            txt_long.Enabled = false;
            txt_short.Enabled = false;
            txt_numeric.Text = this.m_iID.ToString();
            txt_numeric.Enabled = false;
        }

        Util_BindCountries();

        txt_name.Text = cCountry.Name;
        lbl_id.Text = cCountry.Id.ToString();
        chk_enabled.Checked = cCountry.Enabled;
        txt_long.Text = cCountry.LongIsoCode;
        txt_short.Text = cCountry.ShortIsoCode;

        int txtClassList = 0;

        ltr_txtClass.Text = "<table class=\"ektronGrid\">";
        for (txtClassList = 0; txtClassList <= TaxClassList.Count - 1; txtClassList++)
        {
            ltr_txtClass.Text += "<tr>";
            ltr_txtClass.Text += "   <td class=\"label\">";
            ltr_txtClass.Text += "       <label id=\"taxClass" + txtClassList + "\" value=\"" + TaxClassList[txtClassList].Name + "\">" + TaxClassList[txtClassList].Name + ":</label>";
            ltr_txtClass.Text += "   </td>";
            if (_TaxApi.GetItemByCountryId(TaxClassList[txtClassList].Id, cCountry.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.GetItemByCountryId(TaxClassList[txtClassList].Id, cCountry.Id).Rate * 100 + "\"/>%";
                ltr_txtClass.Text += "   </td>";
            }
            ltr_txtClass.Text += "<td >";
            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;

        TotalPages.Visible = false;
        CurrentPage.Visible = false;
        lnkBtnPreviousPage.Visible = false;
        NextPage.Visible = false;
        LastPage.Visible = false;
        FirstPage.Visible = false;
        PageLabel.Visible = false;
        OfLabel.Visible = false;
    }
Exemple #18
0
    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();
        }
    }
Exemple #19
0
    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\">" + "&nbsp;%" + "</label></td></tr>";
                    }
                    dr[1] += "</table></div>";
                    dt.Rows.Add(dr);
                }
            }
        }
        DataView dv = new DataView(dt);

        dg_viewall.DataSource = dv;
        dg_viewall.DataBind();
    }
Exemple #20
0
    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();
    }
Exemple #21
0
    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;
    }
Exemple #22
0
    protected void Display_View_All()
    {
        Ektron.Cms.Common.Criteria<PackageProperty> PackageCriteria = new Ektron.Cms.Common.Criteria<PackageProperty>(PackageProperty.Name, Ektron.Cms.Common.EkEnumeration.OrderByDirection.Ascending);
        System.Collections.Generic.List<PackageData> packagelist = new System.Collections.Generic.List<PackageData>();
        m_refPackage = new PackageApi();
        int i = 0;

        dg_package.AutoGenerateColumns = false;
        dg_package.Columns.Clear();

        PackageCriteria.PagingInfo.RecordsPerPage = m_refContentApi.RequestInformationRef.PagingSize;
        PackageCriteria.PagingInfo.CurrentPage = _currentPageNumber;

        packagelist = m_refPackage.GetList(PackageCriteria);

        TotalPagesNumber = System.Convert.ToInt32(PackageCriteria.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 = m_refMsg.GetMessage("generic id");
        colBound.ItemStyle.Wrap = false;
        colBound.ItemStyle.VerticalAlign = VerticalAlign.Top;
        colBound.ItemStyle.HorizontalAlign = HorizontalAlign.Left;
        colBound.HeaderStyle.CssClass = "title-header";
        dg_package.Columns.Add(colBound);

        colBound = new System.Web.UI.WebControls.BoundColumn();
        colBound.DataField = "Name";
        colBound.HeaderText = m_refMsg.GetMessage("generic name");
        colBound.ItemStyle.Wrap = false;
        colBound.ItemStyle.VerticalAlign = VerticalAlign.Top;
        colBound.ItemStyle.HorizontalAlign = HorizontalAlign.Left;
        colBound.HeaderStyle.CssClass = "title-header";
        dg_package.Columns.Add(colBound);

        colBound = new System.Web.UI.WebControls.BoundColumn();
        colBound.DataField = "Length";
        colBound.HeaderText = m_refMsg.GetMessage("lbl length");
        colBound.ItemStyle.Wrap = false;
        colBound.HeaderStyle.HorizontalAlign = HorizontalAlign.Center;
        colBound.ItemStyle.VerticalAlign = VerticalAlign.Top;
        colBound.ItemStyle.HorizontalAlign = HorizontalAlign.Right;
        colBound.HeaderStyle.CssClass = "title-header";
        dg_package.Columns.Add(colBound);
        dg_package.BorderColor = System.Drawing.Color.White;

        colBound = new System.Web.UI.WebControls.BoundColumn();
        colBound.DataField = "Height";
        colBound.HeaderText = m_refMsg.GetMessage("lbl height");
        colBound.ItemStyle.Wrap = false;
        colBound.HeaderStyle.HorizontalAlign = HorizontalAlign.Center;
        colBound.ItemStyle.VerticalAlign = VerticalAlign.Top;
        colBound.ItemStyle.HorizontalAlign = HorizontalAlign.Right;
        colBound.HeaderStyle.CssClass = "title-header";
        dg_package.Columns.Add(colBound);
        dg_package.BorderColor = System.Drawing.Color.White;

        colBound = new System.Web.UI.WebControls.BoundColumn();
        colBound.DataField = "Width";
        colBound.HeaderText = m_refMsg.GetMessage("lbl width");
        colBound.ItemStyle.Wrap = false;
        colBound.HeaderStyle.HorizontalAlign = HorizontalAlign.Center;
        colBound.ItemStyle.VerticalAlign = VerticalAlign.Top;
        colBound.ItemStyle.HorizontalAlign = HorizontalAlign.Right;
        colBound.HeaderStyle.CssClass = "title-header";
        dg_package.Columns.Add(colBound);
        dg_package.BorderColor = System.Drawing.Color.White;

        colBound = new System.Web.UI.WebControls.BoundColumn();
        colBound.DataField = "Weight";
        colBound.HeaderText = m_refMsg.GetMessage("lbl maxweight");
        colBound.ItemStyle.Wrap = false;
        colBound.HeaderStyle.HorizontalAlign = HorizontalAlign.Center;
        colBound.ItemStyle.VerticalAlign = VerticalAlign.Top;
        colBound.ItemStyle.HorizontalAlign = HorizontalAlign.Right;
        colBound.HeaderStyle.CssClass = "title-header";
        dg_package.Columns.Add(colBound);
        dg_package.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("Length", typeof(string)));
        dt.Columns.Add(new DataColumn("Height", typeof(string)));
        dt.Columns.Add(new DataColumn("Width", typeof(string)));
        dt.Columns.Add(new DataColumn("Weight", typeof(string)));

        if (!(packagelist == null))
        {
            for (i = 0; i <= packagelist.Count - 1; i++)
            {
                dr = dt.NewRow();
                string dimensionUnit = "";
                string weightUnit = "";
                if (measurementSystem == Ektron.Cms.Common.EkEnumeration.MeasurementSystem.English.ToString())
                {
                    dimensionUnit = m_refMsg.GetMessage("lbl inches");
                    weightUnit = m_refMsg.GetMessage("lbl pounds");
                }
                else
                {
                    dimensionUnit = m_refMsg.GetMessage("lbl centimeters");
                    weightUnit = m_refMsg.GetMessage("lbl kilograms");
                }

                dr[0] = "<a href=\"packagesize.aspx?action=View&id=" + packagelist[i].Id + "\">" + packagelist[i].Id + "</a>";
                dr[1] = "<a href=\"packagesize.aspx?action=View&id=" + packagelist[i].Id + "\">" + packagelist[i].Name + "</a>";
                dr[2] = "<label id=\"length\">" + packagelist[i].Dimensions.Length + "&nbsp;" + dimensionUnit + "</label>";
                dr[3] = "<label id=\"height\">" + packagelist[i].Dimensions.Height + "&nbsp;" + dimensionUnit + "</label>";
                dr[4] = "<label id=\"width\">" + packagelist[i].Dimensions.Width + "&nbsp;" + dimensionUnit + "</label>";
                dr[5] = "<label id=\"weight\">" + packagelist[i].MaxWeight.Amount + "&nbsp;" + weightUnit + "</label>";

                dt.Rows.Add(dr);
            }
        }

        DataView dv = new DataView(dt);
        dg_package.DataSource = dv;
        dg_package.DataBind();
    }
Exemple #23
0
    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)
        {

        }
    }
    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();
    }
Exemple #25
0
        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());
        }
    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);
    }
Exemple #27
0
    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_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();
    }
Exemple #29
0
    private void Display_ViewAll()
    {
        Ektron.Cms.Common.Criteria<CurrencyProperty> criteria = new Ektron.Cms.Common.Criteria<CurrencyProperty>(sortCriteria, Ektron.Cms.Common.EkEnumeration.OrderByDirection.Ascending);
            if (sortCriteria == CurrencyProperty.Enabled)
            {
                criteria = new Ektron.Cms.Common.Criteria<CurrencyProperty>(sortCriteria, Ektron.Cms.Common.EkEnumeration.OrderByDirection.Descending);
            }
            System.Collections.Generic.List<CurrencyData> currencyList;

            criteria.PagingInfo.RecordsPerPage = m_refContentApi.RequestInformationRef.PagingSize;
            criteria.PagingInfo.CurrentPage = _currentPageNumber;

            if (!string.IsNullOrEmpty(searchCriteria))
            {
                criteria.AddFilter(CurrencyProperty.Name, Ektron.Cms.Common.CriteriaFilterOperator.Contains, searchCriteria);
            }
            if (criteria != null)
            {
                currencyList = m_refCurrency.GetList(criteria);
                ViewSubscriptionGrid.Columns[ViewSubscriptionGrid.Columns.Count - 1].Visible = false;
                ViewSubscriptionGrid.DataSource = currencyList;
                ViewSubscriptionGrid.DataBind();
                TotalPagesNumber = System.Convert.ToInt32(criteria.PagingInfo.TotalPages);
                Util_SetJs();
                Util_SetPaging();
                Util_SetLabels();
            }
    }
Exemple #30
0
    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;

            }

        }
    }