Пример #1
0
        public static CProduct fn商品新增(CMember member, CProduct product)
        {
            string sql = $"EXEC 商品新增 ";

            sql += $"@{CProductKey.fName},";
            sql += $"@{CProductKey.fDescription},";
            sql += $"@{CProductKey.fContent},";
            sql += $"@{CProductKey.fPrice},";
            sql += $"@{CProductKey.fLaunchDate},";
            sql += $"@{CProductKey.fTheRemovedDate},";
            sql += $"@{CProductKey.fDownloadTimes},";
            sql += $"@{CProductKey.fLikeCount},";
            sql += $"@{CProductKey.fMemberSellerId}";

            List <SqlParameter> paras = new List <SqlParameter>()
            {
                new SqlParameter(CProductKey.fName, product.fName),
                new SqlParameter(CProductKey.fDescription, product.fDescription),
                new SqlParameter(CProductKey.fContent, product.fContent),
                new SqlParameter(CProductKey.fPrice, product.fPrice),
                new SqlParameter(CProductKey.fLaunchDate, product.fLaunchDate),
                new SqlParameter(CProductKey.fTheRemovedDate, (object)product.fTheRemovedDate ?? DBNull.Value), //可NULL
                new SqlParameter(CProductKey.fDownloadTimes, product.fDownloadTimes),
                new SqlParameter(CProductKey.fLikeCount, product.fLikeCount),
                new SqlParameter(CProductKey.fMemberSellerId, member.fMemberId)
            };

            CDbManager.executeSql(sql, paras);
            CProduct NewProduct = fn商品查詢().LastOrDefault();

            return(NewProduct);
        }
Пример #2
0
        public static void fn商品更新(CProduct product)
        {
            string sql = $"EXEC 商品更新 ";

            sql += $"@{CProductKey.fProductId},";
            sql += $"@{CProductKey.fName},";
            sql += $"@{CProductKey.fDescription},";
            sql += $"@{CProductKey.fContent},";
            sql += $"@{CProductKey.fPrice},";
            sql += $"@{CProductKey.fLaunchDate},";
            sql += $"@{CProductKey.fTheRemovedDate},";
            sql += $"@{CProductKey.fDownloadTimes},";
            sql += $"@{CProductKey.fLikeCount},";
            sql += $"@{CProductKey.fMemberSellerId}";

            List <SqlParameter> paras = new List <SqlParameter>()
            {
                new SqlParameter(CProductKey.fProductId, product.fProductId),
                new SqlParameter(CProductKey.fName, product.fName),
                new SqlParameter(CProductKey.fDescription, product.fDescription),
                new SqlParameter(CProductKey.fContent, product.fContent),
                new SqlParameter(CProductKey.fPrice, product.fPrice),
                new SqlParameter(CProductKey.fLaunchDate, product.fLaunchDate),
                new SqlParameter(CProductKey.fTheRemovedDate, (object)product.fTheRemovedDate ?? DBNull.Value), //可NULL
                new SqlParameter(CProductKey.fDownloadTimes, product.fDownloadTimes),
                new SqlParameter(CProductKey.fLikeCount, product.fLikeCount),
                new SqlParameter(CProductKey.fMemberSellerId, product.fMemberSellerId)
            };

            CDbManager.executeSql(sql, paras);
        }
Пример #3
0
        //=========================== 商品瀏覽紀錄新增 =========================== //
        public static void fn商品瀏覽紀錄新增(CProduct product, CProductBrowse productBorwse)
        {
            string sql = $"EXEC 商品瀏覽紀錄新增 ";

            sql += $"@{CProductBrowseKey.fBrowseDataTime},";
            sql += $"@{CProductBrowseKey.fProductId}";

            List <SqlParameter> paras = new List <SqlParameter>()
            {
                new SqlParameter(CProductBrowseKey.fBrowseDataTime, productBorwse.fBrowseDataTime),
                new SqlParameter(CProductBrowseKey.fProductId, product.fProductId)
            };

            CDbManager.executeSql(sql, paras);
        }
        //=========================== 商品類別對照新增 =========================== //
        public static void fn商品類別對照新增(CProduct product, CProductCategory productCategory)
        {
            string sql = $"EXEC 商品類別對照新增 ";

            sql += $"@{CProductCompareKey.fProductId},";
            sql += $"@{CProductCompareKey.fCategoryId}";

            List <SqlParameter> paras = new List <SqlParameter>()
            {
                new SqlParameter(CProductCompareKey.fProductId, product.fProductId),
                new SqlParameter(CProductCompareKey.fCategoryId, productCategory.fCategoryId)
            };

            CDbManager.executeSql(sql, paras);
        }
Пример #5
0
        //=========================== 商品圖片新增 =========================== //
        public static void fn商品圖片新增(CProduct product, CProductPicture productPicture)
        {
            string sql = $"EXEC 商品圖片新增 ";

            sql += $"@{CProductPictureKey.fPicture},";
            sql += $"@{CProductPictureKey.fProductId}";

            List <SqlParameter> paras = new List <SqlParameter>()
            {
                new SqlParameter(CProductPictureKey.fPicture, productPicture.fPicture),
                new SqlParameter(CProductPictureKey.fProductId, product.fProductId)
            };

            CDbManager.executeSql(sql, paras);
        }
Пример #6
0
        //=========================== 購物車商品新增 =========================== //
        public static CCartProduct fn購物車商品新增(CProduct product, CCart cart)
        {
            string sql = $"EXEC 購物車商品新增 ";

            sql += $"@{CCartProductKey.fProductId},";
            sql += $"@{CCartProductKey.fCartId}";

            List <SqlParameter> paras = new List <SqlParameter>()
            {
                new SqlParameter(CCartProductKey.fProductId, product.fProductId),
                new SqlParameter(CCartProductKey.fCartId, cart.fCartId)
            };

            CDbManager.executeSql(sql, paras);
            CCartProduct NewCartProduct = fn購物車商品查詢().LastOrDefault();

            return(NewCartProduct);
        }