示例#1
0
        /// <summary>
        /// 获取记录总数
        /// </summary>
        public int GetRecordCount(string strWhere)
        {
            StringBuilder strSql = new StringBuilder();

            strSql.Append("select count(1) FROM BlogArticleCategory ");
            if (strWhere.Trim() != "")
            {
                strSql.Append(" where " + strWhere);
            }
            object obj = DbHelperSQLite.GetSingle(strSql.ToString());

            if (obj == null)
            {
                return(0);
            }
            else
            {
                return(Convert.ToInt32(obj));
            }
        }
示例#2
0
        /// <summary>
        /// 增加一条数据
        /// </summary>
        public int Add(DXD.Model.passport_report model)
        {
            StringBuilder strSql = new StringBuilder();

            strSql.Append("insert into passport_report(");
            strSql.Append("query_id,passpport_no,passport_type,approva_auth,issuing_date,valid_date,add_user,add_time)");
            strSql.Append(" values (");
            strSql.Append("@query_id,@passpport_no,@passport_type,@approva_auth,@issuing_date,@valid_date,@add_user,@add_time)");
            strSql.Append(";select LAST_INSERT_ROWID()");
            SQLiteParameter[] parameters =
            {
                new SQLiteParameter("@query_id",      DbType.Int32,       8),
                new SQLiteParameter("@passpport_no",  DbType.char,       20),
                new SQLiteParameter("@passport_type", DbType.String,    200),
                new SQLiteParameter("@approva_auth",  DbType.String,    255),
                new SQLiteParameter("@issuing_date",  DbType.DateTime),
                new SQLiteParameter("@valid_date",    DbType.DateTime),
                new SQLiteParameter("@add_user",      DbType.String,     50),
                new SQLiteParameter("@add_time",      DbType.DateTime)
            };
            parameters[0].Value = model.query_id;
            parameters[1].Value = model.passpport_no;
            parameters[2].Value = model.passport_type;
            parameters[3].Value = model.approva_auth;
            parameters[4].Value = model.issuing_date;
            parameters[5].Value = model.valid_date;
            parameters[6].Value = model.add_user;
            parameters[7].Value = model.add_time;

            object obj = DbHelperSQLite.GetSingle(strSql.ToString(), parameters);

            if (obj == null)
            {
                return(0);
            }
            else
            {
                return(Convert.ToInt32(obj));
            }
        }
示例#3
0
        /// <summary>
        /// 增加一条数据
        /// </summary>
        public int Add(WebSiteModel.WebSitelogin model)
        {
            StringBuilder strSql = new StringBuilder();

            strSql.Append("insert into WebSitelogin(");
            strSql.Append("WebSiteID,Background,BackloginURL,Username,UserPwd,Database,Controlpanel,Remark)");
            strSql.Append(" values (");
            strSql.Append("@WebSiteID,@Background,@BackloginURL,@Username,@UserPwd,@Database,@Controlpanel,@Remark)");
            strSql.Append(";select LAST_INSERT_ROWID()");
            SQLiteParameter[] parameters =
            {
                new SQLiteParameter("@WebSiteID",    DbType.Int32,   8),
                new SQLiteParameter("@Background",   DbType.String),
                new SQLiteParameter("@BackloginURL", DbType.String),
                new SQLiteParameter("@Username",     DbType.String),
                new SQLiteParameter("@UserPwd",      DbType.String),
                new SQLiteParameter("@Database",     DbType.String),
                new SQLiteParameter("@Controlpanel", DbType.String),
                new SQLiteParameter("@Remark",       DbType.String)
            };
            parameters[0].Value = model.WebSiteID;
            parameters[1].Value = model.Background;
            parameters[2].Value = model.BackloginURL;
            parameters[3].Value = model.Username;
            parameters[4].Value = model.UserPwd;
            parameters[5].Value = model.Database;
            parameters[6].Value = model.Controlpanel;
            parameters[7].Value = model.Remark;

            object obj = DbHelperSQLite.GetSingle(strSql.ToString(), parameters);

            if (obj == null)
            {
                return(0);
            }
            else
            {
                return(Convert.ToInt32(obj));
            }
        }
示例#4
0
        /// <summary>
        /// 增加一条数据
        /// </summary>
        public int Add(Bsam.Core.Model.Models.Model.Guestbook model)
        {
            StringBuilder strSql = new StringBuilder();

            strSql.Append("insert into Guestbook(");
            strSql.Append("blogId,createdate,username,phone,QQ,body,ip,isshow)");
            strSql.Append(" values (");
            strSql.Append("@blogId,@createdate,@username,@phone,@QQ,@body,@ip,@isshow)");
            strSql.Append(";select LAST_INSERT_ROWID()");
            SQLiteParameter[] parameters =
            {
                new SQLiteParameter("@blogId",     DbType.Int32,     8),
                new SQLiteParameter("@createdate", DbType.DateTime),
                new SQLiteParameter("@username",   DbType.String),
                new SQLiteParameter("@phone",      DbType.String),
                new SQLiteParameter("@QQ",         DbType.String),
                new SQLiteParameter("@body",       DbType.String),
                new SQLiteParameter("@ip",         DbType.String),
                new SQLiteParameter("@isshow",     DbType.bit, 1)
            };
            parameters[0].Value = model.blogId;
            parameters[1].Value = model.createdate;
            parameters[2].Value = model.username;
            parameters[3].Value = model.phone;
            parameters[4].Value = model.QQ;
            parameters[5].Value = model.body;
            parameters[6].Value = model.ip;
            parameters[7].Value = model.isshow;

            object obj = DbHelperSQLite.GetSingle(strSql.ToString(), parameters);

            if (obj == null)
            {
                return(0);
            }
            else
            {
                return(Convert.ToInt32(obj));
            }
        }
示例#5
0
        /// <summary>
        /// 增加一条数据
        /// </summary>
        public int Add(Blogs.Model.BlogPhotoAlblum model)
        {
            StringBuilder strSql = new StringBuilder();

            strSql.Append("insert into BlogPhotoAlblum(");
            strSql.Append("paauthor,patitle,paremark,pacoversrc,paphotonum,pastatu,paaddtime,paisdel)");
            strSql.Append(" values (");
            strSql.Append("@paauthor,@patitle,@paremark,@pacoversrc,@paphotonum,@pastatu,@paaddtime,@paisdel)");
            strSql.Append(";select LAST_INSERT_ROWID()");
            SQLiteParameter[] parameters =
            {
                new SQLiteParameter("@paauthor",   DbType.Int32,     8),
                new SQLiteParameter("@patitle",    DbType.String),
                new SQLiteParameter("@paremark",   DbType.String),
                new SQLiteParameter("@pacoversrc", DbType.String),
                new SQLiteParameter("@paphotonum", DbType.Int32,     8),
                new SQLiteParameter("@pastatu",    DbType.Int32,     8),
                new SQLiteParameter("@paaddtime",  DbType.DateTime),
                new SQLiteParameter("@paisdel",    DbType.Boolean)
            };
            parameters[0].Value = model.paauthor;
            parameters[1].Value = model.patitle;
            parameters[2].Value = model.paremark;
            parameters[3].Value = model.pacoversrc;
            parameters[4].Value = model.paphotonum;
            parameters[5].Value = model.pastatu;
            parameters[6].Value = model.paaddtime;
            parameters[7].Value = model.paisdel;

            object obj = DbHelperSQLite.GetSingle(strSql.ToString(), parameters);

            if (obj == null)
            {
                return(0);
            }
            else
            {
                return(Convert.ToInt32(obj));
            }
        }
示例#6
0
        /// <summary>
        /// 增加一条数据
        /// </summary>
        public int Add(DXD.Model.house_feedback model)
        {
            StringBuilder strSql = new StringBuilder();

            strSql.Append("insert into house_feedback(");
            strSql.Append("query_id,city,address,area,use_for,reg_time,add_user,add_time)");
            strSql.Append(" values (");
            strSql.Append("@query_id,@city,@address,@area,@use_for,@reg_time,@add_user,@add_time)");
            strSql.Append(";select LAST_INSERT_ROWID()");
            SQLiteParameter[] parameters =
            {
                new SQLiteParameter("@query_id", DbType.Int32,       8),
                new SQLiteParameter("@city",     DbType.String,     50),
                new SQLiteParameter("@address",  DbType.String,    255),
                new SQLiteParameter("@area",     DbType.Decimal,     4),
                new SQLiteParameter("@use_for",  DbType.String,     50),
                new SQLiteParameter("@reg_time", DbType.DateTime),
                new SQLiteParameter("@add_user", DbType.String,     50),
                new SQLiteParameter("@add_time", DbType.DateTime)
            };
            parameters[0].Value = model.query_id;
            parameters[1].Value = model.city;
            parameters[2].Value = model.address;
            parameters[3].Value = model.area;
            parameters[4].Value = model.use_for;
            parameters[5].Value = model.reg_time;
            parameters[6].Value = model.add_user;
            parameters[7].Value = model.add_time;

            object obj = DbHelperSQLite.GetSingle(strSql.ToString(), parameters);

            if (obj == null)
            {
                return(0);
            }
            else
            {
                return(Convert.ToInt32(obj));
            }
        }
示例#7
0
        /// <summary>
        /// 增加一条数据
        /// </summary>
        public int Add(DXD.Model.security_compare model)
        {
            StringBuilder strSql = new StringBuilder();

            strSql.Append("insert into security_compare(");
            strSql.Append("query_id,feedback_id,report_id,compare_type,less_number,less_value,add_user,add_time)");
            strSql.Append(" values (");
            strSql.Append("@query_id,@feedback_id,@report_id,@compare_type,@less_number,@less_value,@add_user,@add_time)");
            strSql.Append(";select LAST_INSERT_ROWID()");
            SQLiteParameter[] parameters =
            {
                new SQLiteParameter("@query_id",     DbType.Int32,    8),
                new SQLiteParameter("@feedback_id",  DbType.Int32,    8),
                new SQLiteParameter("@report_id",    DbType.Int32,    8),
                new SQLiteParameter("@compare_type", DbType.Int32,    4),
                new SQLiteParameter("@less_number",  DbType.Decimal,  4),
                new SQLiteParameter("@less_value",   DbType.Decimal,  4),
                new SQLiteParameter("@add_user",     DbType.String,  50),
                new SQLiteParameter("@add_time",     DbType.DateTime)
            };
            parameters[0].Value = model.query_id;
            parameters[1].Value = model.feedback_id;
            parameters[2].Value = model.report_id;
            parameters[3].Value = model.compare_type;
            parameters[4].Value = model.less_number;
            parameters[5].Value = model.less_value;
            parameters[6].Value = model.add_user;
            parameters[7].Value = model.add_time;

            object obj = DbHelperSQLite.GetSingle(strSql.ToString(), parameters);

            if (obj == null)
            {
                return(0);
            }
            else
            {
                return(Convert.ToInt32(obj));
            }
        }
示例#8
0
        /// <summary>
        /// 增加一条数据
        /// </summary>
        public int Add(DXD.Model.compare_result model)
        {
            StringBuilder strSql = new StringBuilder();

            strSql.Append("insert into compare_result(");
            strSql.Append("query_id,result_type,report_str,feedback_str,compare_str,rep_lock,add_user,add_time)");
            strSql.Append(" values (");
            strSql.Append("@query_id,@result_type,@report_str,@feedback_str,@compare_str,@rep_lock,@add_user,@add_time)");
            strSql.Append(";select LAST_INSERT_ROWID()");
            SQLiteParameter[] parameters =
            {
                new SQLiteParameter("@query_id",     DbType.Int32,     8),
                new SQLiteParameter("@result_type",  DbType.String,   16),
                new SQLiteParameter("@report_str",   DbType.String),
                new SQLiteParameter("@feedback_str", DbType.String),
                new SQLiteParameter("@compare_str",  DbType.String),
                new SQLiteParameter("@rep_lock",     DbType.Boolean),
                new SQLiteParameter("@add_user",     DbType.String,   50),
                new SQLiteParameter("@add_time",     DbType.DateTime)
            };
            parameters[0].Value = model.query_id;
            parameters[1].Value = model.result_type;
            parameters[2].Value = model.report_str;
            parameters[3].Value = model.feedback_str;
            parameters[4].Value = model.compare_str;
            parameters[5].Value = model.rep_lock;
            parameters[6].Value = model.add_user;
            parameters[7].Value = model.add_time;

            object obj = DbHelperSQLite.GetSingle(strSql.ToString(), parameters);

            if (obj == null)
            {
                return(0);
            }
            else
            {
                return(Convert.ToInt32(obj));
            }
        }
示例#9
0
文件: UserDAL.cs 项目: qcjxberin/Dou
        public static bool Exists(string strSql, params SQLiteParameter[] cmdParms)
        {
            object obj = DbHelperSQLite.GetSingle(strSql, cmdParms);
            int    cmdresult;

            if ((Object.Equals(obj, null)) || (Object.Equals(obj, System.DBNull.Value)))
            {
                cmdresult = 0;
            }
            else
            {
                cmdresult = int.Parse(obj.ToString());
            }
            if (cmdresult == 0)
            {
                return(false);
            }
            else
            {
                return(true);
            }
        }
示例#10
0
        /// <summary>
        /// 增加一条数据
        /// </summary>
        public int Add(ERPWPF.Model.Shangpin model)
        {
            StringBuilder strSql = new StringBuilder();

            strSql.Append("insert into Shangpin(");
            strSql.Append("GCode,GName,GGuige,GShuliang,GJinjia,GShoujia,GTime)");
            strSql.Append(" values (");
            strSql.Append("@GCode,@GName,@GGuige,@GShuliang,@GJinjia,@GShoujia,@GTime)");
            strSql.Append(";select LAST_INSERT_ROWID()");
            SQLiteParameter[] parameters =
            {
                new SQLiteParameter("@GCode",     DbType.String),
                new SQLiteParameter("@GName",     DbType.String),
                new SQLiteParameter("@GGuige",    DbType.String),
                new SQLiteParameter("@GShuliang", DbType.String),
                new SQLiteParameter("@GJinjia",   DbType.String),
                new SQLiteParameter("@GShoujia",  DbType.String),
                new SQLiteParameter("@GTime",     DbType.String)
            };
            parameters[0].Value = model.GCode;
            parameters[1].Value = model.GName;
            parameters[2].Value = model.GGuige;
            parameters[3].Value = model.GShuliang;
            parameters[4].Value = model.GJinjia;
            parameters[5].Value = model.GShoujia;
            parameters[6].Value = model.GTime;

            object obj = DbHelperSQLite.GetSingle(strSql.ToString(), parameters);

            if (obj == null)
            {
                return(0);
            }
            else
            {
                return(Convert.ToInt32(obj));
            }
        }
示例#11
0
        /// <summary>
        /// 增加一条数据
        /// </summary>
        public int Add(WebSiteModel.WebToAttribute model)
        {
            StringBuilder strSql = new StringBuilder();

            strSql.Append("insert into WebToAttribute(");
            strSql.Append("WebSiteID,WebAttitudesID,Title,Content,Addtime,Remark)");
            strSql.Append(" values (");
            strSql.Append("@WebSiteID,@WebAttitudesID,@Title,@Content,@Addtime,@Remark)");
            strSql.Append(";select LAST_INSERT_ROWID()");
            SQLiteParameter[] parameters =
            {
                new SQLiteParameter("@WebSiteID",      DbType.Int32,     8),
                new SQLiteParameter("@WebAttitudesID", DbType.Int32,     8),
                new SQLiteParameter("@Title",          DbType.String),
                new SQLiteParameter("@Content",        DbType.String),
                new SQLiteParameter("@Addtime",        DbType.DateTime),
                new SQLiteParameter("@Remark",         DbType.String)
            };
            parameters[0].Value = model.WebSiteID;
            parameters[1].Value = model.WebAttitudesID;
            parameters[2].Value = model.Title;
            parameters[3].Value = model.Content;
            parameters[4].Value = model.Addtime;
            parameters[5].Value = model.Remark;

            object obj = DbHelperSQLite.GetSingle(strSql.ToString(), parameters);

            if (obj == null)
            {
                return(0);
            }
            else
            {
                return(Convert.ToInt32(obj));
            }
        }
示例#12
0
        /// <summary>
        /// 增加一条数据
        /// </summary>
        public int Add(DXD.Model.query_list model)
        {
            StringBuilder strSql = new StringBuilder();

            strSql.Append("insert into query_list(");
            strSql.Append("query_title,batch,client,entrust_date,add_user,add_time)");
            strSql.Append(" values (");
            strSql.Append("@query_title,@batch,@client,@entrust_date,@add_user,@add_time)");
            strSql.Append(";select LAST_INSERT_ROWID()");
            SQLiteParameter[] parameters =
            {
                new SQLiteParameter("@query_title",  DbType.String,    255),
                new SQLiteParameter("@batch",        DbType.String,     50),
                new SQLiteParameter("@client",       DbType.String,    200),
                new SQLiteParameter("@entrust_date", DbType.DateTime),
                new SQLiteParameter("@add_user",     DbType.String,     50),
                new SQLiteParameter("@add_time",     DbType.DateTime)
            };
            parameters[0].Value = model.query_title;
            parameters[1].Value = model.batch;
            parameters[2].Value = model.client;
            parameters[3].Value = model.entrust_date;
            parameters[4].Value = model.add_user;
            parameters[5].Value = model.add_time;

            object obj = DbHelperSQLite.GetSingle(strSql.ToString(), parameters);

            if (obj == null)
            {
                return(0);
            }
            else
            {
                return(Convert.ToInt32(obj));
            }
        }
示例#13
0
        /// <summary>
        /// 增加一条数据
        /// </summary>
        public int Add(WebSiteModel.Relation model)
        {
            StringBuilder strSql = new StringBuilder();

            strSql.Append("insert into Relation(");
            strSql.Append("WebSiteID,WebStatusID,PartnerID,WebSiteloginID,BrandsID,DomainID)");
            strSql.Append(" values (");
            strSql.Append("@WebSiteID,@WebStatusID,@PartnerID,@WebSiteloginID,@BrandsID,@DomainID)");
            strSql.Append(";select LAST_INSERT_ROWID()");
            SQLiteParameter[] parameters =
            {
                new SQLiteParameter("@WebSiteID",      DbType.Int32, 8),
                new SQLiteParameter("@WebStatusID",    DbType.Int32, 8),
                new SQLiteParameter("@PartnerID",      DbType.Int32, 8),
                new SQLiteParameter("@WebSiteloginID", DbType.Int32, 8),
                new SQLiteParameter("@BrandsID",       DbType.Int32, 8),
                new SQLiteParameter("@DomainID",       DbType.Int32, 8)
            };
            parameters[0].Value = model.WebSiteID;
            parameters[1].Value = model.WebStatusID;
            parameters[2].Value = model.PartnerID;
            parameters[3].Value = model.WebSiteloginID;
            parameters[4].Value = model.BrandsID;
            parameters[5].Value = model.DomainID;

            object obj = DbHelperSQLite.GetSingle(strSql.ToString(), parameters);

            if (obj == null)
            {
                return(0);
            }
            else
            {
                return(Convert.ToInt32(obj));
            }
        }
示例#14
0
        /// <summary>
        /// 增加一条数据
        /// </summary>
        public int Add(Blogs.Model.Enumeration model)
        {
            StringBuilder strSql = new StringBuilder();

            strSql.Append("insert into Enumeration(");
            strSql.Append("e_ename,e_cname,e_type,e_remark,e_addtime,e_isdel)");
            strSql.Append(" values (");
            strSql.Append("@e_ename,@e_cname,@e_type,@e_remark,@e_addtime,@e_isdel)");
            strSql.Append(";select LAST_INSERT_ROWID()");
            SQLiteParameter[] parameters =
            {
                new SQLiteParameter("@e_ename",   DbType.String),
                new SQLiteParameter("@e_cname",   DbType.String),
                new SQLiteParameter("@e_type",    DbType.String),
                new SQLiteParameter("@e_remark",  DbType.String),
                new SQLiteParameter("@e_addtime", DbType.DateTime),
                new SQLiteParameter("@e_isdel",   DbType.Boolean, 1)
            };
            parameters[0].Value = model.e_ename;
            parameters[1].Value = model.e_cname;
            parameters[2].Value = model.e_type;
            parameters[3].Value = model.e_remark;
            parameters[4].Value = model.e_addtime;
            parameters[5].Value = model.e_isdel;

            object obj = DbHelperSQLite.GetSingle(strSql.ToString(), parameters);

            if (obj == null)
            {
                return(0);
            }
            else
            {
                return(Convert.ToInt32(obj));
            }
        }
示例#15
0
        /// <summary>
        /// 分页
        /// </summary>
        /// <param name="pagecount">总数量</param>
        /// <param name="pageindex">当前页</param>
        /// <param name="pagesize">每页数量</param>
        /// <returns></returns>
        public List <ColumnImgs> FindPaging(ref int pagecount, int pageindex, int pagesize)
        {
            //跳过个数
            int               skipcount = pageindex > 0 ? (pageindex - 1) * pagesize : 0;
            string            sqlstr    = "SELECT [Id] ,[CID] ,[Title] ,[ImgStr] ,[ImgLink] ,[Orders] FROM [tbl_ColumnImgs] Limit " + pagesize + " Offset " + skipcount;
            DataSet           ds        = DbHelperSQLite.Query(sqlstr);
            List <ColumnImgs> list      = new List <ColumnImgs>();

            if (ds.Tables[0].Rows.Count > 0)
            {
                var res = (ds.Tables[0].Rows[0]);

                foreach (DataRow item in ds.Tables[0].Rows)
                {
                    var t = ModelHelper.DataRowToModel <ColumnImgs>(item);
                    list.Add(t);
                }
            }
            //总量
            string sqlstr2 = "SELECT count([Id]) FROM [tbl_ColumnImgs]";

            pagecount = Convert.ToInt32(DbHelperSQLite.GetSingle(sqlstr2));
            return(list);
        }
示例#16
0
        public int Add(Model.manual_report model)
        {
            StringBuilder strSql = new StringBuilder();

            strSql.Append("insert into manual_report(");
            strSql.Append("query_id,rep_type,appellation,rep_str,add_user,add_time)");
            strSql.Append(" values (");
            strSql.Append("@query_id,@rep_type,@appellation,@rep_str,@add_user,@add_time)");
            strSql.Append(";select LAST_INSERT_ROWID()");
            SQLiteParameter[] parameters =
            {
                new SQLiteParameter("@query_id",    DbType.Int32,    8),
                new SQLiteParameter("@rep_type",    DbType.String,   8),
                new SQLiteParameter("@appellation", DbType.String,   8),
                new SQLiteParameter("@rep_str",     DbType.String, 255),
                new SQLiteParameter("@add_user",    DbType.String,  50),
                new SQLiteParameter("@add_time",    DbType.DateTime)
            };
            parameters[0].Value = model.query_id;
            parameters[1].Value = model.rep_type;
            parameters[2].Value = model.appellation;
            parameters[3].Value = model.rep_str;
            parameters[4].Value = model.add_user;
            parameters[5].Value = model.add_time;

            object obj = DbHelperSQLite.GetSingle(strSql.ToString(), parameters);

            if (obj == null)
            {
                return(0);
            }
            else
            {
                return(Convert.ToInt32(obj));
            }
        }
示例#17
0
        /// <summary>
        /// 增加一条数据
        /// </summary>
        public int Add(Blogs.Model.BlogArticleCategory model)
        {
            StringBuilder strSql = new StringBuilder();

            strSql.Append("insert into BlogArticleCategory(");
            strSql.Append("author,categoryName,remark,status,isdel,addtime)");
            strSql.Append(" values (");
            strSql.Append("@author,@categoryName,@remark,@status,@isdel,@addtime)");
            strSql.Append(";select LAST_INSERT_ROWID()");
            SQLiteParameter[] parameters =
            {
                new SQLiteParameter("@author",       DbType.Int32,   4),
                new SQLiteParameter("@categoryName", DbType.String),
                new SQLiteParameter("@remark",       DbType.String),
                new SQLiteParameter("@status",       DbType.Int32,   4),
                new SQLiteParameter("@isdel",        DbType.Boolean, 1),
                new SQLiteParameter("@addtime",      DbType.DateTime)
            };
            parameters[0].Value = model.author;
            parameters[1].Value = model.CategoryName;
            parameters[2].Value = model.remark;
            parameters[3].Value = model.status;
            parameters[4].Value = model.isdel;
            parameters[5].Value = model.addtime;

            object obj = DbHelperSQLite.GetSingle(strSql.ToString(), parameters);

            if (obj == null)
            {
                return(0);
            }
            else
            {
                return(Convert.ToInt32(obj));
            }
        }
示例#18
0
文件: UserDal.cs 项目: sychenying/MX
        /// <summary>
        /// 分页
        /// </summary>
        /// <param name="pagecount">总数量</param>
        /// <param name="pageindex">当前页</param>
        /// <param name="pagesize">每页数量</param>
        /// <returns></returns>
        public List <User> FindPaging(ref int pagecount, int pageindex, int pagesize)
        {
            //跳过个数
            int         skipcount = pageindex > 0 ? (pageindex - 1) * pagesize : 0;
            string      sqlstr    = "SELECT [Id],[UserName],[PassWord],[States] FROM [tbl_User] Limit " + pagesize + " Offset " + skipcount;
            DataSet     ds        = DbHelperSQLite.Query(sqlstr);
            List <User> list      = new List <User>();

            if (ds.Tables[0].Rows.Count > 0)
            {
                var res = (ds.Tables[0].Rows[0]);

                foreach (DataRow item in ds.Tables[0].Rows)
                {
                    var t = ModelHelper.DataRowToModel <User>(item);
                    list.Add(t);
                }
            }
            //总量
            string sqlstr2 = "SELECT count([Id]) FROM [tbl_User]";

            pagecount = Convert.ToInt32(DbHelperSQLite.GetSingle(sqlstr2));
            return(list);
        }
示例#19
0
        /// <summary>
        /// 增加一条数据
        /// </summary>
        public int Add(Blogs.Model.BlogCommentArticle model)
        {
            StringBuilder strSql = new StringBuilder();

            strSql.Append("insert into BlogCommentArticle(");
            strSql.Append("cmaarticle,cmaauthor,cmatitle,cmacontent,cmaaddtime,cmaisdel)");
            strSql.Append(" values (");
            strSql.Append("@cmaarticle,@cmaauthor,@cmatitle,@cmacontent,@cmaaddtime,@cmaisdel)");
            strSql.Append(";select LAST_INSERT_ROWID()");
            SQLiteParameter[] parameters =
            {
                new SQLiteParameter("@cmaarticle", DbType.Int32,     4),
                new SQLiteParameter("@cmaauthor",  DbType.Int32,     4),
                new SQLiteParameter("@cmatitle",   DbType.String),
                new SQLiteParameter("@cmacontent", DbType.String),
                new SQLiteParameter("@cmaaddtime", DbType.DateTime),
                new SQLiteParameter("@cmaisdel",   DbType.Boolean)
            };
            parameters[0].Value = model.cmaarticle;
            parameters[1].Value = model.cmaauthor;
            parameters[2].Value = model.cmatitle;
            parameters[3].Value = model.cmacontent;
            parameters[4].Value = model.cmaaddtime;
            parameters[5].Value = model.cmaisdel;

            object obj = DbHelperSQLite.GetSingle(strSql.ToString(), parameters);

            if (obj == null)
            {
                return(0);
            }
            else
            {
                return(Convert.ToInt32(obj));
            }
        }
示例#20
0
        /// <summary>
        /// 查询栏目下所有文章/产品
        /// </summary>
        /// <param name="pagecount">总数量</param>
        /// <param name="pageindex">当前页</param>
        /// <param name="pagesize">每页数量</param>
        /// <param name="CID">栏目ID</param>
        /// <returns></returns>
        public List <Article> FindPagingListByCID(ref int pagecount, int pageindex, int pagesize, long CID)
        {
            //跳过个数
            int            skipcount = pageindex > 0 ? (pageindex - 1) * pagesize : 0;
            string         sqlstr    = "SELECT [Id],[CID],[Title],[ImgStr],[ProductTxt],[ShortTxt],[AddTime],[Clicks] FROM [tbl_Article] where [CID]=" + CID + " order by [Id] desc Limit " + pagesize + " Offset " + skipcount;
            DataSet        ds        = DbHelperSQLite.Query(sqlstr);
            List <Article> list      = new List <Article>();

            if (ds.Tables[0].Rows.Count > 0)
            {
                var res = (ds.Tables[0].Rows[0]);

                foreach (DataRow item in ds.Tables[0].Rows)
                {
                    var t = ModelHelper.DataRowToModel <Article>(item);
                    list.Add(t);
                }
            }
            //总量
            string sqlstr2 = "SELECT count([Id]) FROM [tbl_Article] where [CID]=" + CID;

            pagecount = Convert.ToInt32(DbHelperSQLite.GetSingle(sqlstr2));
            return(list);
        }
示例#21
0
        /// <summary>
        /// 增加一条数据
        /// </summary>
        public int Add(JC.Model.users model)
        {
            StringBuilder strSql = new StringBuilder();

            strSql.Append("insert into users(");
            strSql.Append("username,nickname,email,pwd,avator,postdate,modifydate,isadmin,logtime,ext1,ext2,ext3,ext4,ext5,ext6,ext7,ext8,ext9,ext10)");
            strSql.Append(" values (");
            strSql.Append("@username,@nickname,@email,@pwd,@avator,@postdate,@modifydate,@isadmin,@logtime,@ext1,@ext2,@ext3,@ext4,@ext5,@ext6,@ext7,@ext8,@ext9,@ext10)");
            strSql.Append(";select LAST_INSERT_ROWID()");
            SQLiteParameter[] parameters =
            {
                new SQLiteParameter("@username",   DbType.String),
                new SQLiteParameter("@nickname",   DbType.String),
                new SQLiteParameter("@email",      DbType.String),
                new SQLiteParameter("@pwd",        DbType.String),
                new SQLiteParameter("@avator",     DbType.String),
                new SQLiteParameter("@postdate",   DbType.DateTime),
                new SQLiteParameter("@modifydate", DbType.DateTime),
                new SQLiteParameter("@isadmin",    DbType.Int32,     8),
                new SQLiteParameter("@logtime",    DbType.Int32,     8),
                new SQLiteParameter("@ext1",       DbType.String),
                new SQLiteParameter("@ext2",       DbType.String),
                new SQLiteParameter("@ext3",       DbType.String),
                new SQLiteParameter("@ext4",       DbType.String),
                new SQLiteParameter("@ext5",       DbType.String),
                new SQLiteParameter("@ext6",       DbType.String),
                new SQLiteParameter("@ext7",       DbType.String),
                new SQLiteParameter("@ext8",       DbType.String),
                new SQLiteParameter("@ext9",       DbType.String),
                new SQLiteParameter("@ext10",      DbType.String)
            };
            parameters[0].Value  = model.username;
            parameters[1].Value  = model.nickname;
            parameters[2].Value  = model.email;
            parameters[3].Value  = model.pwd;
            parameters[4].Value  = model.avator;
            parameters[5].Value  = model.postdate;
            parameters[6].Value  = model.modifydate;
            parameters[7].Value  = model.isadmin;
            parameters[8].Value  = model.logtime;
            parameters[9].Value  = model.ext1;
            parameters[10].Value = model.ext2;
            parameters[11].Value = model.ext3;
            parameters[12].Value = model.ext4;
            parameters[13].Value = model.ext5;
            parameters[14].Value = model.ext6;
            parameters[15].Value = model.ext7;
            parameters[16].Value = model.ext8;
            parameters[17].Value = model.ext9;
            parameters[18].Value = model.ext10;

            object obj = DbHelperSQLite.GetSingle(strSql.ToString(), parameters);

            if (obj == null)
            {
                return(0);
            }
            else
            {
                return(Convert.ToInt32(obj));
            }
        }
示例#22
0
        /// <summary>
        /// 增加一条数据
        /// </summary>
        public int Add(Scada.Model.ScadaTableDetail model)
        {
            StringBuilder strSql  = new StringBuilder();
            StringBuilder strSql1 = new StringBuilder();
            StringBuilder strSql2 = new StringBuilder();

            if (model.TableId != null)
            {
                strSql1.Append("TableId,");
                strSql2.Append("'" + model.TableId + "',");
            }
            if (model.FieldTitles != null)
            {
                strSql1.Append("FieldTitles,");
                strSql2.Append("'" + model.FieldTitles + "',");
            }
            if (model.FieldIOPath != null)
            {
                strSql1.Append("FieldIOPath,");
                strSql2.Append("'" + model.FieldIOPath + "',");
            }
            if (model.CreateTime != null)
            {
                strSql1.Append("CreateTime,");
                strSql2.Append("'" + model.CreateTime + "',");
            }
            if (model.SortCode != null)
            {
                strSql1.Append("SortCode,");
                strSql2.Append("" + model.SortCode + ",");
            }
            if (model.CreateUserId != null)
            {
                strSql1.Append("CreateUserId,");
                strSql2.Append("" + model.CreateUserId + ",");
            }
            if (model.UpdateTime != null)
            {
                strSql1.Append("UpdateTime,");
                strSql2.Append("'" + model.UpdateTime + "',");
            }
            if (model.UpdateUserId != null)
            {
                strSql1.Append("UpdateUserId,");
                strSql2.Append("" + model.UpdateUserId + ",");
            }
            strSql.Append("insert into ScadaTableDetail(");
            strSql.Append(strSql1.ToString().Remove(strSql1.Length - 1));
            strSql.Append(")");
            strSql.Append(" values (");
            strSql.Append(strSql2.ToString().Remove(strSql2.Length - 1));
            strSql.Append(")");
            strSql.Append(";select LAST_INSERT_ROWID()");
            object obj = DbHelperSQLite.GetSingle(strSql.ToString());

            if (obj == null)
            {
                return(0);
            }
            else
            {
                return(Convert.ToInt32(obj));
            }
        }
示例#23
0
        /// <summary>
        /// 增加一条数据
        /// </summary>
        public int Add(Bsam.Core.Model.Models.Model.Module model)
        {
            StringBuilder strSql = new StringBuilder();

            strSql.Append("insert into Module(");
            strSql.Append("IsDeleted,ParentId,Name,LinkUrl,Area,Controller,Action,Icon,Code,OrderSort,Description,IsMenu,Enabled,CreateId,CreateBy,CreateTime,ModifyId,ModifyBy,ModifyTime)");
            strSql.Append(" values (");
            strSql.Append("@IsDeleted,@ParentId,@Name,@LinkUrl,@Area,@Controller,@Action,@Icon,@Code,@OrderSort,@Description,@IsMenu,@Enabled,@CreateId,@CreateBy,@CreateTime,@ModifyId,@ModifyBy,@ModifyTime)");
            strSql.Append(";select LAST_INSERT_ROWID()");
            SQLiteParameter[] parameters =
            {
                new SQLiteParameter("@IsDeleted",   DbType.bit,       1),
                new SQLiteParameter("@ParentId",    DbType.Int32,     8),
                new SQLiteParameter("@Name",        DbType.String),
                new SQLiteParameter("@LinkUrl",     DbType.String),
                new SQLiteParameter("@Area",        DbType.String),
                new SQLiteParameter("@Controller",  DbType.String),
                new SQLiteParameter("@Action",      DbType.String),
                new SQLiteParameter("@Icon",        DbType.String),
                new SQLiteParameter("@Code",        DbType.String),
                new SQLiteParameter("@OrderSort",   DbType.Int32,     8),
                new SQLiteParameter("@Description", DbType.String),
                new SQLiteParameter("@IsMenu",      DbType.bit,       1),
                new SQLiteParameter("@Enabled",     DbType.bit,       1),
                new SQLiteParameter("@CreateId",    DbType.Int32,     8),
                new SQLiteParameter("@CreateBy",    DbType.String),
                new SQLiteParameter("@CreateTime",  DbType.DateTime),
                new SQLiteParameter("@ModifyId",    DbType.Int32,     8),
                new SQLiteParameter("@ModifyBy",    DbType.String),
                new SQLiteParameter("@ModifyTime",  DbType.DateTime)
            };
            parameters[0].Value  = model.IsDeleted;
            parameters[1].Value  = model.ParentId;
            parameters[2].Value  = model.Name;
            parameters[3].Value  = model.LinkUrl;
            parameters[4].Value  = model.Area;
            parameters[5].Value  = model.Controller;
            parameters[6].Value  = model.Action;
            parameters[7].Value  = model.Icon;
            parameters[8].Value  = model.Code;
            parameters[9].Value  = model.OrderSort;
            parameters[10].Value = model.Description;
            parameters[11].Value = model.IsMenu;
            parameters[12].Value = model.Enabled;
            parameters[13].Value = model.CreateId;
            parameters[14].Value = model.CreateBy;
            parameters[15].Value = model.CreateTime;
            parameters[16].Value = model.ModifyId;
            parameters[17].Value = model.ModifyBy;
            parameters[18].Value = model.ModifyTime;

            object obj = DbHelperSQLite.GetSingle(strSql.ToString(), parameters);

            if (obj == null)
            {
                return(0);
            }
            else
            {
                return(Convert.ToInt32(obj));
            }
        }
示例#24
0
        /// <summary>
        /// 增加一条数据
        /// </summary>
        public int Add(JC.Model.posts model)
        {
            StringBuilder strSql = new StringBuilder();

            strSql.Append("insert into posts(");
            strSql.Append("typeid,title,keywords,description,content,titleen,keywordsen,descriptionen,contenten,pic,piclist,hit,postby,enable,postdate,modifydate,top,hot,intro,read,blank,orderby,tag,ext,ext1,ext2,ext3,ext4,ext5,ext6,ext7,ext8,ext9,ext10,ext11,ext12,ext13,ext14,ext15,ext16,ext17,ext18,ext19,ext20,ext21,ext22,ext23,ext24,ext25,ext26,ext27,ext28,ext29,ext30)");
            strSql.Append(" values (");
            strSql.Append("@typeid,@title,@keywords,@description,@content,@titleen,@keywordsen,@descriptionen,@contenten,@pic,@piclist,@hit,@postby,@enable,@postdate,@modifydate,@top,@hot,@intro,@read,@blank,@orderby,@tag,@ext,@ext1,@ext2,@ext3,@ext4,@ext5,@ext6,@ext7,@ext8,@ext9,@ext10,@ext11,@ext12,@ext13,@ext14,@ext15,@ext16,@ext17,@ext18,@ext19,@ext20,@ext21,@ext22,@ext23,@ext24,@ext25,@ext26,@ext27,@ext28,@ext29,@ext30)");
            strSql.Append(";select LAST_INSERT_ROWID()");
            SQLiteParameter[] parameters =
            {
                new SQLiteParameter("@typeid",        DbType.Int32,     8),
                new SQLiteParameter("@title",         DbType.String),
                new SQLiteParameter("@keywords",      DbType.String),
                new SQLiteParameter("@description",   DbType.String),
                new SQLiteParameter("@content",       DbType.String),
                new SQLiteParameter("@titleen",       DbType.String),
                new SQLiteParameter("@keywordsen",    DbType.String),
                new SQLiteParameter("@descriptionen", DbType.String),
                new SQLiteParameter("@contenten",     DbType.String),
                new SQLiteParameter("@pic",           DbType.String),
                new SQLiteParameter("@piclist",       DbType.String),
                new SQLiteParameter("@hit",           DbType.Int32,     8),
                new SQLiteParameter("@postby",        DbType.String),
                new SQLiteParameter("@enable",        DbType.Int32,     8),
                new SQLiteParameter("@postdate",      DbType.DateTime),
                new SQLiteParameter("@modifydate",    DbType.DateTime),
                new SQLiteParameter("@top",           DbType.Int32,     8),
                new SQLiteParameter("@hot",           DbType.Int32,     8),
                new SQLiteParameter("@intro",         DbType.Int32,     8),
                new SQLiteParameter("@read",          DbType.Int32,     8),
                new SQLiteParameter("@blank",         DbType.Int32,     8),
                new SQLiteParameter("@orderby",       DbType.Int32,     8),
                new SQLiteParameter("@tag",           DbType.String),
                new SQLiteParameter("@ext",           DbType.String),
                new SQLiteParameter("@ext1",          DbType.String),
                new SQLiteParameter("@ext2",          DbType.String),
                new SQLiteParameter("@ext3",          DbType.String),
                new SQLiteParameter("@ext4",          DbType.String),
                new SQLiteParameter("@ext5",          DbType.String),
                new SQLiteParameter("@ext6",          DbType.String),
                new SQLiteParameter("@ext7",          DbType.String),
                new SQLiteParameter("@ext8",          DbType.String),
                new SQLiteParameter("@ext9",          DbType.String),
                new SQLiteParameter("@ext10",         DbType.String),
                new SQLiteParameter("@ext11",         DbType.String),
                new SQLiteParameter("@ext12",         DbType.String),
                new SQLiteParameter("@ext13",         DbType.String),
                new SQLiteParameter("@ext14",         DbType.String),
                new SQLiteParameter("@ext15",         DbType.String),
                new SQLiteParameter("@ext16",         DbType.String),
                new SQLiteParameter("@ext17",         DbType.String),
                new SQLiteParameter("@ext18",         DbType.String),
                new SQLiteParameter("@ext19",         DbType.String),
                new SQLiteParameter("@ext20",         DbType.String),
                new SQLiteParameter("@ext21",         DbType.String),
                new SQLiteParameter("@ext22",         DbType.String),
                new SQLiteParameter("@ext23",         DbType.String),
                new SQLiteParameter("@ext24",         DbType.String),
                new SQLiteParameter("@ext25",         DbType.String),
                new SQLiteParameter("@ext26",         DbType.String),
                new SQLiteParameter("@ext27",         DbType.String),
                new SQLiteParameter("@ext28",         DbType.String),
                new SQLiteParameter("@ext29",         DbType.String),
                new SQLiteParameter("@ext30",         DbType.String)
            };
            parameters[0].Value  = model.typeid;
            parameters[1].Value  = model.title;
            parameters[2].Value  = model.keywords;
            parameters[3].Value  = model.description;
            parameters[4].Value  = model.content;
            parameters[5].Value  = model.titleen;
            parameters[6].Value  = model.keywordsen;
            parameters[7].Value  = model.descriptionen;
            parameters[8].Value  = model.contenten;
            parameters[9].Value  = model.pic;
            parameters[10].Value = model.piclist;
            parameters[11].Value = model.hit;
            parameters[12].Value = model.postby;
            parameters[13].Value = model.enable;
            parameters[14].Value = model.postdate;
            parameters[15].Value = model.modifydate;
            parameters[16].Value = model.top;
            parameters[17].Value = model.hot;
            parameters[18].Value = model.intro;
            parameters[19].Value = model.read;
            parameters[20].Value = model.blank;
            parameters[21].Value = model.orderby;
            parameters[22].Value = model.tag;
            parameters[23].Value = model.ext;
            parameters[24].Value = model.ext1;
            parameters[25].Value = model.ext2;
            parameters[26].Value = model.ext3;
            parameters[27].Value = model.ext4;
            parameters[28].Value = model.ext5;
            parameters[29].Value = model.ext6;
            parameters[30].Value = model.ext7;
            parameters[31].Value = model.ext8;
            parameters[32].Value = model.ext9;
            parameters[33].Value = model.ext10;
            parameters[34].Value = model.ext11;
            parameters[35].Value = model.ext12;
            parameters[36].Value = model.ext13;
            parameters[37].Value = model.ext14;
            parameters[38].Value = model.ext15;
            parameters[39].Value = model.ext16;
            parameters[40].Value = model.ext17;
            parameters[41].Value = model.ext18;
            parameters[42].Value = model.ext19;
            parameters[43].Value = model.ext20;
            parameters[44].Value = model.ext21;
            parameters[45].Value = model.ext22;
            parameters[46].Value = model.ext23;
            parameters[47].Value = model.ext24;
            parameters[48].Value = model.ext25;
            parameters[49].Value = model.ext26;
            parameters[50].Value = model.ext27;
            parameters[51].Value = model.ext28;
            parameters[52].Value = model.ext29;
            parameters[53].Value = model.ext30;

            object obj = DbHelperSQLite.GetSingle(strSql.ToString(), parameters);

            if (obj == null)
            {
                return(0);
            }
            else
            {
                return(Convert.ToInt32(obj));
            }
        }
示例#25
0
        /// <summary>
        /// 增加一条数据
        /// </summary>
        public int Add(JC.Model.sites model)
        {
            StringBuilder strSql = new StringBuilder();

            strSql.Append("insert into sites(");
            strSql.Append("url,logo,icon,lang,langcode,title,keywords,description,titleen,keywordsen,descriptionen,company,freetele,beiancode,sitetrack,mail,mailpwd,mailsmtp,mailport,nopic,picmaxlength,contact,logday,ext1,ext2,ext3,ext4,ext5,ext6,ext7,ext8,ext9,ext10)");
            strSql.Append(" values (");
            strSql.Append("@url,@logo,@icon,@lang,@langcode,@title,@keywords,@description,@titleen,@keywordsen,@descriptionen,@company,@freetele,@beiancode,@sitetrack,@mail,@mailpwd,@mailsmtp,@mailport,@nopic,@picmaxlength,@contact,@logday,@ext1,@ext2,@ext3,@ext4,@ext5,@ext6,@ext7,@ext8,@ext9,@ext10)");
            strSql.Append(";select LAST_INSERT_ROWID()");
            SQLiteParameter[] parameters =
            {
                new SQLiteParameter("@url",           DbType.String),
                new SQLiteParameter("@logo",          DbType.String),
                new SQLiteParameter("@icon",          DbType.String),
                new SQLiteParameter("@lang",          DbType.String),
                new SQLiteParameter("@langcode",      DbType.String),
                new SQLiteParameter("@title",         DbType.String),
                new SQLiteParameter("@keywords",      DbType.String),
                new SQLiteParameter("@description",   DbType.String),
                new SQLiteParameter("@titleen",       DbType.String),
                new SQLiteParameter("@keywordsen",    DbType.String),
                new SQLiteParameter("@descriptionen", DbType.String),
                new SQLiteParameter("@company",       DbType.String),
                new SQLiteParameter("@freetele",      DbType.String),
                new SQLiteParameter("@beiancode",     DbType.String),
                new SQLiteParameter("@sitetrack",     DbType.String),
                new SQLiteParameter("@mail",          DbType.String),
                new SQLiteParameter("@mailpwd",       DbType.String),
                new SQLiteParameter("@mailsmtp",      DbType.String),
                new SQLiteParameter("@mailport",      DbType.Int32,   8),
                new SQLiteParameter("@nopic",         DbType.String),
                new SQLiteParameter("@picmaxlength",  DbType.Int32,   8),
                new SQLiteParameter("@contact",       DbType.String),
                new SQLiteParameter("@logday",        DbType.Int32,   8),
                new SQLiteParameter("@ext1",          DbType.String),
                new SQLiteParameter("@ext2",          DbType.String),
                new SQLiteParameter("@ext3",          DbType.String),
                new SQLiteParameter("@ext4",          DbType.String),
                new SQLiteParameter("@ext5",          DbType.String),
                new SQLiteParameter("@ext6",          DbType.String),
                new SQLiteParameter("@ext7",          DbType.String),
                new SQLiteParameter("@ext8",          DbType.String),
                new SQLiteParameter("@ext9",          DbType.String),
                new SQLiteParameter("@ext10",         DbType.String)
            };
            parameters[0].Value  = model.url;
            parameters[1].Value  = model.logo;
            parameters[2].Value  = model.icon;
            parameters[3].Value  = model.lang;
            parameters[4].Value  = model.langcode;
            parameters[5].Value  = model.title;
            parameters[6].Value  = model.keywords;
            parameters[7].Value  = model.description;
            parameters[8].Value  = model.titleen;
            parameters[9].Value  = model.keywordsen;
            parameters[10].Value = model.descriptionen;
            parameters[11].Value = model.company;
            parameters[12].Value = model.freetele;
            parameters[13].Value = model.beiancode;
            parameters[14].Value = model.sitetrack;
            parameters[15].Value = model.mail;
            parameters[16].Value = model.mailpwd;
            parameters[17].Value = model.mailsmtp;
            parameters[18].Value = model.mailport;
            parameters[19].Value = model.nopic;
            parameters[20].Value = model.picmaxlength;
            parameters[21].Value = model.contact;
            parameters[22].Value = model.logday;
            parameters[23].Value = model.ext1;
            parameters[24].Value = model.ext2;
            parameters[25].Value = model.ext3;
            parameters[26].Value = model.ext4;
            parameters[27].Value = model.ext5;
            parameters[28].Value = model.ext6;
            parameters[29].Value = model.ext7;
            parameters[30].Value = model.ext8;
            parameters[31].Value = model.ext9;
            parameters[32].Value = model.ext10;

            object obj = DbHelperSQLite.GetSingle(strSql.ToString(), parameters);

            if (obj == null)
            {
                return(0);
            }
            else
            {
                return(Convert.ToInt32(obj));
            }
        }
示例#26
0
        /// <summary>
        /// 增加一条数据
        /// </summary>
        public int Add(DXD.Model.business_feedback model)
        {
            StringBuilder strSql = new StringBuilder();

            strSql.Append("insert into business_feedback(");
            strSql.Append("query_id,bus_name,scope,reg_no,bus_type,reg_capital,subscribe,proportion,status,paid_in," +
                          "found_date,lost_date,office,remark,is_hidden,is_match,add_user,add_time)");
            strSql.Append(" values (");
            strSql.Append("@query_id,@bus_name,@scope,@reg_no,@bus_type,@reg_capital,@subscribe,@proportion,@status," +
                          "@paid_in,@found_date,@lost_date,@office,@remark,@is_hidden,@is_match,@add_user,@add_time)");
            strSql.Append(";select LAST_INSERT_ROWID()");
            SQLiteParameter[] parameters =
            {
                new SQLiteParameter("@query_id",    DbType.Int32,       8),
                new SQLiteParameter("@bus_name",    DbType.String,    255),
                new SQLiteParameter("@scope",       DbType.String),
                new SQLiteParameter("@reg_no",      DbType.String,     50),
                new SQLiteParameter("@bus_type",    DbType.String,     50),
                new SQLiteParameter("@reg_capital", DbType.Decimal,     4),
                new SQLiteParameter("@subscribe",   DbType.Decimal,     4),
                new SQLiteParameter("@proportion",  DbType.Decimal,     4),
                new SQLiteParameter("@status",      DbType.String,     10),
                new SQLiteParameter("@paid_in",     DbType.Decimal,     4),
                new SQLiteParameter("@found_date",  DbType.DateTime),
                new SQLiteParameter("@lost_date",   DbType.DateTime),
                new SQLiteParameter("@office",      DbType.String,     50),
                new SQLiteParameter("@remark",      DbType.String,    255),
                new SQLiteParameter("@is_hidden",   DbType.Boolean),
                new SQLiteParameter("@is_match",    DbType.Boolean),
                new SQLiteParameter("@add_user",    DbType.String,     50),
                new SQLiteParameter("@add_time",    DbType.DateTime)
            };
            parameters[0].Value  = model.query_id;
            parameters[1].Value  = model.bus_name;
            parameters[2].Value  = model.scope;
            parameters[3].Value  = model.reg_no;
            parameters[4].Value  = model.bus_type;
            parameters[5].Value  = model.reg_capital;
            parameters[6].Value  = model.subscribe;
            parameters[7].Value  = model.proportion;
            parameters[8].Value  = model.status;
            parameters[9].Value  = model.paid_in;
            parameters[10].Value = model.found_date;
            parameters[11].Value = model.lost_date;
            parameters[12].Value = model.office;
            parameters[13].Value = model.remark;
            parameters[14].Value = model.is_hidden;
            parameters[15].Value = model.is_match;
            parameters[16].Value = model.add_user;
            parameters[17].Value = model.add_time;

            object obj = DbHelperSQLite.GetSingle(strSql.ToString(), parameters);

            if (obj == null)
            {
                return(0);
            }
            else
            {
                return(Convert.ToInt32(obj));
            }
        }
示例#27
0
        /// <summary>
        /// 增加一条数据
        /// </summary>
        public int Add(WebSiteModel.WebSite model)
        {
            StringBuilder strSql = new StringBuilder();

            strSql.Append("insert into WebSite(");
            strSql.Append("WebSiteName,WebStatusID,PartnerID,WebSiteType,Background,BrandsID,Template,TemplatePic,Language,Owner,Server,IPAddress,Payment,Iseffective,ProgramsType,SortIndex,Ishidden,AddDate,OfflineDate,Remark)");
            strSql.Append(" values (");
            strSql.Append("@WebSiteName,@WebStatusID,@PartnerID,@WebSiteType,@Background,@BrandsID,@Template,@TemplatePic,@Language,@Owner,@Server,@IPAddress,@Payment,@Iseffective,@ProgramsType,@SortIndex,@Ishidden,@AddDate,@OfflineDate,@Remark)");
            strSql.Append(";select LAST_INSERT_ROWID()");
            SQLiteParameter[] parameters =
            {
                new SQLiteParameter("@WebSiteName",  DbType.String),
                new SQLiteParameter("@WebStatusID",  DbType.Int32,     8),
                new SQLiteParameter("@PartnerID",    DbType.Int32,     8),
                new SQLiteParameter("@WebSiteType",  DbType.String),
                new SQLiteParameter("@Background",   DbType.String),
                new SQLiteParameter("@BrandsID",     DbType.Int32,     8),
                new SQLiteParameter("@Template",     DbType.String),
                new SQLiteParameter("@TemplatePic",  DbType.String),
                new SQLiteParameter("@Language",     DbType.String),
                new SQLiteParameter("@Owner",        DbType.Int32,     8),
                new SQLiteParameter("@Server",       DbType.String),
                new SQLiteParameter("@IPAddress",    DbType.String),
                new SQLiteParameter("@Payment",      DbType.String),
                new SQLiteParameter("@Iseffective",  DbType.Int32,     8),
                new SQLiteParameter("@ProgramsType", DbType.String),
                new SQLiteParameter("@SortIndex",    DbType.Int32,     8),
                new SQLiteParameter("@Ishidden",     DbType.Int32,     8),
                new SQLiteParameter("@AddDate",      DbType.DateTime),
                new SQLiteParameter("@OfflineDate",  DbType.DateTime),
                new SQLiteParameter("@Remark",       DbType.String)
            };
            parameters[0].Value  = model.WebSiteName;
            parameters[1].Value  = model.WebStatusID;
            parameters[2].Value  = model.PartnerID;
            parameters[3].Value  = model.WebSiteType;
            parameters[4].Value  = model.Background;
            parameters[5].Value  = model.BrandsID;
            parameters[6].Value  = model.Template;
            parameters[7].Value  = model.TemplatePic;
            parameters[8].Value  = model.Language;
            parameters[9].Value  = model.Owner;
            parameters[10].Value = model.Server;
            parameters[11].Value = model.IPAddress;
            parameters[12].Value = model.Payment;
            parameters[13].Value = model.Iseffective;
            parameters[14].Value = model.ProgramsType;
            parameters[15].Value = model.SortIndex;
            parameters[16].Value = model.Ishidden;
            parameters[17].Value = model.AddDate;
            parameters[18].Value = model.OfflineDate;
            parameters[19].Value = model.Remark;

            object obj = DbHelperSQLite.GetSingle(strSql.ToString(), parameters);

            if (obj == null)
            {
                return(0);
            }
            else
            {
                return(Convert.ToInt32(obj));
            }
        }