日期:2014-05-18 浏览次数:20598 次
namespace VCShop.Data
{
    using System;
    using System.Collections.Generic;
    using System.Data;
    using System.Runtime.InteropServices;
    using System.Web.UI.WebControls;
    using System.Xml;
    using VCShop.Entity;
    public interface IDataProvider
    {
        object AddCommendUserScore(string orderID, string username, string type, string content);
        int AddProductASk(ProductAsk ask);
        int AddProductReivewBadCount(string id);
        int AddProductReivewGoodCount(string id);
        int AddProductReview(ProductReview review);
        int AddProductShopCut(ProductShopCut scut);
        int AddUserScore(string username, string score, string type, string content);
        int BindCouponUser(string Number, string Username);
        int CalcelOrderByUser(string ordernum, string remark);
        int CancelGroupBuy(long id, string Username);
        int ChangeAdminPassword(string Uid, string Password);
        int ChangeOrderIDInsert(string orderid, string tablename);
        int ChangeOrderIDUpdate(string id, string orderid, string tablename);
        int ChangeOrderUsedScore(string OrderNumber, string UsedScore);
        int ChangeUserScore(string username, string score, string content);
        bool CheckFittingExits(string id, string guid, string prop, string fittingproductid);
        int CheckIdCombo(Page src);
        DataTable CheckIsBlackIP(string ip);
        string CheckIsLastClass(string categoryid);
        bool CheckNameExits(string tablename, string name, string value);
        string CheckOrderProductExist(string PropertysID, string IsChangeSale, string IsFitting, string ProductID, string IsScore, string OrderNumber);
        int CheckPriceCard(string ids);
…………
…………
…………
    }
}
namespace VCShop.Data.MsSql
{
    
    public class DataProvider : IDataProvider
    {
        private string strFilePath = "";
        private const string strRoot = "/BaseConfig/";
        public virtual object AddCommendUserScore(string orderID, string username, string type, string content)
        {
            return DbHelper.ExecuteNonQuery(string.Format("AddCommendUserScore N'{0}', N'{1}', N'{2}', N'{3}'", new object[] { orderID, username, type, content }));
        }
        public virtual int AddProductASk(ProductAsk ask)
        {
            StringBuilder builder = new StringBuilder();
            builder.Append(" INSERT INTO [Web_ProductAsk]").Append("([Type]").Append(",[ProductID]").Append(",[UserName]").Append(",[Content]").Append(",[Pleased]").Append(",[Displeased]").Append(")VALUES ").Append("(''").Append("," + ask.ProductID.ToString()).Append(",'" + ask.UserName + "'").Append(",'" + ask.Content + "'").Append(",0").Append(",0").Append(")");
            return DbHelper.ExecuteNonQuery(builder.ToString());
        }
…………
…………
    }
}