public string SaveCartPricingRule(CartPricingRuleInfo objCartPriceRule, Int32 storeID, Int32 portalID, string userName, string culture, object parentID) { try { List<KeyValuePair<string, object>> P1 = new List<KeyValuePair<string, object>>(); //P1.Add(new KeyValuePair<string,object>("@StoreID", storeID)); P1.Add(new KeyValuePair<string, object>("PortalID", portalID)); SQLHandler sql = new SQLHandler(); int count = sql.ExecuteAsScalar<int>("usp_ASPX_CartPrincingRuleCount", P1); int maxAllowed = 3; int cartPriceRuleId = objCartPriceRule.CartPriceRule.CartPriceRuleID; if (cartPriceRuleId > 0) { maxAllowed++; } if (count < maxAllowed) { PriceRuleController priceRuleController = new PriceRuleController(); priceRuleController.SaveCartPricingRule(objCartPriceRule, storeID, portalID, userName, culture, parentID); //return "({ \"returnStatus\" : 1 , \"Message\" : \"Saving cart pricing rule successfully.\" })"; return "success"; } else { //return "({ \"returnStatus\" : -1 , \"Message\" : \"No more than 3 rules are allowed in Free version of AspxCommerce!\" })"; return "notify"; } } catch (Exception ex) { ErrorHandler errHandler = new ErrorHandler(); if (errHandler.LogWCFException(ex)) { return "({ \"returnStatus\" : -1 , \"errorMessage\" : \"" + ex.Message + "\" })"; } else { return "({ \"returnStatus\" : -1, \"errorMessage\" : \"Error while saving cart pricing rule!\" })"; } } }
public string SaveCartPricingRule(CartPricingRuleInfo objCartPriceRule, Int32 storeID, Int32 portalID, string userName, string culture, Array parentID) { try { PriceRuleController priceRuleController = new PriceRuleController(); priceRuleController.SaveCartPricingRule(objCartPriceRule, storeID, portalID, userName, culture, parentID); return "({ \"returnStatus\" : 1 , \"Message\" : \"Saving cart pricing rule successfully.\" })"; } catch (Exception ex) { ErrorHandler errHandler = new ErrorHandler(); if (errHandler.LogWCFException(ex)) { return "({ \"returnStatus\" : -1 , \"errorMessage\" : \"" + ex.Message + "\" })"; } else { return "({ \"returnStatus\" : -1, \"errorMessage\" : \"Error while saving cart pricing rule!\" })"; } } }