예제 #1
0
        /// <summary>
        /// 增加一条数据
        /// </summary>
        public int Add(Mxm.Model.download model)
        {
            StringBuilder strSql = new StringBuilder();
            strSql.Append("insert into download(");
            strSql.Append("name,remark,picture,path,sort,create_time)");
            strSql.Append(" values (");
            strSql.Append("@name,@remark,@picture,@path,@sort,@create_time)");
            strSql.Append(";select @@IDENTITY");
            SqlParameter[] parameters = {
                    new SqlParameter("@name", SqlDbType.NVarChar,100),
                    new SqlParameter("@remark", SqlDbType.NVarChar,500),
                    new SqlParameter("@picture", SqlDbType.NVarChar,250),
                    new SqlParameter("@path", SqlDbType.NVarChar,250),
                    new SqlParameter("@sort", SqlDbType.Int,4),
                    new SqlParameter("@create_time", SqlDbType.DateTime)};
            parameters[0].Value = model.name;
            parameters[1].Value = model.remark;
            parameters[2].Value = model.picture;
            parameters[3].Value = model.path;
            parameters[4].Value = model.sort;
            parameters[5].Value = model.create_time;

            object obj = DbHelperSQL.GetSingle(strSql.ToString(), parameters);
            if (obj == null)
            {
                return -1;
            }
            else
            {
                return Convert.ToInt32(obj);
            }
        }
예제 #2
0
        /// <summary>
        /// ����һ������
        /// </summary>
        public int Add(Mxm.Model.production model)
        {
            StringBuilder strSql = new StringBuilder();
            strSql.Append("insert into production(");
            strSql.Append("product_name,product_desc,create_time,update_time,picture,status,product_type,balance,product_synopsis,market_price,buy_price,sort,vidio,picture_small,model)");

            strSql.Append(" values (");
            strSql.Append("@product_name,@product_desc,@create_time,@update_time,@picture,@status,@product_type,@balance,@product_synopsis,@market_price,@buy_price,@sort,@vidio,@picture_small,@model)");
            strSql.Append(";select @@IDENTITY");
            Database db = DatabaseFactory.CreateDatabase();
            DbCommand dbCommand = db.GetSqlStringCommand(strSql.ToString());
            db.AddInParameter(dbCommand, "product_name", DbType.String, model.product_name);
            db.AddInParameter(dbCommand, "product_desc", DbType.String, model.product_desc);
            db.AddInParameter(dbCommand, "create_time", DbType.DateTime, model.create_time);
            db.AddInParameter(dbCommand, "update_time", DbType.DateTime, model.update_time);
            db.AddInParameter(dbCommand, "picture", DbType.String, model.picture);
            db.AddInParameter(dbCommand, "status", DbType.Decimal, model.status);
            db.AddInParameter(dbCommand, "product_type", DbType.Int32, model.product_type);
            db.AddInParameter(dbCommand, "balance", DbType.Int32, model.balance);
            db.AddInParameter(dbCommand, "product_synopsis", DbType.String, model.product_synopsis);
            db.AddInParameter(dbCommand, "market_price", DbType.Decimal, model.market_price);
            db.AddInParameter(dbCommand, "buy_price", DbType.Decimal, model.buy_price);
            db.AddInParameter(dbCommand, "sort", DbType.Int32, model.sort);
            db.AddInParameter(dbCommand, "vidio", DbType.String, model.vidio);
            db.AddInParameter(dbCommand, "picture_small", DbType.String, model.picture_small);
            db.AddInParameter(dbCommand, "model", DbType.String, model.model);
            int result;
            object obj = db.ExecuteScalar(dbCommand);
            if (!int.TryParse(obj.ToString(), out result))
            {
                return 0;
            }
            return result;
        }
예제 #3
0
        /// <summary>
        /// ����һ������
        /// </summary>
        public int Add(Mxm.Model.attachment model)
        {
            StringBuilder strSql=new StringBuilder();
            strSql.Append("insert into attachment(");
            strSql.Append("path,depositor_id,depositor_type,create_time,file_type)");
            strSql.Append(" values (");
            strSql.Append("@path,@depositor_id,@depositor_type,@create_time,@file_type)");
            strSql.Append(";select @@IDENTITY");
            SqlParameter[] parameters = {
                    new SqlParameter("@path", SqlDbType.NVarChar,500),
                    new SqlParameter("@depositor_id", SqlDbType.Int,4),
                    new SqlParameter("@depositor_type", SqlDbType.Int,4),
                    new SqlParameter("@create_time", SqlDbType.DateTime),
                    new SqlParameter("@file_type", SqlDbType.Int,4)};
            parameters[0].Value = model.path;
            parameters[1].Value = model.depositor_id;
            parameters[2].Value = model.depositor_type;
            parameters[3].Value = model.create_time;
            parameters[4].Value = model.file_type;

            object obj = DbHelperSQL.GetSingle(strSql.ToString(),parameters);
            if (obj == null)
            {
                return -1;
            }
            else
            {
                return Convert.ToInt32(obj);
            }
        }
예제 #4
0
        /// <summary>
        /// ����һ������
        /// </summary>
        public int Add(Mxm.Model.message model)
        {
            StringBuilder strSql=new StringBuilder();
            strSql.Append("insert into message(");
            strSql.Append("title,content,parent_id,create_time,type_id)");
            strSql.Append(" values (");
            strSql.Append("@title,@content,@parent_id,@create_time,@type_id)");
            strSql.Append(";select @@IDENTITY");
            SqlParameter[] parameters = {
                    new SqlParameter("@title", SqlDbType.NVarChar,500),
                    new SqlParameter("@content", SqlDbType.NVarChar,0),
                    new SqlParameter("@parent_id", SqlDbType.Int,4),
                    new SqlParameter("@create_time", SqlDbType.DateTime),
                    new SqlParameter("@type_id", SqlDbType.Int,4)};
            parameters[0].Value = model.title;
            parameters[1].Value = model.content;
            parameters[2].Value = model.parent_id;
            parameters[3].Value = model.create_time;
            parameters[4].Value = model.type_id;

            object obj = DbHelperSQL.GetSingle(strSql.ToString(),parameters);
            if (obj == null)
            {
                return -1;
            }
            else
            {
                return Convert.ToInt32(obj);
            }
        }
예제 #5
0
        /// <summary>
        /// ����һ������
        /// </summary>
        public int Add(Mxm.Model.article model)
        {
            StringBuilder strSql=new StringBuilder();
            strSql.Append("insert into article(");
            strSql.Append("title,content,create_time,update_time,author,sub_title,editor,status,type_id,picture_small,sumary)");
            strSql.Append(" values (");
            strSql.Append("@title,@content,@create_time,@update_time,@author,@sub_title,@editor,@status,@type_id,@picture_small,@sumary)");
            strSql.Append(";select @@IDENTITY");
            SqlParameter[] parameters = {
                    new SqlParameter("@title", SqlDbType.NVarChar,500),
                    new SqlParameter("@content", SqlDbType.NVarChar,0),
                    new SqlParameter("@create_time", SqlDbType.DateTime),
                    new SqlParameter("@update_time", SqlDbType.DateTime),
                    new SqlParameter("@author", SqlDbType.NVarChar,50),
                    new SqlParameter("@sub_title", SqlDbType.NVarChar,500),
                    new SqlParameter("@editor", SqlDbType.NVarChar,50),
                    new SqlParameter("@status", SqlDbType.Int,4),
                    new SqlParameter("@type_id", SqlDbType.Int,4),
                    new SqlParameter("@picture_small", SqlDbType.NVarChar,400),
                    new SqlParameter("@sumary", SqlDbType.NVarChar,1000)
                };
            parameters[0].Value = model.title;
            parameters[1].Value = model.content;
            parameters[2].Value = model.create_time;
            parameters[3].Value = model.update_time;
            parameters[4].Value = model.author;
            parameters[5].Value = model.Sub_title;
            parameters[6].Value = model.Editor;
            parameters[7].Value = model.Status;
            parameters[8].Value = model.Type_id;
            parameters[9].Value = model.Picture_small;
            parameters[10].Value = model.Sumary;

            object obj = DbHelperSQL.GetSingle(strSql.ToString(),parameters);
            if (obj == null)
            {
                return -1;
            }
            else
            {
                return Convert.ToInt32(obj);
            }
        }
예제 #6
0
        /// <summary>
        /// 增加一条数据
        /// </summary>
        public int Add(Mxm.Model.message_type model)
        {
            StringBuilder strSql = new StringBuilder();
            strSql.Append("insert into message_type(");
            strSql.Append("type_name)");

            strSql.Append(" values (");
            strSql.Append("@type_name)");
            strSql.Append(";select @@IDENTITY");
            Database db = DatabaseFactory.CreateDatabase();
            DbCommand dbCommand = db.GetSqlStringCommand(strSql.ToString());
            db.AddInParameter(dbCommand, "type_name", DbType.String, model.type_name);
            int result;
            object obj = db.ExecuteScalar(dbCommand);
            if (!int.TryParse(obj.ToString(), out result))
            {
                return 0;
            }
            return result;
        }
예제 #7
0
        /// <summary>
        /// ����һ������
        /// </summary>
        public int Add(Mxm.Model.recommend_group model)
        {
            StringBuilder strSql=new StringBuilder();
            strSql.Append("insert into recommend_group(");
            strSql.Append("group_name,remark)");

            strSql.Append(" values (");
            strSql.Append("@group_name,@remark)");
            strSql.Append(";select @@IDENTITY");
            Database db = DatabaseFactory.CreateDatabase();
            DbCommand dbCommand = db.GetSqlStringCommand(strSql.ToString());
            db.AddInParameter(dbCommand, "group_name", DbType.String, model.group_name);
            db.AddInParameter(dbCommand, "remark", DbType.String, model.remark);
            int result;
            object obj = db.ExecuteScalar(dbCommand);
            if(!int.TryParse(obj.ToString(),out result))
            {
                return 0;
            }
            return result;
        }
예제 #8
0
        /// <summary>
        /// 增加一条数据
        /// </summary>
        public int Add(Mxm.Model.users model)
        {
            StringBuilder strSql = new StringBuilder();
            strSql.Append("insert into users(");
            strSql.Append("username,password,sex,email,mobile,tel,reg_time,qq,msn,status)");
            strSql.Append(" values (");
            strSql.Append("@username,@password,@sex,@email,@mobile,@tel,@reg_time,@qq,@msn,@status)");
            strSql.Append(";select @@IDENTITY");
            SqlParameter[] parameters = {
                    new SqlParameter("@username", SqlDbType.NVarChar,50),
                    new SqlParameter("@password", SqlDbType.NVarChar,50),
                    new SqlParameter("@sex", SqlDbType.Bit,1),
                    new SqlParameter("@email", SqlDbType.NVarChar,500),
                    new SqlParameter("@mobile", SqlDbType.NVarChar,50),
                    new SqlParameter("@tel", SqlDbType.NVarChar,100),
                    new SqlParameter("@reg_time", SqlDbType.DateTime),
                    new SqlParameter("@qq", SqlDbType.NVarChar,50),
                    new SqlParameter("@msn", SqlDbType.NVarChar,200),
                    new SqlParameter("@status", SqlDbType.Int,4)};
            parameters[0].Value = model.username;
            parameters[1].Value = model.password;
            parameters[2].Value = model.sex;
            parameters[3].Value = model.email;
            parameters[4].Value = model.mobile;
            parameters[5].Value = model.tel;
            parameters[6].Value = model.reg_time;
            parameters[7].Value = model.qq;
            parameters[8].Value = model.msn;
            parameters[9].Value = model.status;

            object obj = DbHelperSQL.GetSingle(strSql.ToString(), parameters);
            if (obj == null)
            {
                return -1;
            }
            else
            {
                return Convert.ToInt32(obj);
            }
        }
예제 #9
0
        /// <summary>
        /// 增加一条数据
        /// </summary>
        public void Add(Mxm.Model.feed_back model)
        {
            StringBuilder strSql = new StringBuilder();
            strSql.Append("insert into feed_back(");
            strSql.Append("title,linkman,corperation,link_address,postcode,link_tel,fax,mobile,email,msg_content)");

            strSql.Append(" values (");
            strSql.Append("@title,@linkman,@corperation,@link_address,@postcode,@link_tel,@fax,@mobile,@email,@msg_content)");
            Database db = DatabaseFactory.CreateDatabase();
            DbCommand dbCommand = db.GetSqlStringCommand(strSql.ToString());
            db.AddInParameter(dbCommand, "title", DbType.String, model.title);
            db.AddInParameter(dbCommand, "linkman", DbType.String, model.linkman);
            db.AddInParameter(dbCommand, "corperation", DbType.String, model.corperation);
            db.AddInParameter(dbCommand, "link_address", DbType.String, model.link_address);
            db.AddInParameter(dbCommand, "postcode", DbType.Decimal, model.postcode);
            db.AddInParameter(dbCommand, "link_tel", DbType.String, model.link_tel);
            db.AddInParameter(dbCommand, "fax", DbType.String, model.fax);
            db.AddInParameter(dbCommand, "mobile", DbType.Decimal, model.mobile);
            db.AddInParameter(dbCommand, "email", DbType.String, model.email);
            db.AddInParameter(dbCommand, "msg_content", DbType.String, model.msg_content);
            db.ExecuteNonQuery(dbCommand);
        }
예제 #10
0
        /// <summary>
        /// ����һ������
        /// </summary>
        public int Add(Mxm.Model.product_type model)
        {
            StringBuilder strSql = new StringBuilder();
            strSql.Append("insert into product_type(");
            strSql.Append("type_name,parent_id,banner,remark)");

            strSql.Append(" values (");
            strSql.Append("@type_name,@parent_id,@banner,@remark)");
            strSql.Append(";select @@IDENTITY");
            Database db = DatabaseFactory.CreateDatabase();
            DbCommand dbCommand = db.GetSqlStringCommand(strSql.ToString());
            db.AddInParameter(dbCommand, "type_name", DbType.String, model.type_name);
            db.AddInParameter(dbCommand, "parent_id", DbType.Int32, model.parent_id);
            db.AddInParameter(dbCommand, "banner", DbType.String, model.banner);
            db.AddInParameter(dbCommand, "remark", DbType.String, model.remark);
            int result;
            object obj = db.ExecuteScalar(dbCommand);
            if (!int.TryParse(obj.ToString(), out result))
            {
                return 0;
            }
            return result;
        }
예제 #11
0
        /// <summary>
        /// ����һ������
        /// </summary>
        public int Add(Mxm.Model.recommend_content model)
        {
            StringBuilder strSql=new StringBuilder();
            strSql.Append("insert into recommend_content(");
            strSql.Append("title,content,url,picture,group_id)");

            strSql.Append(" values (");
            strSql.Append("@title,@content,@url,@picture,@group_id)");
            strSql.Append(";select @@IDENTITY");
            Database db = DatabaseFactory.CreateDatabase();
            DbCommand dbCommand = db.GetSqlStringCommand(strSql.ToString());
            db.AddInParameter(dbCommand, "title", DbType.String, model.title);
            db.AddInParameter(dbCommand, "content", DbType.String, model.content);
            db.AddInParameter(dbCommand, "url", DbType.String, model.url);
            db.AddInParameter(dbCommand, "picture", DbType.String, model.picture);
            db.AddInParameter(dbCommand, "group_id", DbType.Int32, model.group_id);
            int result;
            object obj = db.ExecuteScalar(dbCommand);
            if(!int.TryParse(obj.ToString(),out result))
            {
                return 0;
            }
            return result;
        }
예제 #12
0
 /// <summary>
 /// ����һ������
 /// </summary>
 public void Update(Mxm.Model.recommend_content model)
 {
     StringBuilder strSql=new StringBuilder();
     strSql.Append("update recommend_content set ");
     strSql.Append("title=@title,");
     strSql.Append("content=@content,");
     strSql.Append("url=@url,");
     strSql.Append("picture=@picture,");
     strSql.Append("group_id=@group_id");
     strSql.Append(" where id=@id ");
     Database db = DatabaseFactory.CreateDatabase();
     DbCommand dbCommand = db.GetSqlStringCommand(strSql.ToString());
     db.AddInParameter(dbCommand, "id", DbType.Int32, model.id);
     db.AddInParameter(dbCommand, "title", DbType.String, model.title);
     db.AddInParameter(dbCommand, "content", DbType.String, model.content);
     db.AddInParameter(dbCommand, "url", DbType.String, model.url);
     db.AddInParameter(dbCommand, "picture", DbType.String, model.picture);
     db.AddInParameter(dbCommand, "group_id", DbType.Int32, model.group_id);
     db.ExecuteNonQuery(dbCommand);
 }
예제 #13
0
 /// <summary>
 /// ����һ������
 /// </summary>
 public void Update(Mxm.Model.product_type model)
 {
     StringBuilder strSql = new StringBuilder();
     strSql.Append("update product_type set ");
     strSql.Append("type_name=@type_name,");
     strSql.Append("parent_id=@parent_id,");
     strSql.Append("banner=@banner,");
     strSql.Append("remark=@remark");
     strSql.Append(" where type_id=@type_id ");
     Database db = DatabaseFactory.CreateDatabase();
     DbCommand dbCommand = db.GetSqlStringCommand(strSql.ToString());
     db.AddInParameter(dbCommand, "type_id", DbType.Int32, model.type_id);
     db.AddInParameter(dbCommand, "type_name", DbType.String, model.type_name);
     db.AddInParameter(dbCommand, "parent_id", DbType.Int32, model.parent_id);
     db.AddInParameter(dbCommand, "banner", DbType.String, model.banner);
     db.AddInParameter(dbCommand, "remark", DbType.String, model.remark);
     db.ExecuteNonQuery(dbCommand);
 }
예제 #14
0
        /// <summary>
        /// ����һ������
        /// </summary>
        public void Update(Mxm.Model.attachment model)
        {
            StringBuilder strSql=new StringBuilder();
            strSql.Append("update attachment set ");
            strSql.Append("path=@path,");
            strSql.Append("depositor_id=@depositor_id,");
            strSql.Append("depositor_type=@depositor_type,");
            strSql.Append("create_time=@create_time,");
            strSql.Append("file_type=@file_type");
            strSql.Append(" where attach_id=@attach_id ");
            SqlParameter[] parameters = {
                    new SqlParameter("@attach_id", SqlDbType.Int,4),
                    new SqlParameter("@path", SqlDbType.NVarChar,500),
                    new SqlParameter("@depositor_id", SqlDbType.Int,4),
                    new SqlParameter("@depositor_type", SqlDbType.Int,4),
                    new SqlParameter("@create_time", SqlDbType.DateTime),
                    new SqlParameter("@file_type", SqlDbType.Int,4)};
            parameters[0].Value = model.attach_id;
            parameters[1].Value = model.path;
            parameters[2].Value = model.depositor_id;
            parameters[3].Value = model.depositor_type;
            parameters[4].Value = model.create_time;
            parameters[5].Value = model.file_type;

            DbHelperSQL.ExecuteSql(strSql.ToString(),parameters);
        }
예제 #15
0
        /// <summary>
        /// ����һ������
        /// </summary>
        public void Update(Mxm.Model.article model)
        {
            StringBuilder strSql = new StringBuilder();
            strSql.Append("update article set ");
            strSql.Append("title=@title,");
            strSql.Append("content=@content,");
            strSql.Append("update_time=@update_time,");
            strSql.Append("author=@author,");
            strSql.Append("sub_title=@sub_title,");
            strSql.Append("editor=@editor,");
            strSql.Append("status=@status,");
            strSql.Append("type_id=@type_id,");
            strSql.Append("picture_small=@picture_small,");
            strSql.Append("sumary=@sumary");
            strSql.Append(" where aid=@aid ");
            SqlParameter[] parameters = {
                    new SqlParameter("@aid", SqlDbType.Int,8),
                    new SqlParameter("@title", SqlDbType.NVarChar,500),
                    new SqlParameter("@content", SqlDbType.NVarChar,0),
                    new SqlParameter("@update_time", SqlDbType.DateTime),
                    new SqlParameter("@author", SqlDbType.NVarChar,50),
                    new SqlParameter("@sub_title", SqlDbType.NVarChar,500),
                    new SqlParameter("@editor", SqlDbType.NVarChar,50),
                    new SqlParameter("@status", SqlDbType.Int,4),
                    new SqlParameter("@type_id", SqlDbType.Int,4),
                    new SqlParameter("@picture_small", SqlDbType.NVarChar,400),
                    new SqlParameter("@sumary", SqlDbType.NVarChar,1000)
            };
            parameters[0].Value = model.aid;
            parameters[1].Value = model.title;
            parameters[2].Value = model.content;
            parameters[3].Value = model.update_time;
            parameters[4].Value = model.author;
            parameters[5].Value = model.Sub_title;
            parameters[6].Value = model.Editor;
            parameters[7].Value = model.Status;
            parameters[8].Value = model.Type_id;
            parameters[9].Value = model.Picture_small;
            parameters[10].Value = model.Sumary;

            DbHelperSQL.ExecuteSql(strSql.ToString(), parameters);
        }
예제 #16
0
 /// <summary>
 /// ����һ������
 /// </summary>
 public void Update(Mxm.Model.production model)
 {
     StringBuilder strSql = new StringBuilder();
     strSql.Append("update production set ");
     strSql.Append("product_name=@product_name,");
     strSql.Append("product_desc=@product_desc,");
     strSql.Append("create_time=@create_time,");
     strSql.Append("update_time=@update_time,");
     strSql.Append("picture=@picture,");
     strSql.Append("status=@status,");
     strSql.Append("product_type=@product_type,");
     strSql.Append("balance=@balance,");
     strSql.Append("product_synopsis=@product_synopsis,");
     strSql.Append("market_price=@market_price,");
     strSql.Append("buy_price=@buy_price,");
     strSql.Append("sort=@sort, ");
     strSql.Append("vidio=@vidio, ");
     strSql.Append("picture_small=@picture_small, ");
     strSql.Append("model=@model ");
     strSql.Append(" where pid=@pid ");
     Database db = DatabaseFactory.CreateDatabase();
     DbCommand dbCommand = db.GetSqlStringCommand(strSql.ToString());
     db.AddInParameter(dbCommand, "pid", DbType.Int32, model.pid);
     db.AddInParameter(dbCommand, "product_name", DbType.String, model.product_name);
     db.AddInParameter(dbCommand, "product_desc", DbType.String, model.product_desc);
     db.AddInParameter(dbCommand, "create_time", DbType.DateTime, model.create_time);
     db.AddInParameter(dbCommand, "update_time", DbType.DateTime, model.update_time);
     db.AddInParameter(dbCommand, "picture", DbType.String, model.picture);
     db.AddInParameter(dbCommand, "status", DbType.Decimal, model.status);
     db.AddInParameter(dbCommand, "product_type", DbType.Int32, model.product_type);
     db.AddInParameter(dbCommand, "balance", DbType.Int32, model.balance);
     db.AddInParameter(dbCommand, "product_synopsis", DbType.String, model.product_synopsis);
     db.AddInParameter(dbCommand, "market_price", DbType.Decimal, model.market_price);
     db.AddInParameter(dbCommand, "buy_price", DbType.Decimal, model.buy_price);
     db.AddInParameter(dbCommand, "sort", DbType.Int32, model.sort);
     db.AddInParameter(dbCommand, "vidio", DbType.String, model.vidio);
     db.AddInParameter(dbCommand, "picture_small", DbType.String, model.picture_small);
     db.AddInParameter(dbCommand, "model", DbType.String, model.model);
     db.ExecuteNonQuery(dbCommand);
 }
예제 #17
0
 /// <summary>
 /// 更新一条数据
 /// </summary>
 public void Update(Mxm.Model.message_type model)
 {
     StringBuilder strSql = new StringBuilder();
     strSql.Append("update message_type set ");
     strSql.Append("type_name=@type_name");
     strSql.Append(" where type_id=@type_id ");
     Database db = DatabaseFactory.CreateDatabase();
     DbCommand dbCommand = db.GetSqlStringCommand(strSql.ToString());
     db.AddInParameter(dbCommand, "type_id", DbType.Int32, model.type_id);
     db.AddInParameter(dbCommand, "type_name", DbType.String, model.type_name);
     db.ExecuteNonQuery(dbCommand);
 }
예제 #18
0
        /// <summary>
        /// 更新一条数据
        /// </summary>
        public void Update(Mxm.Model.download model)
        {
            StringBuilder strSql = new StringBuilder();
            strSql.Append("update download set ");
            strSql.Append("name=@name,");
            strSql.Append("remark=@remark,");
            strSql.Append("picture=@picture,");
            strSql.Append("path=@path,");
            strSql.Append("sort=@sort,");
            strSql.Append("create_time=@create_time");
            strSql.Append(" where down_id=@down_id ");
            SqlParameter[] parameters = {
                    new SqlParameter("@down_id", SqlDbType.Int,4),
                    new SqlParameter("@name", SqlDbType.NVarChar,100),
                    new SqlParameter("@remark", SqlDbType.NVarChar,500),
                    new SqlParameter("@picture", SqlDbType.NVarChar,250),
                    new SqlParameter("@path", SqlDbType.NVarChar,250),
                    new SqlParameter("@sort", SqlDbType.Int,4),
                    new SqlParameter("@create_time", SqlDbType.DateTime)};
            parameters[0].Value = model.down_id;
            parameters[1].Value = model.name;
            parameters[2].Value = model.remark;
            parameters[3].Value = model.picture;
            parameters[4].Value = model.path;
            parameters[5].Value = model.sort;
            parameters[6].Value = model.create_time;

            DbHelperSQL.ExecuteSql(strSql.ToString(), parameters);
        }
예제 #19
0
        /// <summary>
        /// 更新一条数据
        /// </summary>
        public void Update(Mxm.Model.users model)
        {
            StringBuilder strSql = new StringBuilder();
            strSql.Append("update users set ");
            strSql.Append("username=@username,");
            strSql.Append("password=@password,");
            strSql.Append("sex=@sex,");
            strSql.Append("email=@email,");
            strSql.Append("mobile=@mobile,");
            strSql.Append("tel=@tel,");
            strSql.Append("last_login_time=@last_login_time,");
            strSql.Append("reg_time=@reg_time,");
            strSql.Append("qq=@qq,");
            strSql.Append("msn=@msn,");
            strSql.Append("status=@status");
            strSql.Append(" where uid=@uid ");
            SqlParameter[] parameters = {
                    new SqlParameter("@uid", SqlDbType.Int,4),
                    new SqlParameter("@username", SqlDbType.NVarChar,50),
                    new SqlParameter("@password", SqlDbType.NVarChar,50),
                    new SqlParameter("@sex", SqlDbType.Bit,1),
                    new SqlParameter("@email", SqlDbType.NVarChar,500),
                    new SqlParameter("@mobile", SqlDbType.NVarChar,50),
                    new SqlParameter("@tel", SqlDbType.NVarChar,100),
                    new SqlParameter("@last_login_time", SqlDbType.DateTime),
                    new SqlParameter("@reg_time", SqlDbType.DateTime),
                    new SqlParameter("@qq", SqlDbType.NVarChar,50),
                    new SqlParameter("@msn", SqlDbType.NVarChar,200),
                    new SqlParameter("@status", SqlDbType.Int,4)};
            parameters[0].Value = model.uid;
            parameters[1].Value = model.username;
            parameters[2].Value = model.password;
            parameters[3].Value = model.sex;
            parameters[4].Value = model.email;
            parameters[5].Value = model.mobile;
            parameters[6].Value = model.tel;
            parameters[7].Value = model.last_login_time;
            parameters[8].Value = model.reg_time;
            parameters[9].Value = model.qq;
            parameters[10].Value = model.msn;
            parameters[11].Value = model.status;

            DbHelperSQL.ExecuteSql(strSql.ToString(), parameters);
        }
예제 #20
0
 /// <summary>
 /// ����һ������
 /// </summary>
 public void Update(Mxm.Model.recommend_group model)
 {
     StringBuilder strSql=new StringBuilder();
     strSql.Append("update recommend_group set ");
     strSql.Append("group_name=@group_name,remark=@remark");
     strSql.Append(" where group_id=@group_id ");
     Database db = DatabaseFactory.CreateDatabase();
     DbCommand dbCommand = db.GetSqlStringCommand(strSql.ToString());
     db.AddInParameter(dbCommand, "group_id", DbType.Int32, model.group_id);
     db.AddInParameter(dbCommand, "group_name", DbType.String, model.group_name);
     db.AddInParameter(dbCommand, "remark", DbType.String, model.remark);
     db.ExecuteNonQuery(dbCommand);
 }