Ejemplo n.º 1
0
        public static void Update(LinkModel model)
        {
            StringBuilder strSql = new StringBuilder();

            strSql.Append("update odnshop_link set ");
            strSql.Append("linkname=?linkname,");
            strSql.Append("linkurl=?linkurl,");
            strSql.Append("includepic=?includepic,");
            strSql.Append("possymbol=?possymbol,");
            strSql.Append("createtime=?createtime,");
            strSql.Append("orderno=?orderno");
            strSql.Append(" where linkid=?linkid");

            MySqlParameter[] parameters =
            {
                new MySqlParameter("?linkname",   MySqlDbType.VarChar,    45),
                new MySqlParameter("?linkurl",    MySqlDbType.VarChar,   200),
                new MySqlParameter("?includepic", MySqlDbType.VarChar,   200),
                new MySqlParameter("?possymbol",  MySqlDbType.VarChar,    45),
                new MySqlParameter("?createtime", MySqlDbType.Datetime),
                new MySqlParameter("?orderno",    MySqlDbType.Int32,      11),
                new MySqlParameter("?linkid",     MySqlDbType.Int32, 11)
            };

            parameters[0].Value = model.linkname;
            parameters[1].Value = model.linkurl;
            parameters[2].Value = model.includepic;
            parameters[3].Value = model.possymbol;
            parameters[4].Value = model.createtime;
            parameters[5].Value = model.orderno;
            parameters[6].Value = model.linkid;

            MySqlDbHelper.ExecuteSql(strSql.ToString(), parameters);
        }
Ejemplo n.º 2
0
        public static void Add(LinkModel model)
        {
            StringBuilder strSql = new StringBuilder();

            strSql.Append("insert into odnshop_link(");
            strSql.Append("linkname,linkurl,includepic,possymbol,createtime,orderno)");
            strSql.Append(" values (");
            strSql.Append("?linkname,?linkurl,?includepic,?possymbol,?createtime,?orderno)");

            MySqlParameter[] parameters =
            {
                new MySqlParameter("?linkname",   MySqlDbType.VarChar,    45),
                new MySqlParameter("?linkurl",    MySqlDbType.VarChar,   200),
                new MySqlParameter("?includepic", MySqlDbType.VarChar,   200),
                new MySqlParameter("?possymbol",  MySqlDbType.VarChar,    45),
                new MySqlParameter("?createtime", MySqlDbType.Datetime),
                new MySqlParameter("?orderno",    MySqlDbType.Int32, 11)
            };

            parameters[0].Value = model.linkname;
            parameters[1].Value = model.linkurl;
            parameters[2].Value = model.includepic;
            parameters[3].Value = model.possymbol;
            parameters[4].Value = model.createtime;
            parameters[5].Value = model.orderno;

            MySqlDbHelper.ExecuteSql(strSql.ToString(), parameters);
        }
Ejemplo n.º 3
0
        public static void Add(UserGroupModel model)
        {
            string sql = "INSERT INTO odnshop_usergroup(groupid,groupname,picurl,grouplevel,isdefalut,upgradejf,discount) VALUES(?groupid,?groupname,?picurl,?grouplevel,?isdefalut,?upgradejf,?discount)";

            MySqlParameter[] parameters =
            {
                new MySqlParameter("?groupid",    MySqlDbType.Int32,   11),
                new MySqlParameter("?groupname",  MySqlDbType.VarChar, 50),
                new MySqlParameter("?picurl",     MySqlDbType.VarChar, 50),
                new MySqlParameter("?grouplevel", MySqlDbType.Int32,   11),
                new MySqlParameter("?isdefalut",  MySqlDbType.Int32),
                new MySqlParameter("?upgradejf",  MySqlDbType.Int32,   11),
                new MySqlParameter("?discount",   MySqlDbType.Int32, 11)
            };

            parameters[0].Value = model.groupid;
            parameters[1].Value = model.groupname;
            parameters[2].Value = model.picurl;
            parameters[3].Value = model.grouplevel;
            parameters[4].Value = model.isdefalut?1:0;
            parameters[5].Value = model.upgradejf;
            parameters[5].Value = model.discount;

            MySqlDbHelper.ExecuteSql(sql, parameters);
        }
Ejemplo n.º 4
0
        public static void Update(AdminModel model)
        {
            StringBuilder strSql = new StringBuilder();

            strSql.Append("update odnshop_admin set ");
            strSql.Append("username=?username,");
            strSql.Append("userpwd=?userpwd,");
            strSql.Append("email=?email,");
            strSql.Append("tel=?tel,");
            strSql.Append("usertype=?usertype,");
            strSql.Append("lastlogindate=?lastlogindate,");
            strSql.Append("createdate=?createdate,");
            strSql.Append("lastloginip=?lastloginip,");
            strSql.Append("logincount=?logincount,");
            strSql.Append("adminqx=?adminqx");
            strSql.Append(" where adminid=?adminid ");

            MySqlParameter[] parameters =
            {
                new MySqlParameter("?username",      MySqlDbType.VarChar,     45),
                new MySqlParameter("?userpwd",       MySqlDbType.VarChar,     45),
                new MySqlParameter("?email",         MySqlDbType.VarChar,     45),
                new MySqlParameter("?tel",           MySqlDbType.VarChar,     45),
                new MySqlParameter("?usertype",      MySqlDbType.Int16,        4),
                new MySqlParameter("?lastlogindate", MySqlDbType.Datetime),
                new MySqlParameter("?createdate",    MySqlDbType.Datetime),
                new MySqlParameter("?lastloginip",   MySqlDbType.VarChar,     45),
                new MySqlParameter("?logincount",    MySqlDbType.Int32,       11),
                new MySqlParameter("?adminqx",       MySqlDbType.MediumText),
                new MySqlParameter("?adminid",       MySqlDbType.Int32, 11)
            };

            parameters[0].Value  = model.username;
            parameters[1].Value  = model.userpwd;
            parameters[2].Value  = model.email;
            parameters[3].Value  = model.tel;
            parameters[4].Value  = model.usertype;
            parameters[5].Value  = model.lastlogindate;
            parameters[6].Value  = model.createdate;
            parameters[7].Value  = model.lastloginip;
            parameters[8].Value  = model.logincount;
            parameters[9].Value  = model.adminqx;
            parameters[10].Value = model.adminid;


            MySqlDbHelper.ExecuteSql(strSql.ToString(), parameters);
        }
Ejemplo n.º 5
0
        public static void Add(SinglePageModel model)
        {
            string sql = @"INSERT INTO odnshop_singlepage(serialno ,title ,content) VALUES (?serialno,?title,?content)";

            MySqlParameter[] parameters =
            {
                new MySqlParameter("?serialno", MySqlDbType.VarChar,  45),
                new MySqlParameter("?title",    MySqlDbType.VarChar, 200),
                new MySqlParameter("?content",  MySqlDbType.Text)
            };

            parameters[0].Value = model.serialno;
            parameters[1].Value = model.title;
            parameters[2].Value = model.content;

            MySqlDbHelper.ExecuteSql(sql, parameters);
        }
Ejemplo n.º 6
0
        public static void Update(SinglePageModel model)
        {
            string sql = @"update odnshop_singlepage set 
                            serialno = ?serialno,
                            title = ?title,
                            content = ?content where pageid = ?pageid";

            MySqlParameter[] parameters =
            {
                new MySqlParameter("?serialno", MySqlDbType.VarChar,  45),
                new MySqlParameter("?title",    MySqlDbType.VarChar, 200),
                new MySqlParameter("?content",  MySqlDbType.Text),
                new MySqlParameter("?pageid",   MySqlDbType.Int32, 11)
            };
            parameters[0].Value = model.serialno;
            parameters[1].Value = model.title;
            parameters[2].Value = model.content;
            parameters[3].Value = model.pageid;

            MySqlDbHelper.ExecuteSql(sql, parameters);
        }
Ejemplo n.º 7
0
        public static void Delete(int linkid)
        {
            string sql = "delete from odnshop_link where linkid=" + linkid;

            MySqlDbHelper.ExecuteSql(sql);
        }
Ejemplo n.º 8
0
        public static void Delete(int uid)
        {
            string sql = "delete from odnshop_user where uid=" + uid.ToString();

            MySqlDbHelper.ExecuteSql(sql);
        }
Ejemplo n.º 9
0
        public static void Delete(int categoryid)
        {
            string sql = "delete from odnshop_productcategory where categoryid = " + categoryid;

            MySqlDbHelper.ExecuteSql(sql);
        }
Ejemplo n.º 10
0
        public static void UpdateHits(int productid)
        {
            string sql = "UPDATE odnshop_product set hits=hits+1 where productid=" + productid;

            MySqlDbHelper.ExecuteSql(sql);
        }
Ejemplo n.º 11
0
        public static void Delete(int productid)
        {
            string sql = "delete from odnshop_product where productid=" + productid;

            MySqlDbHelper.ExecuteSql(sql);
        }
Ejemplo n.º 12
0
        public static void Delete(int fid)
        {
            string sql = "delete from odnshop_favorite where fid=" + fid;

            MySqlDbHelper.ExecuteSql(sql);
        }
Ejemplo n.º 13
0
        public static void Delete(int pageid)
        {
            string sql = "delete from odnshop_singlepage where pageid=" + pageid;

            MySqlDbHelper.ExecuteSql(sql);
        }
Ejemplo n.º 14
0
        public static void Delete(int adminid)
        {
            string sql = "delete from odnshop_admin where adminid=" + adminid.ToString();

            MySqlDbHelper.ExecuteSql(sql);
        }