public string DeleteMultipleCartPricingRules(string cartRulesIds, Int32 storeID, Int32 portalID, string userName, string culture) { try { PriceRuleController priceRuleController = new PriceRuleController(); priceRuleController.CartPriceMultipleRulesDelete(cartRulesIds, storeID, portalID, userName, culture); return "({ \"returnStatus\" : 1 , \"Message\" : \"Deleting multiple cart pricing rules 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 deleting cart pricing rule!\" })"; } } }
public CartPricingRuleInfo GetCartPricingRule(Int32 cartPriceRuleID, Int32 storeID, Int32 portalID, string userName, string culture) { CartPricingRuleInfo cartPricingRuleInfo; PriceRuleController priceRuleController = new PriceRuleController(); cartPricingRuleInfo = priceRuleController.GetCartPriceRules(cartPriceRuleID, storeID, portalID, userName, culture); return cartPricingRuleInfo; }
public List<CartPriceRulePaging> GetCartPricingRules(string ruleName, System.Nullable<DateTime> startDate, System.Nullable<DateTime> endDate, System.Nullable<bool> isActive, Int32 storeID, Int32 portalID, string userName, string culture, int offset, int limit) { PriceRuleController priceRuleController = new PriceRuleController(); return priceRuleController.GetCartPricingRules(ruleName, startDate, endDate, isActive, storeID, portalID, userName, culture, offset, limit); }
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 List<PortalRole> GetAllRoles(Int32 storeID, Int32 portalID, string userName, string culture) { try { List<PortalRole> portalRoleCollection; PriceRuleController priceRuleController = new PriceRuleController(); portalRoleCollection = priceRuleController.GetPortalRoles(portalID, true, userName); return portalRoleCollection; } catch (Exception ex) { throw ex; } }
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!\" })"; } } }