public List <PortalRole> GetPortalRoles(int portalID, bool isAll, string userName)
        {
            string rolePrefix = string.Empty;
            PriceRuleSqlProvider priceRuleSqlProvider = new PriceRuleSqlProvider();
            List <PortalInfo>    portalInfoList       = priceRuleSqlProvider.GetPortalSeoName(portalID, userName);

            if (portalInfoList.Count > 0)
            {
                rolePrefix = portalInfoList[0].SEOName.Trim() + "_";
            }

            List <PortalRole> portalRoleList = priceRuleSqlProvider.GetPortalRoles(portalID, isAll, userName);

            foreach (PortalRole pr in portalRoleList)
            {
                bool isSystemRole = false;
                foreach (string sysRole in SystemSetting.SYSTEM_ROLES)
                {
                    if (sysRole.ToLower() == pr.RoleName.ToLower())
                    {
                        isSystemRole = true;
                    }
                }
                if (!isSystemRole)
                {
                    pr.RoleName = pr.RoleName.Replace(rolePrefix, "");
                }
            }
            return(portalRoleList);
        }
        public List <CatalogPriceRulePaging> GetCatalogPricingRules(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)
        {
            PriceRuleSqlProvider          priceRuleSqlProvider = new PriceRuleSqlProvider();
            List <CatalogPriceRulePaging> lstCatalogPriceRule  = priceRuleSqlProvider.GetCatalogPricingRules(ruleName, startDate, endDate, isActive, storeID, portalID, userName, culture, offset, limit);

            return(lstCatalogPriceRule);
        }
        public List<PortalRole> GetPortalRoles(int portalID, bool isAll, string userName)
        {
            string rolePrefix = string.Empty;
            PriceRuleSqlProvider priceRuleSqlProvider = new PriceRuleSqlProvider();
            List<PortalStoreInfo> portalInfoList = priceRuleSqlProvider.GetPortalSeoName(portalID, userName);
            if (portalInfoList.Count > 0)
            {
                rolePrefix = portalInfoList[0].SEOName.Trim() + "_";
            }

            List<PortalRole> portalRoleList = priceRuleSqlProvider.GetPortalRoles(portalID, isAll, userName);
            foreach (PortalRole pr in portalRoleList)
            {
                bool isSystemRole = false;
                foreach (string sysRole in SystemSetting.SYSTEM_ROLES)
                {
                    if (sysRole.ToLower() == pr.RoleName.ToLower())
                    {
                        isSystemRole = true;
                    }
                }
                if (!isSystemRole)
                {
                    pr.RoleName = pr.RoleName.Replace(rolePrefix, "");
                }
            }
            return portalRoleList;
        }
        public CatalogPricingRuleInfo GetCatalogPricingRule(Int32 catalogPriceRuleID, Int32 storeID, Int32 portalID, string userName, string culture)
        {
            PriceRuleSqlProvider priceRuleSqlProvider = new PriceRuleSqlProvider();
            DataSet ds = new DataSet();

            ds = priceRuleSqlProvider.GetCatalogPricingRule(catalogPriceRuleID, storeID, portalID, userName, culture);
            DataTable dtCatalogPricingRule        = ds.Tables[0];
            DataTable dtCatalogPriceRuleCondition = ds.Tables[1];
            DataTable dtCatalogConditionDetails   = ds.Tables[2];
            DataTable dtCatalogPriceRuleRoles     = ds.Tables[3];
            List <CatalogPriceRule> lstCatalogPriceRule;

            lstCatalogPriceRule = DataSourceHelper.FillCollection <CatalogPriceRule>(dtCatalogPricingRule);

            List <CatalogPriceRuleCondition> lstCatalogPriceRuleCondition;

            lstCatalogPriceRuleCondition = DataSourceHelper.FillCollection <CatalogPriceRuleCondition>(dtCatalogPriceRuleCondition);

            List <CatalogPriceRuleRole> lstCatalogPriceRuleRole;

            lstCatalogPriceRuleRole = DataSourceHelper.FillCollection <CatalogPriceRuleRole>(dtCatalogPriceRuleRoles);

            List <CatalogConditionDetail> lstCatalogConditionDetail;

            lstCatalogConditionDetail = DataSourceHelper.FillCollection <CatalogConditionDetail>(dtCatalogConditionDetails);

            CatalogPricingRuleInfo catalogPricingRuleInfo = new CatalogPricingRuleInfo();
            CatalogPriceRule       catalogPriceRule       = lstCatalogPriceRule[0];

            catalogPricingRuleInfo.CatalogPriceRule = catalogPriceRule;
            List <CatalogPriceRuleCondition> lstCPRC = new List <CatalogPriceRuleCondition>();

            foreach (CatalogPriceRuleCondition catalogPriceRuleCondition in lstCatalogPriceRuleCondition)
            {
                List <CatalogConditionDetail> lstCCD = new List <CatalogConditionDetail>();
                foreach (CatalogConditionDetail catalogConditionDetail in lstCatalogConditionDetail)
                {
                    if (catalogPriceRuleCondition.CatalogPriceRuleConditionID == catalogConditionDetail.CatalogPriceRuleConditionID)
                    {
                        lstCCD.Add(catalogConditionDetail);
                    }
                }
                catalogPriceRuleCondition.CatalogConditionDetail = lstCCD;
                lstCPRC.Add(catalogPriceRuleCondition);
            }
            catalogPricingRuleInfo.CatalogPriceRuleConditions = lstCPRC;

            List <CatalogPriceRuleRole> lstCPRR = new List <CatalogPriceRuleRole>();

            foreach (CatalogPriceRuleRole catalogPriceRuleRole in lstCatalogPriceRuleRole)
            {
                if (catalogPriceRuleRole.CatalogPriceRuleID == catalogPriceRule.CatalogPriceRuleID)
                {
                    lstCPRR.Add(catalogPriceRuleRole);
                }
            }
            catalogPricingRuleInfo.CatalogPriceRuleRoles = lstCPRR;

            return(catalogPricingRuleInfo);
        }
Ejemplo n.º 5
0
        public List <CatalogPriceRulePaging> GetCatalogPricingRules(string ruleName, System.Nullable <DateTime> startDate, System.Nullable <DateTime> endDate, System.Nullable <bool> isActive, AspxCommonInfo aspxCommonObj, int offset, int limit)
        {
            PriceRuleSqlProvider          priceRuleSqlProvider = new PriceRuleSqlProvider();
            List <CatalogPriceRulePaging> lstCatalogPriceRule  = priceRuleSqlProvider.GetCatalogPricingRules(ruleName, startDate, endDate, isActive, aspxCommonObj, offset, limit);

            return(lstCatalogPriceRule);
        }
Ejemplo n.º 6
0
        public int SaveCatalogPricingRule(CatalogPricingRuleInfo objCatalogPricingRuleInfo, AspxCommonInfo aspxCommonObj, object parentID)
        {
            int catalogPriceRuleID = -1;
            PriceRuleSqlProvider priceRuleSqlProvider = new PriceRuleSqlProvider();

            catalogPriceRuleID = priceRuleSqlProvider.CatalogPriceRuleAdd(objCatalogPricingRuleInfo.CatalogPriceRule, aspxCommonObj);

            if (catalogPriceRuleID > 0)
            {
                int           count = 0;
                int           cpID  = 0;
                int           catalogConditionID = 0;
                List <object> lstParent          = new JavaScriptSerializer().ConvertToType <List <object> >(parentID);

                foreach (CatalogPriceRuleCondition catalogPriceRuleCondition in objCatalogPricingRuleInfo.CatalogPriceRuleConditions)
                {
                    if (count == 1 && catalogConditionID > 1)
                    {
                        cpID = catalogConditionID - 1;
                    }
                    catalogPriceRuleCondition.ParentID           = cpID + int.Parse(lstParent[count].ToString());
                    catalogPriceRuleCondition.CatalogPriceRuleID = catalogPriceRuleID;
                    catalogConditionID = priceRuleSqlProvider.CatalogPriceRuleConditionAdd(catalogPriceRuleCondition, aspxCommonObj);
                    count++;
                }

                int catalogPriceRuleRoleID = -1;
                foreach (CatalogPriceRuleRole catalogPriceRuleRole in objCatalogPricingRuleInfo.CatalogPriceRuleRoles)
                {
                    catalogPriceRuleRole.CatalogPriceRuleID = catalogPriceRuleID;
                    catalogPriceRuleRoleID = priceRuleSqlProvider.CatalogPriceRuleRoleAdd(catalogPriceRuleRole, aspxCommonObj);
                }
            }
            return(1);
        }
        public CatalogPricingRuleInfo GetCatalogPricingRule(Int32 catalogPriceRuleID,AspxCommonInfo aspxCommonObj)
        {
            PriceRuleSqlProvider priceRuleSqlProvider = new PriceRuleSqlProvider();
            DataSet ds = new DataSet();
            ds = priceRuleSqlProvider.GetCatalogPricingRule(catalogPriceRuleID,aspxCommonObj);
            DataTable dtCatalogPricingRule = ds.Tables[0];
            DataTable dtCatalogPriceRuleCondition = ds.Tables[1];
            DataTable dtCatalogConditionDetails = ds.Tables[2];
            DataTable dtCatalogPriceRuleRoles = ds.Tables[3];
            List<CatalogPriceRule> lstCatalogPriceRule;
            lstCatalogPriceRule = DataSourceHelper.FillCollection<CatalogPriceRule>(dtCatalogPricingRule);

            List<CatalogPriceRuleCondition> lstCatalogPriceRuleCondition;
            lstCatalogPriceRuleCondition = DataSourceHelper.FillCollection<CatalogPriceRuleCondition>(dtCatalogPriceRuleCondition);

            List<CatalogPriceRuleRole> lstCatalogPriceRuleRole;
            lstCatalogPriceRuleRole = DataSourceHelper.FillCollection<CatalogPriceRuleRole>(dtCatalogPriceRuleRoles);

            List<CatalogConditionDetail> lstCatalogConditionDetail;
            lstCatalogConditionDetail = DataSourceHelper.FillCollection<CatalogConditionDetail>(dtCatalogConditionDetails);

            CatalogPricingRuleInfo catalogPricingRuleInfo = new CatalogPricingRuleInfo();
            CatalogPriceRule catalogPriceRule = lstCatalogPriceRule[0];
            catalogPricingRuleInfo.CatalogPriceRule = catalogPriceRule;
            List<CatalogPriceRuleCondition> lstCPRC = new List<CatalogPriceRuleCondition>();
            foreach (CatalogPriceRuleCondition catalogPriceRuleCondition in lstCatalogPriceRuleCondition)
            {
                List<CatalogConditionDetail> lstCCD = new List<CatalogConditionDetail>();
                foreach (CatalogConditionDetail catalogConditionDetail in lstCatalogConditionDetail)
                {
                    if (catalogPriceRuleCondition.CatalogPriceRuleConditionID == catalogConditionDetail.CatalogPriceRuleConditionID)
                    {
                        lstCCD.Add(catalogConditionDetail);
                    }
                }
                catalogPriceRuleCondition.CatalogConditionDetail = lstCCD;
                lstCPRC.Add(catalogPriceRuleCondition);
            }
            catalogPricingRuleInfo.CatalogPriceRuleConditions = lstCPRC;

            List<CatalogPriceRuleRole> lstCPRR = new List<CatalogPriceRuleRole>();
            foreach (CatalogPriceRuleRole catalogPriceRuleRole in lstCatalogPriceRuleRole)
            {
                if (catalogPriceRuleRole.CatalogPriceRuleID == catalogPriceRule.CatalogPriceRuleID)
                {
                    lstCPRR.Add(catalogPriceRuleRole);
                }
            }
            catalogPricingRuleInfo.CatalogPriceRuleRoles = lstCPRR;

            return catalogPricingRuleInfo;
        }
        public int CatalogPriceRuleConditionAdd(CatalogPriceRuleCondition catalogPriceRuleCondition, Int32 storeID, Int32 portalID, string userName, string culture)
        {
            SqlCommand sqlCommand = new SqlCommand();

            sqlCommand.Parameters.Add(new SqlParameter("@CatalogPriceRuleID", catalogPriceRuleCondition.CatalogPriceRuleID));
            sqlCommand.Parameters.Add(new SqlParameter("@IsAll", catalogPriceRuleCondition.IsAll));
            sqlCommand.Parameters.Add(new SqlParameter("@IsTrue", catalogPriceRuleCondition.IsTrue));
            sqlCommand.Parameters.Add(new SqlParameter("@ParentID", catalogPriceRuleCondition.ParentID));
            sqlCommand.Parameters.Add(new SqlParameter("@IsActive", true));
            sqlCommand.Parameters.Add(new SqlParameter("@StoreID", storeID));
            sqlCommand.Parameters.Add(new SqlParameter("@PortalID", portalID));
            sqlCommand.Parameters.Add(new SqlParameter("@Username", userName));
            sqlCommand.Parameters.Add(new SqlParameter("@CultureName", culture));
            sqlCommand.CommandText = "usp_Aspx_CatalogPriceRuleConditionAdd";
            sqlCommand.CommandType = CommandType.StoredProcedure;
            SqlConnection sqlConnection = new SqlConnection(ConnectionString);

            try
            {
                sqlCommand.Connection = sqlConnection;
                sqlConnection.Open();
                object val = sqlCommand.ExecuteScalar();
                if (Convert.ToInt16(val) > 0)
                {
                    int catalogConditionDetailID = -1;
                    PriceRuleSqlProvider priceRuleSqlProvider = new PriceRuleSqlProvider();
                    foreach (CatalogConditionDetail catalogConditionDetail in catalogPriceRuleCondition.CatalogConditionDetail)
                    {
                        if (catalogConditionDetail != null)
                        {
                            catalogConditionDetail.CatalogPriceRuleConditionID = Convert.ToInt16(val);
                            catalogConditionDetail.CatalogPriceRuleID          = catalogPriceRuleCondition.CatalogPriceRuleID;
                            catalogConditionDetailID =
                                priceRuleSqlProvider.CatalogConditionDetailAdd(catalogConditionDetail, storeID, portalID,
                                                                               userName, culture);
                            if (!(catalogConditionDetailID > 0))
                            {
                            }
                        }
                    }
                }
                return(Convert.ToInt16(val));
            }
            catch (Exception e)
            {
                throw e;
            }
            finally
            {
                sqlConnection.Close();
            }
        }
        public int SaveCartPricingRule(CartPricingRuleInfo objCartPriceRule, Int32 storeID, Int32 portalID, string userName, string culture, object parentID)
        {
            SQLHandler     sqlH = new SQLHandler();
            SqlTransaction tran;

            tran = (SqlTransaction)sqlH.GetTransaction();
            PriceRuleSqlProvider priceRuleSqlProvider = new PriceRuleSqlProvider();

            try
            {
                int cartPriceRuleID = -1;
                cartPriceRuleID = priceRuleSqlProvider.CartPriceRuleAdd(objCartPriceRule.CartPriceRule, tran, portalID, userName, culture);

                priceRuleSqlProvider.RuleConditionAdd(objCartPriceRule.LstRuleCondition, cartPriceRuleID, parentID, tran, portalID, userName, culture);

                foreach (CartPriceRuleRole cartPriceRuleRole in objCartPriceRule.LstCartPriceRuleRoles)
                {
                    cartPriceRuleRole.CartPriceRuleID = cartPriceRuleID;
                    priceRuleSqlProvider.CartPriceRuleRoleAdd(cartPriceRuleRole, tran, portalID, userName, culture);
                }

                foreach (CartPriceRuleStore cartPriceRuleStore in objCartPriceRule.LstCartPriceRuleStores)
                {
                    cartPriceRuleStore.CartPriceRuleID = cartPriceRuleID;
                    priceRuleSqlProvider.CartPriceRuleStoreAdd(cartPriceRuleStore, tran, portalID, userName, culture);
                }
                tran.Commit();
                return(cartPriceRuleID);
            }

            catch (SqlException sqlEX)
            {
                tran.Rollback();
                throw new ArgumentException(sqlEX.Message);
            }
            catch (Exception ex)
            {
                tran.Rollback();
                throw ex;
            }
        }
 public int CartPriceRuleDelete(int cartPriceRuleID, AspxCommonInfo aspxCommonObj)
 {
     PriceRuleSqlProvider priceRuleSqlProvider = new PriceRuleSqlProvider();
     return priceRuleSqlProvider.CartPriceRuleDelete(cartPriceRuleID,aspxCommonObj);
 }
        public int SaveCartPricingRule(CartPricingRuleInfo objCartPriceRule, AspxCommonInfo aspxCommonObj, object parentID)
        {
            SQLHandler sqlH = new SQLHandler();
            SqlTransaction tran;
            tran = (SqlTransaction) sqlH.GetTransaction();
            PriceRuleSqlProvider priceRuleSqlProvider = new PriceRuleSqlProvider();
            try
            {
                int cartPriceRuleID = -1;
                cartPriceRuleID = priceRuleSqlProvider.CartPriceRuleAdd(objCartPriceRule.CartPriceRule, tran,aspxCommonObj);

                priceRuleSqlProvider.RuleConditionAdd(objCartPriceRule.LstRuleCondition,cartPriceRuleID,parentID, tran,aspxCommonObj);

                foreach (CartPriceRuleRole cartPriceRuleRole in objCartPriceRule.LstCartPriceRuleRoles)
                {
                    cartPriceRuleRole.CartPriceRuleID = cartPriceRuleID;
                    priceRuleSqlProvider.CartPriceRuleRoleAdd(cartPriceRuleRole, tran,aspxCommonObj);
                }

                foreach (CartPriceRuleStore cartPriceRuleStore in objCartPriceRule.LstCartPriceRuleStores)
                {
                    cartPriceRuleStore.CartPriceRuleID = cartPriceRuleID;
                    priceRuleSqlProvider.CartPriceRuleStoreAdd(cartPriceRuleStore, tran,aspxCommonObj);
                }
                tran.Commit();
                return cartPriceRuleID;
            }

            catch (SqlException sqlEX)
            {
                tran.Rollback();
                throw new ArgumentException(sqlEX.Message);
            }
            catch (Exception ex)
            {
                tran.Rollback();
                throw ex;
            }
        }
        public int SaveCatalogPricingRule(CatalogPricingRuleInfo objCatalogPricingRuleInfo, AspxCommonInfo aspxCommonObj, object parentID)
        {

            int catalogPriceRuleID = -1;
            PriceRuleSqlProvider priceRuleSqlProvider = new PriceRuleSqlProvider();
            catalogPriceRuleID = priceRuleSqlProvider.CatalogPriceRuleAdd(objCatalogPricingRuleInfo.CatalogPriceRule, aspxCommonObj);

            if (catalogPriceRuleID > 0)
            {
                int count = 0;
                int cpID = 0;
                int catalogConditionID = 0;
                List<object> lstParent = new JavaScriptSerializer().ConvertToType<List<object>>(parentID);

                foreach (CatalogPriceRuleCondition catalogPriceRuleCondition in objCatalogPricingRuleInfo.CatalogPriceRuleConditions)
                {
                    if (count == 1 && catalogConditionID > 1)
                        cpID = catalogConditionID - 1;
                    catalogPriceRuleCondition.ParentID = cpID + int.Parse(lstParent[count].ToString());
                    catalogPriceRuleCondition.CatalogPriceRuleID = catalogPriceRuleID;
                    catalogConditionID = priceRuleSqlProvider.CatalogPriceRuleConditionAdd(catalogPriceRuleCondition, aspxCommonObj);
                    count++;
                }

                int catalogPriceRuleRoleID = -1;
                foreach (CatalogPriceRuleRole catalogPriceRuleRole in objCatalogPricingRuleInfo.CatalogPriceRuleRoles)
                {
                    catalogPriceRuleRole.CatalogPriceRuleID = catalogPriceRuleID;
                    catalogPriceRuleRoleID = priceRuleSqlProvider.CatalogPriceRuleRoleAdd(catalogPriceRuleRole,aspxCommonObj);
                }
            }
            return 1;
        }
 public int CatalogPriceRuleConditionAdd(CatalogPriceRuleCondition catalogPriceRuleCondition, Int32 storeID, Int32 portalID, string userName, string culture)
 {
     SqlCommand sqlCommand = new SqlCommand();
     sqlCommand.Parameters.Add(new SqlParameter("@CatalogPriceRuleID", catalogPriceRuleCondition.CatalogPriceRuleID));
     sqlCommand.Parameters.Add(new SqlParameter("@IsAll", catalogPriceRuleCondition.IsAll));
     sqlCommand.Parameters.Add(new SqlParameter("@IsTrue", catalogPriceRuleCondition.IsTrue));
     sqlCommand.Parameters.Add(new SqlParameter("@ParentID", catalogPriceRuleCondition.ParentID));
     sqlCommand.Parameters.Add(new SqlParameter("@IsActive", true));
     sqlCommand.Parameters.Add(new SqlParameter("@StoreID", storeID));
     sqlCommand.Parameters.Add(new SqlParameter("@PortalID", portalID));
     sqlCommand.Parameters.Add(new SqlParameter("@Username", userName));
     sqlCommand.Parameters.Add(new SqlParameter("@CultureName", culture));
     sqlCommand.CommandText = "usp_Aspx_CatalogPriceRuleConditionAdd";
     sqlCommand.CommandType = CommandType.StoredProcedure;
     SqlConnection sqlConnection = new SqlConnection(ConnectionString);
     try
     {
         sqlCommand.Connection = sqlConnection;
         sqlConnection.Open();
         object val = sqlCommand.ExecuteScalar();
         if (Convert.ToInt16(val) > 0)
         {
             int catalogConditionDetailID = -1;
             PriceRuleSqlProvider priceRuleSqlProvider = new PriceRuleSqlProvider();
             foreach (CatalogConditionDetail catalogConditionDetail in catalogPriceRuleCondition.CatalogConditionDetail)
             {
                 if (catalogConditionDetail != null)
                 {
                     catalogConditionDetail.CatalogPriceRuleConditionID = Convert.ToInt16(val);
                     catalogConditionDetail.CatalogPriceRuleID = catalogPriceRuleCondition.CatalogPriceRuleID;
                     catalogConditionDetailID =
                         priceRuleSqlProvider.CatalogConditionDetailAdd(catalogConditionDetail, storeID, portalID,
                                                                        userName, culture);
                     if (!(catalogConditionDetailID > 0))
                     {
                     }
                 }
             }
         }
         return Convert.ToInt16(val);
     }
     catch (Exception e)
     {
         throw e;
     }
     finally
     {
         sqlConnection.Close();
     }           
 }
        public int CartPriceMultipleRulesDelete(string cartRulesIds, int storeID, int portalID, string userName, string culture)
        {
            PriceRuleSqlProvider priceRuleSqlProvider = new PriceRuleSqlProvider();

            return(priceRuleSqlProvider.CartPriceRulesMultipleDelete(cartRulesIds, storeID, portalID, userName, culture));
        }
        public int CartPriceRuleDelete(int cartPriceRuleID, Int32 storeID, Int32 portalID, string userName, string culture)
        {
            PriceRuleSqlProvider priceRuleSqlProvider = new PriceRuleSqlProvider();

            return(priceRuleSqlProvider.CartPriceRuleDelete(cartPriceRuleID, portalID, storeID, userName, culture));
        }
Ejemplo n.º 16
0
        public int CartPriceMultipleRulesDelete(string cartRulesIds, AspxCommonInfo aspxCommonObj)
        {
            PriceRuleSqlProvider priceRuleSqlProvider = new PriceRuleSqlProvider();

            return(priceRuleSqlProvider.CartPriceRulesMultipleDelete(cartRulesIds, aspxCommonObj));
        }
Ejemplo n.º 17
0
        public int CartPriceRuleDelete(int cartPriceRuleID, AspxCommonInfo aspxCommonObj)
        {
            PriceRuleSqlProvider priceRuleSqlProvider = new PriceRuleSqlProvider();

            return(priceRuleSqlProvider.CartPriceRuleDelete(cartPriceRuleID, aspxCommonObj));
        }
 public int CartPriceMultipleRulesDelete(string cartRulesIds, AspxCommonInfo aspxCommonObj)
 {
     PriceRuleSqlProvider priceRuleSqlProvider = new PriceRuleSqlProvider();
     return priceRuleSqlProvider.CartPriceRulesMultipleDelete(cartRulesIds,aspxCommonObj);
 }
        public CartPricingRuleInfo GetCartPriceRules(Int32 cartPriceRuleID, AspxCommonInfo aspxCommonObj)
        {
            PriceRuleSqlProvider priceRuleSqlProvider = new PriceRuleSqlProvider();
            CartPricingRuleInfo cartPricingRuleInfo = new CartPricingRuleInfo();

            DataSet ds = new DataSet();
            ds = priceRuleSqlProvider.GetCartPriceRule(cartPriceRuleID,aspxCommonObj);
            DataTable dtCartPricingRule = ds.Tables[0];
            DataTable dtRuleConditions = ds.Tables[1];
            DataTable dtCartPriceRuleRoles = ds.Tables[2];
            DataTable dtCartPriceRuleStores = ds.Tables[3];

            List<CartPriceRule> lstCartPriceRule;
            lstCartPriceRule = DataSourceHelper.FillCollection<CartPriceRule>(dtCartPricingRule);
            List<RuleCondition> lstRuleConditions;
            lstRuleConditions = DataSourceHelper.FillCollection<RuleCondition>(dtRuleConditions);
            List<CartPriceRuleRole> lstCartPriceRuleRole;
            lstCartPriceRuleRole = DataSourceHelper.FillCollection<CartPriceRuleRole>(dtCartPriceRuleRoles);
            List<CartPriceRuleStore> lstCartPriceRuleStore;
            lstCartPriceRuleStore = DataSourceHelper.FillCollection<CartPriceRuleStore>(dtCartPriceRuleStores);

            cartPricingRuleInfo.CartPriceRule = lstCartPriceRule[0];
            List<RuleCondition> lstRC = new List<RuleCondition>();
            foreach (RuleCondition rc in lstRuleConditions)
            {
                RuleCondition objRC = new RuleCondition();
                objRC.ParentID = rc.ParentID;
                objRC.RuleConditionID = rc.RuleConditionID;
                objRC.RuleConditionType = rc.RuleConditionType;
                objRC.CartPriceRuleID = rc.CartPriceRuleID;

                if (rc.RuleConditionType.ToUpper().Trim() == "PAC".ToUpper().Trim())
                {
                    objRC.LstProductAttributeRuleConditions =
                        priceRuleSqlProvider.GetCartPriceProductAttributeConditions(rc.RuleConditionID, aspxCommonObj.PortalID);
                    objRC.LstProductAttributeRuleConditions[0].LstCartConditionDetails =
                        priceRuleSqlProvider.GetCartPriceRuleConditionDetails(rc.CartPriceRuleID,rc.RuleConditionID, aspxCommonObj.PortalID, aspxCommonObj.UserName);
                    lstRC.Add(objRC);
                }
                else if (rc.RuleConditionType.ToUpper().Trim() == "PS".ToUpper().Trim())
                {
                    objRC.LstProductSublectionRuleConditions =
                        priceRuleSqlProvider.GetCartPriceSubSelections(rc.RuleConditionID, aspxCommonObj.PortalID);
                    objRC.LstProductSublectionRuleConditions[0].LstCartConditionDetails =
                       priceRuleSqlProvider.GetCartPriceRuleConditionDetails(rc.CartPriceRuleID, rc.RuleConditionID, aspxCommonObj.PortalID, aspxCommonObj.UserName);
                    lstRC.Add(objRC);

                }
                else if (rc.RuleConditionType.ToUpper().Trim() == "CC".ToUpper().Trim())
                {
                    objRC.LstCartPriceRuleConditions =
                        priceRuleSqlProvider.GetCartPriceRuleConditions(rc.RuleConditionID, aspxCommonObj.PortalID);
                    objRC.LstCartPriceRuleConditions[0].LstCartConditionDetails =
                       priceRuleSqlProvider.GetCartPriceRuleConditionDetails(rc.CartPriceRuleID, rc.RuleConditionID, aspxCommonObj.PortalID, aspxCommonObj.UserName);
                    lstRC.Add(objRC);
                }
            }
            cartPricingRuleInfo.LstRuleCondition = lstRC;
            cartPricingRuleInfo.LstCartPriceRuleRoles = lstCartPriceRuleRole;
            cartPricingRuleInfo.LstCartPriceRuleStores = lstCartPriceRuleStore;

            return cartPricingRuleInfo;
        }
        public CartPricingRuleInfo GetCartPriceRules(Int32 cartPriceRuleID, Int32 storeID, Int32 portalID, string userName, string culture)
        {
            PriceRuleSqlProvider priceRuleSqlProvider = new PriceRuleSqlProvider();
            CartPricingRuleInfo  cartPricingRuleInfo  = new CartPricingRuleInfo();

            DataSet ds = new DataSet();

            ds = priceRuleSqlProvider.GetCartPriceRule(cartPriceRuleID, portalID, userName, culture);
            DataTable dtCartPricingRule     = ds.Tables[0];
            DataTable dtRuleConditions      = ds.Tables[1];
            DataTable dtCartPriceRuleRoles  = ds.Tables[2];
            DataTable dtCartPriceRuleStores = ds.Tables[3];

            List <CartPriceRule> lstCartPriceRule;

            lstCartPriceRule = DataSourceHelper.FillCollection <CartPriceRule>(dtCartPricingRule);
            List <RuleCondition> lstRuleConditions;

            lstRuleConditions = DataSourceHelper.FillCollection <RuleCondition>(dtRuleConditions);
            List <CartPriceRuleRole> lstCartPriceRuleRole;

            lstCartPriceRuleRole = DataSourceHelper.FillCollection <CartPriceRuleRole>(dtCartPriceRuleRoles);
            List <CartPriceRuleStore> lstCartPriceRuleStore;

            lstCartPriceRuleStore = DataSourceHelper.FillCollection <CartPriceRuleStore>(dtCartPriceRuleStores);

            cartPricingRuleInfo.CartPriceRule = lstCartPriceRule[0];
            List <RuleCondition> lstRC = new List <RuleCondition>();

            foreach (RuleCondition rc in lstRuleConditions)
            {
                RuleCondition objRC = new RuleCondition();
                objRC.ParentID          = rc.ParentID;
                objRC.RuleConditionID   = rc.RuleConditionID;
                objRC.RuleConditionType = rc.RuleConditionType;
                objRC.CartPriceRuleID   = rc.CartPriceRuleID;

                if (rc.RuleConditionType.ToUpper().Trim() == "PAC".ToUpper().Trim())
                {
                    objRC.LstProductAttributeRuleConditions =
                        priceRuleSqlProvider.GetCartPriceProductAttributeConditions(rc.RuleConditionID, portalID);
                    objRC.LstProductAttributeRuleConditions[0].LstCartConditionDetails =
                        priceRuleSqlProvider.GetCartPriceRuleConditionDetails(rc.CartPriceRuleID, rc.RuleConditionID, portalID, userName);
                    lstRC.Add(objRC);
                }
                else if (rc.RuleConditionType.ToUpper().Trim() == "PS".ToUpper().Trim())
                {
                    objRC.LstProductSublectionRuleConditions =
                        priceRuleSqlProvider.GetCartPriceSubSelections(rc.RuleConditionID, portalID);
                    objRC.LstProductSublectionRuleConditions[0].LstCartConditionDetails =
                        priceRuleSqlProvider.GetCartPriceRuleConditionDetails(rc.CartPriceRuleID, rc.RuleConditionID, portalID, userName);
                    lstRC.Add(objRC);
                }
                else if (rc.RuleConditionType.ToUpper().Trim() == "CC".ToUpper().Trim())
                {
                    objRC.LstCartPriceRuleConditions =
                        priceRuleSqlProvider.GetCartPriceRuleConditions(rc.RuleConditionID, portalID);
                    objRC.LstCartPriceRuleConditions[0].LstCartConditionDetails =
                        priceRuleSqlProvider.GetCartPriceRuleConditionDetails(rc.CartPriceRuleID, rc.RuleConditionID, portalID, userName);
                    lstRC.Add(objRC);
                }
            }
            cartPricingRuleInfo.LstRuleCondition       = lstRC;
            cartPricingRuleInfo.LstCartPriceRuleRoles  = lstCartPriceRuleRole;
            cartPricingRuleInfo.LstCartPriceRuleStores = lstCartPriceRuleStore;

            return(cartPricingRuleInfo);
        }
 public List<CatalogPriceRulePaging> GetCatalogPricingRules(string ruleName, System.Nullable<DateTime> startDate, System.Nullable<DateTime> endDate, System.Nullable<bool> isActive, AspxCommonInfo aspxCommonObj, int offset, int limit)
 {
     PriceRuleSqlProvider priceRuleSqlProvider = new PriceRuleSqlProvider();
     List<CatalogPriceRulePaging> lstCatalogPriceRule = priceRuleSqlProvider.GetCatalogPricingRules(ruleName, startDate, endDate,isActive,aspxCommonObj, offset, limit);
     return lstCatalogPriceRule;
 }
 public List<PricingRuleAttributeInfo> GetPricingRuleAttributes(int storeID, int portalID, string userName, string cultureName)
 {
     try
     {
         List<PricingRuleAttributeInfo> portalRoleCollection;
         PriceRuleSqlProvider priceRuleController = new PriceRuleSqlProvider();
         portalRoleCollection = priceRuleController.GetPricingRuleAttributes(portalID, storeID, userName, cultureName);
         return portalRoleCollection;
     }
     catch (Exception ex)
     {
         throw ex;
     }
 }
Ejemplo n.º 23
0
 public int CartPriceMultipleRulesDelete(string cartRulesIds, int storeID, int portalID, string userName, string culture)
 {
     PriceRuleSqlProvider priceRuleSqlProvider = new PriceRuleSqlProvider();
     return priceRuleSqlProvider.CartPriceRulesMultipleDelete(cartRulesIds, storeID, portalID, userName, culture);
 }
Ejemplo n.º 24
0
 public List<CatalogPriceRulePaging> GetCatalogPricingRules(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)
 {
     PriceRuleSqlProvider priceRuleSqlProvider = new PriceRuleSqlProvider();
     List<CatalogPriceRulePaging> lstCatalogPriceRule = priceRuleSqlProvider.GetCatalogPricingRules(ruleName, startDate, endDate,isActive, storeID, portalID, userName, culture, offset, limit);
     return lstCatalogPriceRule;
 }
 public List<CartPricingRuleAttributeInfo> GetCartPricingRuleAttributes(int storeID, int portalID, string userName, string cultureName)
 {
     try
     {
         List<CartPricingRuleAttributeInfo> lst;
         PriceRuleSqlProvider priceRuleProvider = new PriceRuleSqlProvider();
         lst = priceRuleProvider.GetCartPricingRuleAttributes(portalID, storeID, userName, cultureName);
         return lst;
     }
     catch (Exception ex)
     {
         throw ex;
     }
 }
Ejemplo n.º 26
0
 public int CartPriceRuleDelete(int cartPriceRuleID, Int32 storeID, Int32 portalID, string userName, string culture)
 {
     PriceRuleSqlProvider priceRuleSqlProvider = new PriceRuleSqlProvider();
     return priceRuleSqlProvider.CartPriceRuleDelete(cartPriceRuleID,  portalID,storeID, userName, culture);
 }