コード例 #1
0
        public int CatalogPriceRuleRoleAdd(CatalogPriceRuleRole catalogPriceRuleRole, Int32 storeID, Int32 portalID, string userName, string culture)
        {
            SqlCommand sqlCommand = new SqlCommand();

            sqlCommand.Parameters.Add(new SqlParameter("@CatalogPriceRuleID", catalogPriceRuleRole.CatalogPriceRuleID));
            sqlCommand.Parameters.Add(new SqlParameter("@RoleID", catalogPriceRuleRole.RoleID));
            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_CatalogPriceRuleRoleAdd";
            sqlCommand.CommandType = CommandType.StoredProcedure;
            SqlConnection sqlConnection = new SqlConnection(ConnectionString);

            try
            {
                sqlCommand.Connection = sqlConnection;
                sqlConnection.Open();
                object val = sqlCommand.ExecuteScalar();
                return(Convert.ToInt16(val));
            }
            catch (Exception e)
            {
                throw e;
            }
            finally
            {
                sqlConnection.Close();
            }
        }
コード例 #2
0
        public static int CatalogPriceRuleRoleAdd(CatalogPriceRuleRole catalogPriceRuleRole, AspxCommonInfo aspxCommonObj)
        {
            OracleCommand sqlCommand = new OracleCommand();

            sqlCommand.Parameters.Add(new OracleParameter("CatalogPriceRuleID", catalogPriceRuleRole.CatalogPriceRuleID));
            sqlCommand.Parameters.Add(new OracleParameter("RoleID", catalogPriceRuleRole.RoleID));
            sqlCommand.Parameters.Add(new OracleParameter("IsActive", true));
            sqlCommand.Parameters.Add(new OracleParameter("StoreID", aspxCommonObj.StoreID));
            sqlCommand.Parameters.Add(new OracleParameter("PortalID", aspxCommonObj.PortalID));
            sqlCommand.Parameters.Add(new OracleParameter("UserName", aspxCommonObj.UserName));
            sqlCommand.Parameters.Add(new OracleParameter("CultureName", aspxCommonObj.CultureName));
            sqlCommand.CommandText = "usp_Aspx_CatalogPriceRuleRoleAdd";
            sqlCommand.CommandType = CommandType.StoredProcedure;
            OracleConnection sqlConnection = new OracleConnection(ConnectionString);

            try
            {
                sqlCommand.Connection = sqlConnection;
                sqlConnection.Open();
                object val = sqlCommand.ExecuteScalar();
                return(Convert.ToInt16(val));
            }
            catch (Exception e)
            {
                throw e;
            }
            finally
            {
                sqlConnection.Close();
            }
        }
コード例 #3
0
 public static int CatalogPriceRuleRoleAdd(CatalogPriceRuleRole catalogPriceRuleRole, AspxCommonInfo aspxCommonObj)
 {
     SqlCommand sqlCommand = new SqlCommand();
     sqlCommand.Parameters.Add(new SqlParameter("@CatalogPriceRuleID", catalogPriceRuleRole.CatalogPriceRuleID));
     sqlCommand.Parameters.Add(new SqlParameter("@RoleID", catalogPriceRuleRole.RoleID));
     sqlCommand.Parameters.Add(new SqlParameter("@IsActive", true));
     sqlCommand.Parameters.Add(new SqlParameter("@StoreID", aspxCommonObj.StoreID));
     sqlCommand.Parameters.Add(new SqlParameter("@PortalID", aspxCommonObj.PortalID));
     sqlCommand.Parameters.Add(new SqlParameter("@UserName", aspxCommonObj.UserName));
     sqlCommand.Parameters.Add(new SqlParameter("@CultureName", aspxCommonObj.CultureName));
     sqlCommand.CommandText = "usp_Aspx_CatalogPriceRuleRoleAdd";
     sqlCommand.CommandType = CommandType.StoredProcedure;
     SqlConnection sqlConnection = new SqlConnection(ConnectionString);
     try
     {
         sqlCommand.Connection = sqlConnection;
         sqlConnection.Open();
         object val = sqlCommand.ExecuteScalar();
         return Convert.ToInt16(val);
     }
     catch (Exception e)
     {
         throw e;
     }
     finally
     {
         sqlConnection.Close();
     }
 }