Exemple #1
0
        public static IDataReader GetForPageOfReference(Guid storeGuid, int pageNumber, int pageSize)
        {
            SqlParameterHelper sph = new SqlParameterHelper(WebStoreConnectionString.GetReadConnectionString(), "ws_Images_SelectByStore", 1);

            sph.DefineSqlParameter("@StoreGuid", SqlDbType.UniqueIdentifier, ParameterDirection.Input, storeGuid);
            return(sph.ExecuteReader());
        }
Exemple #2
0
        public static IDataReader Get(int moduleId)
        {
            SqlParameterHelper sph = new SqlParameterHelper(WebStoreConnectionString.GetReadConnectionString(), "ws_Store_SelectOneByModuleID", 1);

            sph.DefineSqlParameter("@ModuleID", SqlDbType.Int, ParameterDirection.Input, moduleId);
            return(sph.ExecuteReader());
        }
Exemple #3
0
        public static IDataReader GetByOrder(Guid orderGuid)
        {
            SqlParameterHelper sph = new SqlParameterHelper(WebStoreConnectionString.GetReadConnectionString(), "ws_OrderOffers_SelectByOrder", 1);

            sph.DefineSqlParameter("@OrderGuid", SqlDbType.UniqueIdentifier, ParameterDirection.Input, orderGuid);
            return(sph.ExecuteReader());
        }
        /// <summary>
        /// Gets a page of data from the ws_Offer table.
        /// </summary>
        /// <param name="pageNumber">The page number.</param>
        /// <param name="pageSize">Size of the page.</param>
        /// <param name="totalPages">total pages</param>
        public static IDataReader GetPage(
            Guid storeGuid,
            int pageNumber,
            int pageSize,
            out int totalPages)
        {
            totalPages = 1;
            int totalRows = GetCount(storeGuid);

            if (pageSize > 0)
            {
                totalPages = totalRows / pageSize;
            }

            if (totalRows <= pageSize)
            {
                totalPages = 1;
            }
            else
            {
                int remainder;
                Math.DivRem(totalRows, pageSize, out remainder);
                if (remainder > 0)
                {
                    totalPages += 1;
                }
            }

            SqlParameterHelper sph = new SqlParameterHelper(WebStoreConnectionString.GetReadConnectionString(), "ws_Offer_SelectPage", 3);

            sph.DefineSqlParameter("@StoreGuid", SqlDbType.UniqueIdentifier, ParameterDirection.Input, storeGuid);
            sph.DefineSqlParameter("@PageNumber", SqlDbType.Int, ParameterDirection.Input, pageNumber);
            sph.DefineSqlParameter("@PageSize", SqlDbType.Int, ParameterDirection.Input, pageSize);
            return(sph.ExecuteReader());
        }
        public static DataTable GetByProduct(Guid productGuid)
        {
            SqlParameterHelper sph = new SqlParameterHelper(WebStoreConnectionString.GetReadConnectionString(), "ws_Offer_GetByProduct", 1);

            sph.DefineSqlParameter("@ProductGuid", SqlDbType.UniqueIdentifier, ParameterDirection.Input, productGuid);

            DataTable dataTable = GetEmptyTable();

            using (IDataReader reader = sph.ExecuteReader())
            {
                while (reader.Read())
                {
                    DataRow row = dataTable.NewRow();
                    row["Guid"]            = new Guid(reader["Guid"].ToString());
                    row["ProductGuid"]     = new Guid(reader["ProductGuid"].ToString());
                    row["Price"]           = Convert.ToDecimal(reader["Price"]);
                    row["Url"]             = reader["Url"];
                    row["Name"]            = reader["Name"];
                    row["ProductListName"] = reader["ProductListName"];
                    row["Abstract"]        = reader["Abstract"];
                    row["Description"]     = reader["Description"];
                    row["ShowDetailLink"]  = Convert.ToBoolean(reader["ShowDetailLink"]);
                    row["MaxPerOrder"]     = reader["MaxPerOrder"];
                    dataTable.Rows.Add(row);
                }
            }


            return(dataTable);
        }
Exemple #6
0
        public static int Add(
            Guid itemGuid,
            Guid cartGuid,
            Guid offerGuid,
            Guid taxClassGuid,
            decimal offerPrice,
            DateTime addedToCart,
            int quantity,
            decimal tax,
            bool isDonation)
        {
            SqlParameterHelper sph = new SqlParameterHelper(WebStoreConnectionString.GetWriteConnectionString(), "ws_CartOffers_Insert", 9);

            sph.DefineSqlParameter("@ItemGuid", SqlDbType.UniqueIdentifier, ParameterDirection.Input, itemGuid);
            sph.DefineSqlParameter("@CartGuid", SqlDbType.UniqueIdentifier, ParameterDirection.Input, cartGuid);
            sph.DefineSqlParameter("@OfferGuid", SqlDbType.UniqueIdentifier, ParameterDirection.Input, offerGuid);
            sph.DefineSqlParameter("@OfferPrice", SqlDbType.Decimal, ParameterDirection.Input, offerPrice);
            sph.DefineSqlParameter("@AddedToCart", SqlDbType.DateTime, ParameterDirection.Input, addedToCart);
            sph.DefineSqlParameter("@Quantity", SqlDbType.Int, ParameterDirection.Input, quantity);
            sph.DefineSqlParameter("@TaxClassGuid", SqlDbType.UniqueIdentifier, ParameterDirection.Input, taxClassGuid);
            sph.DefineSqlParameter("@Tax", SqlDbType.Decimal, ParameterDirection.Input, tax);
            sph.DefineSqlParameter("@IsDonation", SqlDbType.Bit, ParameterDirection.Input, isDonation);
            int rowsAffected = sph.ExecuteNonQuery();

            return(rowsAffected);
        }
Exemple #7
0
        /// <summary>
        /// Gets a count of rows in the ws_Product table.
        /// </summary>
        public static int GetCountForAdminList(Guid storeGuid)
        {
            SqlParameterHelper sph = new SqlParameterHelper(WebStoreConnectionString.GetReadConnectionString(), "ws_Product_GetCountForAdminList", 1);

            sph.DefineSqlParameter("@StoreGuid", SqlDbType.UniqueIdentifier, ParameterDirection.Input, storeGuid);
            return(Convert.ToInt32(sph.ExecuteScalar()));
        }
        public static bool Update(
            Guid guid,
            Guid productGuid,
            Guid fullfillTermsGuid,
            int downloadsAllowed,
            int expireAfterDays,
            bool countAfterDownload,
            DateTime purchaseTime,
            int downloadedCount)
        {
            SqlParameterHelper sph = new SqlParameterHelper(WebStoreConnectionString.GetWriteConnectionString(), "ws_FullfillDownloadTicket_Update", 8);

            sph.DefineSqlParameter("@Guid", SqlDbType.UniqueIdentifier, ParameterDirection.Input, guid);
            sph.DefineSqlParameter("@ProductGuid", SqlDbType.UniqueIdentifier, ParameterDirection.Input, productGuid);
            sph.DefineSqlParameter("@FullfillTermsGuid", SqlDbType.UniqueIdentifier, ParameterDirection.Input, fullfillTermsGuid);
            sph.DefineSqlParameter("@DownloadsAllowed", SqlDbType.Int, ParameterDirection.Input, downloadsAllowed);
            sph.DefineSqlParameter("@ExpireAfterDays", SqlDbType.Int, ParameterDirection.Input, expireAfterDays);
            sph.DefineSqlParameter("@CountAfterDownload", SqlDbType.Bit, ParameterDirection.Input, countAfterDownload);
            sph.DefineSqlParameter("@PurchaseTime", SqlDbType.DateTime, ParameterDirection.Input, purchaseTime);
            sph.DefineSqlParameter("@DownloadedCount", SqlDbType.Int, ParameterDirection.Input, downloadedCount);

            int rowsAffected = sph.ExecuteNonQuery();

            return(rowsAffected > -1);
        }
Exemple #9
0
        public static IDataReader Get(Guid guid)
        {
            SqlParameterHelper sph = new SqlParameterHelper(WebStoreConnectionString.GetReadConnectionString(), "ws_OfferAvailability_SelectOne", 1);

            sph.DefineSqlParameter("@Guid", SqlDbType.UniqueIdentifier, ParameterDirection.Input, guid);
            return(sph.ExecuteReader());
        }
Exemple #10
0
        public static bool Update(
            Guid guid,
            DateTime beginUtc,
            DateTime endUtc,
            bool requiresOfferCode,
            string offerCode,
            int maxAllowedPerCustomer,
            DateTime lastModified,
            Guid lastModifedBy,
            string lastModifedFromIP)
        {
            SqlParameterHelper sph = new SqlParameterHelper(WebStoreConnectionString.GetWriteConnectionString(), "ws_OfferAvailability_Update", 9);

            sph.DefineSqlParameter("@Guid", SqlDbType.UniqueIdentifier, ParameterDirection.Input, guid);
            sph.DefineSqlParameter("@BeginUTC", SqlDbType.DateTime, ParameterDirection.Input, beginUtc);
            sph.DefineSqlParameter("@EndUTC", SqlDbType.DateTime, ParameterDirection.Input, endUtc);
            sph.DefineSqlParameter("@RequiresOfferCode", SqlDbType.Bit, ParameterDirection.Input, requiresOfferCode);
            sph.DefineSqlParameter("@OfferCode", SqlDbType.NVarChar, 50, ParameterDirection.Input, offerCode);
            sph.DefineSqlParameter("@MaxAllowedPerCustomer", SqlDbType.Int, ParameterDirection.Input, maxAllowedPerCustomer);
            sph.DefineSqlParameter("@LastModified", SqlDbType.DateTime, ParameterDirection.Input, lastModified);
            sph.DefineSqlParameter("@LastModifedBy", SqlDbType.UniqueIdentifier, ParameterDirection.Input, lastModifedBy);
            sph.DefineSqlParameter("@LastModifedFromIP", SqlDbType.NVarChar, 255, ParameterDirection.Input, lastModifedFromIP);
            int rowsAffected = sph.ExecuteNonQuery();

            return(rowsAffected > 0);
        }
        public static bool Update(
            Guid guid,
            int downloadsAllowed,
            int expireAfterDays,
            bool countAfterDownload,
            DateTime lastModified,
            Guid lastModifedBy,
            string lastModifedFromIPAddress,
            string name,
            string description)
        {
            SqlParameterHelper sph = new SqlParameterHelper(WebStoreConnectionString.GetWriteConnectionString(), "ws_FullfillDownloadTerms_Update", 9);

            sph.DefineSqlParameter("@Guid", SqlDbType.UniqueIdentifier, ParameterDirection.Input, guid);
            sph.DefineSqlParameter("@DownloadsAllowed", SqlDbType.Int, ParameterDirection.Input, downloadsAllowed);
            sph.DefineSqlParameter("@ExpireAfterDays", SqlDbType.Int, ParameterDirection.Input, expireAfterDays);
            sph.DefineSqlParameter("@CountAfterDownload", SqlDbType.Bit, ParameterDirection.Input, countAfterDownload);
            sph.DefineSqlParameter("@LastModified", SqlDbType.DateTime, ParameterDirection.Input, lastModified);
            sph.DefineSqlParameter("@LastModifedBy", SqlDbType.UniqueIdentifier, ParameterDirection.Input, lastModifedBy);
            sph.DefineSqlParameter("@LastModifedFromIPAddress", SqlDbType.NVarChar, 255, ParameterDirection.Input, lastModifedFromIPAddress);
            sph.DefineSqlParameter("@Name", SqlDbType.NVarChar, 255, ParameterDirection.Input, name);
            sph.DefineSqlParameter("@Description", SqlDbType.NVarChar, -1, ParameterDirection.Input, description);
            int rowsAffected = sph.ExecuteNonQuery();

            return(rowsAffected > 0);
        }
Exemple #12
0
        public static int Add(
            Guid guid,
            Guid offerGuid,
            Guid productGuid,
            byte fullfillType,
            Guid fullFillTermsGuid,
            int quantity,
            int sortOrder,
            DateTime created,
            Guid createdBy,
            string createdFromIP,
            DateTime lastModified,
            Guid lastModifiedBy,
            string lastModifiedFromIP)
        {
            SqlParameterHelper sph = new SqlParameterHelper(WebStoreConnectionString.GetWriteConnectionString(), "ws_OfferProduct_Insert", 13);

            sph.DefineSqlParameter("@Guid", SqlDbType.UniqueIdentifier, ParameterDirection.Input, guid);
            sph.DefineSqlParameter("@OfferGuid", SqlDbType.UniqueIdentifier, ParameterDirection.Input, offerGuid);
            sph.DefineSqlParameter("@ProductGuid", SqlDbType.UniqueIdentifier, ParameterDirection.Input, productGuid);
            sph.DefineSqlParameter("@FullfillType", SqlDbType.TinyInt, ParameterDirection.Input, fullfillType);
            sph.DefineSqlParameter("@FullFillTermsGuid", SqlDbType.UniqueIdentifier, ParameterDirection.Input, fullFillTermsGuid);
            sph.DefineSqlParameter("@Quantity", SqlDbType.Int, ParameterDirection.Input, quantity);
            sph.DefineSqlParameter("@SortOrder", SqlDbType.Int, ParameterDirection.Input, sortOrder);
            sph.DefineSqlParameter("@Created", SqlDbType.DateTime, ParameterDirection.Input, created);
            sph.DefineSqlParameter("@CreatedBy", SqlDbType.UniqueIdentifier, ParameterDirection.Input, createdBy);
            sph.DefineSqlParameter("@CreatedFromIP", SqlDbType.NVarChar, 255, ParameterDirection.Input, createdFromIP);
            sph.DefineSqlParameter("@LastModified", SqlDbType.DateTime, ParameterDirection.Input, lastModified);
            sph.DefineSqlParameter("@LastModifiedBy", SqlDbType.UniqueIdentifier, ParameterDirection.Input, lastModifiedBy);
            sph.DefineSqlParameter("@LastModifiedFromIP", SqlDbType.NVarChar, 255, ParameterDirection.Input, lastModifiedFromIP);
            int rowsAffected = sph.ExecuteNonQuery();

            return(rowsAffected);
        }
Exemple #13
0
        public static IDataReader GetAll(Guid storeGuid)
        {
            SqlParameterHelper sph = new SqlParameterHelper(WebStoreConnectionString.GetReadConnectionString(), "ws_Product_SelectAll", 1);

            sph.DefineSqlParameter("@StoreGuid", SqlDbType.UniqueIdentifier, ParameterDirection.Input, storeGuid);
            return(sph.ExecuteReader());
        }
Exemple #14
0
        public static IDataReader GetByReference(Guid referenceGuid)
        {
            SqlParameterHelper sph = new SqlParameterHelper(WebStoreConnectionString.GetReadConnectionString(), "ws_Images_SelectByReference", 1);

            sph.DefineSqlParameter("@ReferenceGuid", SqlDbType.UniqueIdentifier, ParameterDirection.Input, referenceGuid);
            return(sph.ExecuteReader());
        }
        public static IDataReader GetDownloadHistory(Guid ticketGuid)
        {
            SqlParameterHelper sph = new SqlParameterHelper(WebStoreConnectionString.GetReadConnectionString(), "ws_FullfillDownloadHistory_SelectByTicket", 1);

            sph.DefineSqlParameter("@TicketGuid", SqlDbType.UniqueIdentifier, ParameterDirection.Input, ticketGuid);
            return(sph.ExecuteReader());
        }
        public static IDataReader Get(Guid cartGuid)
        {
            SqlParameterHelper sph = new SqlParameterHelper(WebStoreConnectionString.GetReadConnectionString(), "ws_CartOrderInfo_SelectOne", 1);

            sph.DefineSqlParameter("@CartGuid", SqlDbType.UniqueIdentifier, ParameterDirection.Input, cartGuid);
            return(sph.ExecuteReader());
        }
Exemple #17
0
        public static bool UpdateCart(
            Guid cartGuid,
            Guid userGuid,
            decimal subTotal,
            decimal shippingTotal,
            decimal taxTotal,
            decimal orderTotal,
            DateTime lastModified,
            DateTime lastUserActivity,
            decimal discount,
            string discountCodesCsv,
            string customData,
            Guid clerkGuid)
        {
            SqlParameterHelper sph = new SqlParameterHelper(WebStoreConnectionString.GetWriteConnectionString(), "ws_Cart_Update", 12);

            sph.DefineSqlParameter("@CartGuid", SqlDbType.UniqueIdentifier, ParameterDirection.Input, cartGuid);
            sph.DefineSqlParameter("@UserGuid", SqlDbType.UniqueIdentifier, ParameterDirection.Input, userGuid);
            sph.DefineSqlParameter("@SubTotal", SqlDbType.Decimal, ParameterDirection.Input, subTotal);
            sph.DefineSqlParameter("@ShippingTotal", SqlDbType.Decimal, ParameterDirection.Input, shippingTotal);
            sph.DefineSqlParameter("@TaxTotal", SqlDbType.Decimal, ParameterDirection.Input, taxTotal);
            sph.DefineSqlParameter("@OrderTotal", SqlDbType.Decimal, ParameterDirection.Input, orderTotal);
            sph.DefineSqlParameter("@LastModified", SqlDbType.DateTime, ParameterDirection.Input, lastModified);
            sph.DefineSqlParameter("@LastUserActivity", SqlDbType.DateTime, ParameterDirection.Input, lastUserActivity);
            sph.DefineSqlParameter("@CustomData", SqlDbType.NVarChar, -1, ParameterDirection.Input, customData);
            sph.DefineSqlParameter("@DiscountCodesCsv", SqlDbType.NVarChar, -1, ParameterDirection.Input, discountCodesCsv);
            sph.DefineSqlParameter("@Discount", SqlDbType.Decimal, ParameterDirection.Input, discount);
            sph.DefineSqlParameter("@ClerkGuid", SqlDbType.UniqueIdentifier, ParameterDirection.Input, clerkGuid);
            int rowsAffected = sph.ExecuteNonQuery();

            return(rowsAffected > 0);
        }
Exemple #18
0
        /// <summary>
        /// Gets an IDataReader with one row from the ws_Discount table.
        /// </summary>
        /// <param name="discountCode"> discountCode </param>
        public static IDataReader Find(Guid moduleGuid, string descriptionOrCode)
        {
            SqlParameterHelper sph = new SqlParameterHelper(WebStoreConnectionString.GetReadConnectionString(), "ws_Discount_Find", 2);

            sph.DefineSqlParameter("@ModuleGuid", SqlDbType.UniqueIdentifier, ParameterDirection.Input, moduleGuid);
            sph.DefineSqlParameter("@Description", SqlDbType.NVarChar, 255, ParameterDirection.Input, descriptionOrCode);
            return(sph.ExecuteReader());
        }
Exemple #19
0
        /// <summary>
        /// Gets a count of rows in the ws_Offer table.
        /// </summary>
        public static int GetCountByOffer(Guid offerGuid)
        {
            SqlParameterHelper sph = new SqlParameterHelper(WebStoreConnectionString.GetReadConnectionString(), "ws_OfferProduct_CountByOffer", 1);

            sph.DefineSqlParameter("@OfferGuid", SqlDbType.UniqueIdentifier, ParameterDirection.Input, offerGuid);

            return(Convert.ToInt32(sph.ExecuteScalar()));
        }
Exemple #20
0
        /// <summary>
        /// Gets a count of rows in the ws_Discount table.
        /// </summary>
        public static int GetCountOfActiveDiscountCodes(Guid moduleGuid, DateTime activeForDate)
        {
            SqlParameterHelper sph = new SqlParameterHelper(WebStoreConnectionString.GetReadConnectionString(), "ws_Discount_GetCountOfActive", 2);

            sph.DefineSqlParameter("@ModuleGuid", SqlDbType.UniqueIdentifier, ParameterDirection.Input, moduleGuid);
            sph.DefineSqlParameter("@CurrentDate", SqlDbType.DateTime, ParameterDirection.Input, activeForDate);
            return(Convert.ToInt32(sph.ExecuteScalar()));
        }
Exemple #21
0
        public static int GetItemCountByFulfillmentType(Guid cartGuid, byte fulFillmentType)
        {
            SqlParameterHelper sph = new SqlParameterHelper(WebStoreConnectionString.GetReadConnectionString(), "ws_Cart_GetItemCountByFulfillmentType", 2);

            sph.DefineSqlParameter("@CartGuid", SqlDbType.UniqueIdentifier, ParameterDirection.Input, cartGuid);
            sph.DefineSqlParameter("@FulFillmentType", SqlDbType.TinyInt, ParameterDirection.Input, fulFillmentType);
            return(Convert.ToInt32(sph.ExecuteScalar()));
        }
Exemple #22
0
        public static IDataReader GetByUser(Guid userGuid, Guid storeGuid)
        {
            SqlParameterHelper sph = new SqlParameterHelper(WebStoreConnectionString.GetReadConnectionString(), "ws_Cart_SelectOneByUser", 2);

            sph.DefineSqlParameter("@UserGuid", SqlDbType.UniqueIdentifier, ParameterDirection.Input, userGuid);
            sph.DefineSqlParameter("@StoreGuid", SqlDbType.UniqueIdentifier, ParameterDirection.Input, storeGuid);
            return(sph.ExecuteReader());
        }
Exemple #23
0
        public static IDataReader GetSalesByYearMonth(Guid storeGuid)
        {
            SqlParameterHelper sph = new SqlParameterHelper(WebStoreConnectionString.GetReadConnectionString(), "ws_Order_GetSalesByYearMonth", 1);

            sph.DefineSqlParameter("@StoreGuid", SqlDbType.UniqueIdentifier, ParameterDirection.Input, storeGuid);

            return(sph.ExecuteReader());
        }
Exemple #24
0
        public static IDataReader GetProductByPage(int siteId, int pageId)
        {
            SqlParameterHelper sph = new SqlParameterHelper(WebStoreConnectionString.GetReadConnectionString(), "ws_Product_SelectByPage", 2);

            sph.DefineSqlParameter("@SiteID", SqlDbType.Int, ParameterDirection.Input, siteId);
            sph.DefineSqlParameter("@PageID", SqlDbType.Int, ParameterDirection.Input, pageId);
            return(sph.ExecuteReader());
        }
Exemple #25
0
        public static bool Update(
            Guid guid,
            Guid taxClassGuid,
            string modelNumber,
            byte status,
            byte fullfillmentType,
            decimal weight,
            int quantityOnHand,
            string imageFileName,
            byte[] imageFileBytes,
            DateTime lastModified,
            Guid lastModifedBy,
            string url,
            string name,
            string description,
            string teaser,
            bool showInProductList,
            bool enableRating,
            string metaDescription,
            string metaKeywords,
            int sortRank1,
            int sortRank2,
            string teaserFile,
            string teaserFileLink,
            string compiledMeta,
            decimal shippingAmount)
        {
            SqlParameterHelper sph = new SqlParameterHelper(WebStoreConnectionString.GetWriteConnectionString(), "ws_Product_Update", 25);

            sph.DefineSqlParameter("@Guid", SqlDbType.UniqueIdentifier, ParameterDirection.Input, guid);
            sph.DefineSqlParameter("@TaxClassGuid", SqlDbType.UniqueIdentifier, ParameterDirection.Input, taxClassGuid);
            sph.DefineSqlParameter("@ModelNumber", SqlDbType.NVarChar, 255, ParameterDirection.Input, modelNumber);
            sph.DefineSqlParameter("@Status", SqlDbType.TinyInt, ParameterDirection.Input, status);
            sph.DefineSqlParameter("@FullfillmentType", SqlDbType.TinyInt, ParameterDirection.Input, fullfillmentType);
            sph.DefineSqlParameter("@Weight", SqlDbType.Decimal, ParameterDirection.Input, weight);
            sph.DefineSqlParameter("@QuantityOnHand", SqlDbType.Int, ParameterDirection.Input, quantityOnHand);
            sph.DefineSqlParameter("@ImageFileName", SqlDbType.NVarChar, 255, ParameterDirection.Input, imageFileName);
            sph.DefineSqlParameter("@ImageFileBytes", SqlDbType.Image, ParameterDirection.Input, imageFileBytes);
            sph.DefineSqlParameter("@LastModified", SqlDbType.DateTime, ParameterDirection.Input, lastModified);
            sph.DefineSqlParameter("@LastModifedBy", SqlDbType.UniqueIdentifier, ParameterDirection.Input, lastModifedBy);
            sph.DefineSqlParameter("@Url", SqlDbType.NVarChar, 255, ParameterDirection.Input, url);
            sph.DefineSqlParameter("@Name", SqlDbType.NVarChar, 255, ParameterDirection.Input, name);
            sph.DefineSqlParameter("@Description", SqlDbType.NVarChar, -1, ParameterDirection.Input, description);
            sph.DefineSqlParameter("@Abstract", SqlDbType.NVarChar, -1, ParameterDirection.Input, teaser);
            sph.DefineSqlParameter("@ShowInProductList", SqlDbType.Bit, ParameterDirection.Input, showInProductList);
            sph.DefineSqlParameter("@EnableRating", SqlDbType.Bit, ParameterDirection.Input, enableRating);
            sph.DefineSqlParameter("@MetaDescription", SqlDbType.NVarChar, 255, ParameterDirection.Input, metaDescription);
            sph.DefineSqlParameter("@MetaKeywords", SqlDbType.NVarChar, 255, ParameterDirection.Input, metaKeywords);
            sph.DefineSqlParameter("@SortRank1", SqlDbType.Int, ParameterDirection.Input, sortRank1);
            sph.DefineSqlParameter("@SortRank2", SqlDbType.Int, ParameterDirection.Input, sortRank2);
            sph.DefineSqlParameter("@TeaserFile", SqlDbType.NVarChar, 255, ParameterDirection.Input, teaserFile);
            sph.DefineSqlParameter("@TeaserFileLink", SqlDbType.NVarChar, 255, ParameterDirection.Input, teaserFileLink);
            sph.DefineSqlParameter("@CompiledMeta", SqlDbType.NVarChar, -1, ParameterDirection.Input, compiledMeta);
            sph.DefineSqlParameter("@ShippingAmount", SqlDbType.Decimal, ParameterDirection.Input, shippingAmount);
            int rowsAffected = sph.ExecuteNonQuery();

            return(rowsAffected > 0);
        }
Exemple #26
0
        /// <summary>
        /// Deletes a row from the ws_OrderOffers table. Returns true if row deleted.
        /// </summary>
        /// <param name="itemGuid"> itemGuid </param>
        /// <returns>bool</returns>
        public static bool DeleteByOrder(Guid orderGuid)
        {
            SqlParameterHelper sph = new SqlParameterHelper(WebStoreConnectionString.GetReadConnectionString(), "ws_OrderOffers_DeleteByOrder", 1);

            sph.DefineSqlParameter("@OrderGuid", SqlDbType.UniqueIdentifier, ParameterDirection.Input, orderGuid);
            int rowsAffected = sph.ExecuteNonQuery();

            return(rowsAffected > 0);
        }
Exemple #27
0
        public static bool DeleteByReference(Guid referenceGuid)
        {
            SqlParameterHelper sph = new SqlParameterHelper(WebStoreConnectionString.GetWriteConnectionString(), "ws_Images_DeleteByReference", 1);

            sph.DefineSqlParameter("@ReferenceGuid", SqlDbType.UniqueIdentifier, ParameterDirection.Input, referenceGuid);
            int rowsAffected = sph.ExecuteNonQuery();

            return(rowsAffected > 0);
        }
        public static bool Delete(Guid guid)
        {
            SqlParameterHelper sph = new SqlParameterHelper(WebStoreConnectionString.GetWriteConnectionString(), "ws_FullfillDownloadTicket_Delete", 1);

            sph.DefineSqlParameter("@Guid", SqlDbType.UniqueIdentifier, ParameterDirection.Input, guid);
            int rowsAffected = sph.ExecuteNonQuery();

            return(rowsAffected > -1);
        }
        public static bool Delete(Guid productGuid)
        {
            SqlParameterHelper sph = new SqlParameterHelper(WebStoreConnectionString.GetWriteConnectionString(), "ws_ProductFile_Delete", 1);

            sph.DefineSqlParameter("@ProductGuid", SqlDbType.UniqueIdentifier, ParameterDirection.Input, productGuid);
            int rowsAffected = sph.ExecuteNonQuery();

            return(rowsAffected > 0);
        }
        public static DataTable GetPublicPage(
            Guid storeGuid,
            int pageNumber,
            int pageSize,
            out int totalPages)
        {
            totalPages = 1;
            int totalRows = GetCountForProductList(storeGuid);

            if (pageSize > 0)
            {
                totalPages = totalRows / pageSize;
            }

            if (totalRows <= pageSize)
            {
                totalPages = 1;
            }
            else
            {
                int remainder;
                Math.DivRem(totalRows, pageSize, out remainder);
                if (remainder > 0)
                {
                    totalPages += 1;
                }
            }

            SqlParameterHelper sph = new SqlParameterHelper(WebStoreConnectionString.GetReadConnectionString(), "ws_Offer_SelectPublicPage", 3);

            sph.DefineSqlParameter("@StoreGuid", SqlDbType.UniqueIdentifier, ParameterDirection.Input, storeGuid);
            sph.DefineSqlParameter("@PageNumber", SqlDbType.Int, ParameterDirection.Input, pageNumber);
            sph.DefineSqlParameter("@PageSize", SqlDbType.Int, ParameterDirection.Input, pageSize);

            DataTable dataTable = GetOfferEmptyTable();

            using (IDataReader reader = sph.ExecuteReader())
            {
                while (reader.Read())
                {
                    DataRow row = dataTable.NewRow();

                    row["Guid"]            = new Guid(reader["Guid"].ToString());
                    row["Url"]             = reader["Url"];
                    row["Name"]            = reader["Name"];
                    row["ProductListName"] = reader["ProductListName"];
                    row["Abstract"]        = reader["Abstract"];
                    row["Description"]     = reader["Description"];
                    row["Price"]           = reader["Price"];

                    dataTable.Rows.Add(row);
                }
            }

            return(dataTable);
        }