DAL/Wx_ognService.cs

(开头部分) 8KB

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

using System;
using System.Data;
using System.Data.SqlClient;
using System.Text;
using DAL;
namespace DAL
{
    /// <summary>
    /// 数据访问类:Wx_OGN
    /// </summary>
    public partial class Wx_ognService
    {
        public Wx_ognService()
        { }
        #region  BasicMethod


        /// <summary>
        /// 增加一条数据
        /// </summary>
        public static int Add(Model.Wx_OGN model)
        {
            StringBuilder strSql = new StringBuilder();
            strSql.Append("insert into Wx_OGN(");
            strSql.Append("oid,goods,num)");
            strSql.Append(" values (");
            strSql.Append("@oid,@goods,@num)");
            strSql.Append(";select @@IDENTITY");
            SqlParameter[] parameters = {
					new SqlParameter("@oid", SqlDbType.Int,4),
					new SqlParameter("@goods", SqlDbType.Int,4),
					new SqlParameter("@num", SqlDbType.Int,4)};
            parameters[0].Value = model.oid;
            parameters[1].Value = model.goods;
            parameters[2].Value = model.num;

            object obj = DBHelperSQL.GetSingle(strSql.ToString(), parameters);
            if (obj == null)
            {
                return 0;
            }
            else
            {
                return Convert.ToInt32(obj);
            }
        }
        /// <summary>
        /// 更新一条数据
        /// </summary>
        public static bool Update(Model.Wx_OGN model)
        {
            StringBuilder strSql = new StringBuilder();
            strSql.Append("update Wx_OGN set ");
            strSql.Append("oid=@oid,");
            strSql.Append("goods=@goods,");
            strSql.Append("num=@num");
            strSql.Append(" where id=@id");
            SqlParameter[] parameters = {
					new SqlParameter("@oid", SqlDbType.Int,4),
					new SqlParameter("@goods", SqlDbType.Int,4),
后面还有 210 行代码,解锁后查看完整代码

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

AI 解读 AI

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

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