SQLServerDAL/ShopFoodPicture.cs

(开头部分) 8KB

这里只显示每个文件的开头 60 行。登录后可以解锁完整代码。

using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Data;
using System.Data.SqlClient;

using WMPT.Model;
using WMPT.DBUtility;
namespace WMPT.SQLServerDAL
{
    /// <summary>
    ///商家标签库管理
    /// </summary>
    public class ShopFoodPicture
    {
        /// <summary>
        /// 增加一条数据
        /// </summary>
        public int Add(WMPT.Model.ShopFoodPictureInfo model)
        {
            StringBuilder strSql = new StringBuilder();
            strSql.Append("insert into ShopFoodPicture(");
            strSql.Append("ShopId,Url,Picture,Title,Inve1,Inve2,cityid)");
            strSql.Append(" values (");
            strSql.Append("@ShopId,@Url,@Picture,@Title,@Inve1,@Inve2,@cityid)");
            strSql.Append(";select @@IDENTITY");
            SqlParameter[] parameters = 
            {
				new SqlParameter("@ShopId", SqlDbType.Int,4),
				new SqlParameter("@Url", SqlDbType.VarChar,256),
				new SqlParameter("@Picture", SqlDbType.VarChar,256),
				new SqlParameter("@Title", SqlDbType.VarChar,256),
				new SqlParameter("@Inve1", SqlDbType.Int,4),
				new SqlParameter("@Inve2", SqlDbType.VarChar,256),
				new SqlParameter("@cityid", SqlDbType.Int,4)
            };
            parameters[0].Value = model.ShopId;
            parameters[1].Value = model.Url;
            parameters[2].Value = model.Picture;
            parameters[3].Value = model.Title;
            parameters[4].Value = model.Inve1;
            parameters[5].Value = model.Inve2;
            parameters[6].Value = model.cityid;

            return SQLHelper.ExecuteNonQuery(CommandType.Text, strSql.ToString(), parameters);
        }
        /// <summary>
        /// 更新一条数据
        /// </summary>
        public int Update(WMPT.Model.ShopFoodPictureInfo model)
        {
            StringBuilder strSql = new StringBuilder();
            strSql.Append("update ShopFoodPicture set ");
            strSql.Append("ShopId=@ShopId,");
            strSql.Append("Url=@Url,");
            strSql.Append("Picture=@Picture,");
            strSql.Append("Title=@Title,");
            strSql.Append("Inve1=@Inve1,");
            strSql.Append("Inve2=@Inve2,");
后面还有 150 行代码,购买后查看完整代码

24 小时内免费解锁 3 个项目,之后 1 算力/个。 规则说明

AI 解读 AI

登录后可用,每次 10 算力,解读结果公开显示在下面。

还没有人解读过这个文件。