Ejemplo n.º 1
0
    public static int GetPrice(string CountryCode, GeolocatedFeatureType feature)
    {
        //For his CC
        var where2 = TableHelper.MakeDictionary("FeatureId", (int)feature);

        where2.Add("CC", CountryCode);
        var forHisCC = TableHelper.SelectRows <GeolocatedFeature>(where2);

        if (forHisCC.Count > 0)
        {
            return(forHisCC[0].Points);
        }

        //For all countries
        var where = TableHelper.MakeDictionary("FeatureId", (int)feature);
        where.Add("CC", GiftCodeExchangeRate.AllCountriesRegex);
        var listForAll = TableHelper.SelectRows <GeolocatedFeature>(where);

        if (listForAll.Count > 0)
        {
            return(listForAll[0].Points);
        }

        return(-1);
    }
Ejemplo n.º 2
0
    public FeatureManager(GeolocatedFeatureType feature)
    {
        string ip = Member.GetCurrentIP(HttpContext.Current.Request);
        var    ci = new CountryInformation(ip);

        this.CC      = ci.CountryCode;
        this.Feature = feature;
    }
Ejemplo n.º 3
0
 public static int GetPrice(Member user, GeolocatedFeatureType feature)
 {
     return(GetPrice(user.CountryCode, feature));
 }
Ejemplo n.º 4
0
 public FeatureManager(Member user, GeolocatedFeatureType feature)
 {
     this.CC      = user.CountryCode;
     this.Feature = feature;
 }