Ejemplo n.º 1
0
 protected void repeaterCountry_ItemCommand(object source, RepeaterCommandEventArgs e)
 {
     if (e.CommandName == "DelCountry")
     {
         var id = SQLDataHelper.GetInt(e.CommandArgument);
         ShippingPaymentGeoMaping.DeletePaymentCountry(PaymentMethodID, id);
     }
 }
Ejemplo n.º 2
0
 protected void repeaterCity_ItemCommand(object source, RepeaterCommandEventArgs e)
 {
     if (e.CommandName == "DelCity")
     {
         var id = Convert.ToInt32(e.CommandArgument);
         ShippingPaymentGeoMaping.DeletePaymentCity(PaymentMethodID, id);
     }
 }
Ejemplo n.º 3
0
 protected void btnAddCity_Click(object sender, EventArgs e)
 {
     if (!string.IsNullOrEmpty(txtCity.Text))
     {
         var city = CityService.GetCityByName(txtCity.Text);
         if (city != null)
         {
             if (!ShippingPaymentGeoMaping.IsExistPaymentCity(PaymentMethodID, city.CityID))
             {
                 ShippingPaymentGeoMaping.AddPaymentCity(PaymentMethodID, city.CityID);
             }
             txtCity.Text = string.Empty;
         }
     }
 }
Ejemplo n.º 4
0
 protected void btnAddCountry_Click(object sender, EventArgs e)
 {
     if (!string.IsNullOrEmpty(txtCountry.Text))
     {
         var country = CountryService.GetCountryByName(txtCountry.Text);
         if (country != null)
         {
             if (!ShippingPaymentGeoMaping.IsExistPaymentCountry(PaymentMethodID, country.CountryId))
             {
                 ShippingPaymentGeoMaping.AddPaymentCountry(PaymentMethodID, country.CountryId);
             }
             txtCountry.Text = string.Empty;
         }
     }
 }
Ejemplo n.º 5
0
        protected void btnAddCityExcluded_Click(object sender, EventArgs e)
        {
            if (string.IsNullOrEmpty(txtCityExcluded.Text))
            {
                return;
            }
            var city = CityService.GetCityByName(txtCityExcluded.Text);

            if (city == null)
            {
                return;
            }
            if (!ShippingPaymentGeoMaping.IsExistShippingCityExcluded(ShippingMethodId, city.CityId))
            {
                ShippingPaymentGeoMaping.AddShippingCityExcluded(ShippingMethodId, city.CityId);
            }
            txtCityExcluded.Text = string.Empty;
        }
Ejemplo n.º 6
0
        protected void btnAddCountry_Click(object sender, EventArgs e)
        {
            if (string.IsNullOrEmpty(txtCountry.Text))
            {
                return;
            }
            var country = CountryService.GetCountryByName(txtCountry.Text);

            if (country == null)
            {
                return;
            }
            if (!ShippingPaymentGeoMaping.IsExistShippingCountry(ShippingMethodId, country.CountryId))
            {
                ShippingPaymentGeoMaping.AddShippingCountry(ShippingMethodId, country.CountryId);
            }
            txtCountry.Text = string.Empty;
        }
Ejemplo n.º 7
0
        private List <ShippingMethod> UseGeoMapping(List <ShippingMethod> listMethods)
        {
            var items = new List <ShippingMethod>();

            for (int i = 0; i < listMethods.Count; i++)
            {
                if (ShippingPaymentGeoMaping.IsExistGeoShipping(listMethods[i].ShippingMethodId))
                {
                    if (ShippingPaymentGeoMaping.CheckShippingEnabledGeo(listMethods[i].ShippingMethodId, _countryName, _cityTo))
                    {
                        items.Add(listMethods[i]);
                    }
                }
                else
                {
                    items.Add(listMethods[i]);
                }
            }
            return(items);
        }
Ejemplo n.º 8
0
        private IEnumerable <ShippingMethod> GetShippingMethodsByGeoMapping(IEnumerable <ShippingMethod> listMethods)
        {
            var items = new List <ShippingMethod>();

            foreach (var shippingMethod in listMethods)
            {
                if (ShippingPaymentGeoMaping.IsExistGeoShipping(shippingMethod.ShippingMethodId))
                {
                    if (ShippingPaymentGeoMaping.CheckShippingEnabledGeo(shippingMethod.ShippingMethodId, _countryName, _cityTo))
                    {
                        items.Add(shippingMethod);
                    }
                }
                else
                {
                    items.Add(shippingMethod);
                }
            }
            return(items);
        }
Ejemplo n.º 9
0
    private List <PaymentMethod> UseGeoMapping(IEnumerable <PaymentMethod> listMethods, string countryName, string cityName)
    {
        var items = new List <PaymentMethod>();

        foreach (var elem in listMethods)
        {
            if (ShippingPaymentGeoMaping.IsExistGeoPayment(elem.PaymentMethodID))
            {
                if (ShippingPaymentGeoMaping.CheckPaymentEnabledGeo(elem.PaymentMethodID, countryName, cityName))
                {
                    items.Add(elem);
                }
            }
            else
            {
                items.Add(elem);
            }
        }

        return(items);
    }