/// <summary> /// ����һ������ /// </summary> public int Add(wgiAdUnionSystem.Model.wgi_orders model) { StringBuilder strSql=new StringBuilder(); strSql.Append("insert into wgi_orders("); strSql.Append("companyid,siteid,userid,orderno,cash,time,consumer,itemno,itemprice,itemamount,pay,ischeck,reason,checktime)"); strSql.Append(" values ("); strSql.Append("@companyid,@siteid,@userid,@orderno,@cash,@time,@consumer,@itemno,@itemprice,@itemamount,@pay,@ischeck,@reason,@checktime)"); strSql.Append(";select @@IDENTITY"); Database db = DatabaseFactory.CreateDatabase(); DbCommand dbCommand = db.GetSqlStringCommand(strSql.ToString()); db.AddInParameter(dbCommand, "companyid", DbType.Int32, model.companyid); db.AddInParameter(dbCommand, "siteid", DbType.Int32, model.siteid); db.AddInParameter(dbCommand, "userid", DbType.Int32, model.userid); db.AddInParameter(dbCommand, "orderno", DbType.String, model.orderno); db.AddInParameter(dbCommand, "cash", DbType.Decimal, model.cash); db.AddInParameter(dbCommand, "time", DbType.DateTime, model.time); db.AddInParameter(dbCommand, "consumer", DbType.String, model.consumer); db.AddInParameter(dbCommand, "itemno", DbType.String, model.itemno); db.AddInParameter(dbCommand, "itemprice", DbType.Decimal, model.itemprice); db.AddInParameter(dbCommand, "itemamount", DbType.Decimal, model.itemamount); db.AddInParameter(dbCommand, "pay", DbType.Decimal, model.pay); db.AddInParameter(dbCommand, "ischeck", DbType.Int32, model.ischeck); db.AddInParameter(dbCommand, "reason", DbType.String, model.reason); db.AddInParameter(dbCommand, "checktime", DbType.DateTime, model.checktime); int result; object obj = db.ExecuteScalar(dbCommand); if(!int.TryParse(obj.ToString(),out result)) { return 0; } return result; }
/// <summary> /// ����һ������ /// </summary> public int Add(wgiAdUnionSystem.Model.wgi_notice model) { StringBuilder strSql = new StringBuilder(); strSql.Append("insert into wgi_notice("); strSql.Append("title,notice,pubdate,unread,publisher,objid, objtype)"); strSql.Append(" values ("); strSql.Append("@title,@notice,@pubdate,@unread,@publisher,@objid,@objtype)"); 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, "notice", DbType.String, model.notice); db.AddInParameter(dbCommand, "pubdate", DbType.DateTime, model.pubdate); db.AddInParameter(dbCommand, "unread", DbType.Int32, model.unread); db.AddInParameter(dbCommand, "publisher", DbType.Int32, model.publisher); db.AddInParameter(dbCommand, "objid", DbType.Int32, model.objid); db.AddInParameter(dbCommand, "objtype", DbType.Int32, model.objtype); int result; object obj = db.ExecuteScalar(dbCommand); if (!int.TryParse(obj.ToString(), out result)) { return 0; } return result; }
/// <summary> /// ����һ������ /// </summary> public int Add(wgiAdUnionSystem.Model.wgi_adv model) { StringBuilder strSql=new StringBuilder(); strSql.Append("insert into wgi_adv("); strSql.Append("companyid,advname,advtype,advcont,advlink,advwidth,advheight,advuptime,advstatus,advstart,advend,advinvalid,advpaytype)"); strSql.Append(" values ("); strSql.Append("@companyid,@advname,@advtype,@advcont,@advlink,@advwidth,@advheight,@advuptime,@advstatus,@advstart,@advend,@advinvalid,@advpaytype)"); strSql.Append(";select @@IDENTITY"); Database db = DatabaseFactory.CreateDatabase(); DbCommand dbCommand = db.GetSqlStringCommand(strSql.ToString()); db.AddInParameter(dbCommand, "companyid", DbType.Int32, model.companyid); db.AddInParameter(dbCommand, "advname", DbType.String, model.advname); db.AddInParameter(dbCommand, "advtype", DbType.Int32, model.advtype); db.AddInParameter(dbCommand, "advcont", DbType.String, model.advcont); db.AddInParameter(dbCommand, "advlink", DbType.String, model.advlink); db.AddInParameter(dbCommand, "advwidth", DbType.Int32, model.advwidth); db.AddInParameter(dbCommand, "advheight", DbType.Int32, model.advheight); db.AddInParameter(dbCommand, "advuptime", DbType.DateTime, model.advuptime); db.AddInParameter(dbCommand, "advstatus", DbType.Int32, model.advstatus); db.AddInParameter(dbCommand, "advstart", DbType.DateTime, model.advstart); db.AddInParameter(dbCommand, "advend", DbType.DateTime, model.advend); db.AddInParameter(dbCommand, "advinvalid", DbType.Int32, model.advinvalid); db.AddInParameter(dbCommand, "advpaytype", DbType.Int32, model.advpaytype); int result; object obj = db.ExecuteScalar(dbCommand); if(!int.TryParse(obj.ToString(),out result)) { return 0; } return result; }
/// <summary> /// ����һ������ /// </summary> public int Add(wgiAdUnionSystem.Model.wgi_mysite model) { StringBuilder strSql=new StringBuilder(); strSql.Append("insert into wgi_mysite("); strSql.Append("userid,sitename,url,siteremark,ipno,pvno,sitetype)"); strSql.Append(" values ("); strSql.Append("@userid,@sitename,@url,@siteremark,@ipno,@pvno,@sitetype)"); strSql.Append(";select @@IDENTITY"); Database db = DatabaseFactory.CreateDatabase(); DbCommand dbCommand = db.GetSqlStringCommand(strSql.ToString()); db.AddInParameter(dbCommand, "userid", DbType.Int32, model.userid); db.AddInParameter(dbCommand, "sitename", DbType.String, model.sitename); db.AddInParameter(dbCommand, "url", DbType.String, model.url); db.AddInParameter(dbCommand, "siteremark", DbType.String, model.siteremark); db.AddInParameter(dbCommand, "ipno", DbType.Int32, model.ipno); db.AddInParameter(dbCommand, "pvno", DbType.Int32, model.pvno); db.AddInParameter(dbCommand, "sitetype", DbType.Int32, model.sitetype); int result; object obj = db.ExecuteScalar(dbCommand); if(!int.TryParse(obj.ToString(),out result)) { return 0; } return result; }
/// <summary> /// ����һ������ /// </summary> public int Add(wgiAdUnionSystem.Model.wgi_lostorder model) { StringBuilder strSql=new StringBuilder(); strSql.Append("insert into wgi_lostorder("); strSql.Append("companyid,userid,orderno,adhostname,buytime,itemno,consumer,applyreason,applytime,lostreason,result,status)"); strSql.Append(" values ("); strSql.Append("@companyid,@userid,@orderno,@adhostname,@buytime,@itemno,@consumer,@applyreason,@applytime,@lostreason,@result,@status)"); strSql.Append(";select @@IDENTITY"); Database db = DatabaseFactory.CreateDatabase(); DbCommand dbCommand = db.GetSqlStringCommand(strSql.ToString()); db.AddInParameter(dbCommand, "companyid", DbType.Int32, model.companyid); db.AddInParameter(dbCommand, "userid", DbType.Int32, model.userid); db.AddInParameter(dbCommand, "orderno", DbType.String, model.orderno); db.AddInParameter(dbCommand, "adhostname", DbType.String, model.adhostname); db.AddInParameter(dbCommand, "buytime", DbType.DateTime, model.buytime); db.AddInParameter(dbCommand, "itemno", DbType.String, model.itemno); db.AddInParameter(dbCommand, "consumer", DbType.String, model.consumer); db.AddInParameter(dbCommand, "applyreason", DbType.String, model.applyreason); db.AddInParameter(dbCommand, "applytime", DbType.DateTime, model.applytime); db.AddInParameter(dbCommand, "lostreason", DbType.String, model.lostreason); db.AddInParameter(dbCommand, "result", DbType.String, model.result); db.AddInParameter(dbCommand, "status", DbType.Int32, model.status); int result; object obj = db.ExecuteScalar(dbCommand); if(!int.TryParse(obj.ToString(),out result)) { return 0; } return result; }
/// <summary> /// ����һ������ /// </summary> public int Add(wgiAdUnionSystem.Model.wgi_cash model) { StringBuilder strSql=new StringBuilder(); strSql.Append("insert into wgi_cash("); strSql.Append("userid,cash,applydate,status,leftcash,memo_user,memo_admin)"); strSql.Append(" values ("); strSql.Append("@userid,@cash,@applydate,@status,@leftcash,@memo_user,@memo_admin)"); strSql.Append(";select @@IDENTITY"); Database db = DatabaseFactory.CreateDatabase(); DbCommand dbCommand = db.GetSqlStringCommand(strSql.ToString()); db.AddInParameter(dbCommand, "userid", DbType.Int32, model.userid); db.AddInParameter(dbCommand, "cash", DbType.Decimal, model.cash); db.AddInParameter(dbCommand, "applydate", DbType.DateTime, model.applydate); db.AddInParameter(dbCommand, "status", DbType.Int32, model.status); db.AddInParameter(dbCommand, "leftcash", DbType.Decimal, model.leftcash); db.AddInParameter(dbCommand, "memo_user", DbType.String, model.memo_user); db.AddInParameter(dbCommand, "memo_admin", DbType.String, model.memo_admin); int result; object obj = db.ExecuteScalar(dbCommand); if(!int.TryParse(obj.ToString(),out result)) { return 0; } return result; }
/// <summary> /// ����һ������ /// </summary> public int Add(wgiAdUnionSystem.Model.wgi_adhost model) { StringBuilder strSql = new StringBuilder(); strSql.Append("insert into wgi_adhost("); strSql.Append("status,username,password,email,company,contact,tel,qq,mobile,fax,address,zipcode,url,intro,user_type,owner,licence,icp,industryid,sitename,cookiepage,remark,return_day,return_type,valid_day,regdate,regip,lastdate,lastip,balance,ischeck)"); strSql.Append(" values ("); strSql.Append("@status,@username,@password,@email,@company,@contact,@tel,@qq,@mobile,@fax,@address,@zipcode,@url,@intro,@user_type,@owner,@licence,@icp,@industryid,@sitename,@cookiepage,@remark,@return_day,@return_type,@valid_day,@regdate,@regip,@lastdate,@lastip,@balance,@ischeck)"); strSql.Append(";select @@IDENTITY"); Database db = DatabaseFactory.CreateDatabase(); DbCommand dbCommand = db.GetSqlStringCommand(strSql.ToString()); db.AddInParameter(dbCommand, "status", DbType.Int32, model.status); db.AddInParameter(dbCommand, "username", DbType.String, model.username); db.AddInParameter(dbCommand, "password", DbType.String, model.password); db.AddInParameter(dbCommand, "email", DbType.String, model.email); db.AddInParameter(dbCommand, "company", DbType.String, model.company); db.AddInParameter(dbCommand, "contact", DbType.String, model.contact); db.AddInParameter(dbCommand, "tel", DbType.String, model.tel); db.AddInParameter(dbCommand, "qq", DbType.String, model.qq); db.AddInParameter(dbCommand, "mobile", DbType.String, model.mobile); db.AddInParameter(dbCommand, "fax", DbType.String, model.fax); db.AddInParameter(dbCommand, "address", DbType.String, model.address); db.AddInParameter(dbCommand, "zipcode", DbType.String, model.zipcode); db.AddInParameter(dbCommand, "url", DbType.String, model.url); db.AddInParameter(dbCommand, "intro", DbType.String, model.intro); db.AddInParameter(dbCommand, "user_type", DbType.Int32, model.user_type); db.AddInParameter(dbCommand, "owner", DbType.String, model.owner); db.AddInParameter(dbCommand, "licence", DbType.String, model.licence); db.AddInParameter(dbCommand, "icp", DbType.String, model.icp); db.AddInParameter(dbCommand, "industryid", DbType.Int32, model.industryid); db.AddInParameter(dbCommand, "sitename", DbType.String, model.sitename); db.AddInParameter(dbCommand, "cookiepage", DbType.String, model.cookiepage); db.AddInParameter(dbCommand, "remark", DbType.String, model.remark); db.AddInParameter(dbCommand, "return_day", DbType.String, model.return_day); db.AddInParameter(dbCommand, "return_type", DbType.String, model.return_type); db.AddInParameter(dbCommand, "valid_day", DbType.String, model.valid_day); db.AddInParameter(dbCommand, "regdate", DbType.DateTime, model.regdate); db.AddInParameter(dbCommand, "regip", DbType.String, model.regip); db.AddInParameter(dbCommand, "lastdate", DbType.DateTime, model.lastdate); db.AddInParameter(dbCommand, "lastip", DbType.String, model.lastip); db.AddInParameter(dbCommand, "balance", DbType.Decimal, model.balance); db.AddInParameter(dbCommand, "ischeck", DbType.Int32, model.ischeck); int result; object obj = db.ExecuteScalar(dbCommand); if (!int.TryParse(obj.ToString(), out result)) { return 0; } return result; }
/// <summary> /// ����һ������ /// </summary> public void Add(wgiAdUnionSystem.Model.wgi_ind_type model) { StringBuilder strSql=new StringBuilder(); strSql.Append("insert into wgi_ind_type("); strSql.Append("id,pid,indname)"); strSql.Append(" values ("); strSql.Append("@id,@pid,@indname)"); Database db = DatabaseFactory.CreateDatabase(); DbCommand dbCommand = db.GetSqlStringCommand(strSql.ToString()); db.AddInParameter(dbCommand, "id", DbType.Int32, model.id); db.AddInParameter(dbCommand, "pid", DbType.Int32, model.pid); db.AddInParameter(dbCommand, "indname", DbType.String, model.indname); db.ExecuteNonQuery(dbCommand); }
/// <summary> /// ����һ������ /// </summary> public void Add(wgiAdUnionSystem.Model.wgi_loginlog model) { StringBuilder strSql=new StringBuilder(); strSql.Append("insert into wgi_loginlog("); strSql.Append("usertype,logtime,logip,logname)"); strSql.Append(" values ("); strSql.Append("@usertype,@logtime,@logip,@logname)"); Database db = DatabaseFactory.CreateDatabase(); DbCommand dbCommand = db.GetSqlStringCommand(strSql.ToString()); db.AddInParameter(dbCommand, "logid", DbType.Int32, model.logid); db.AddInParameter(dbCommand, "usertype", DbType.Int32, model.usertype); db.AddInParameter(dbCommand, "logtime", DbType.DateTime, model.logtime); db.AddInParameter(dbCommand, "logip", DbType.String, model.logip); db.AddInParameter(dbCommand, "logname", DbType.String, model.logname); db.ExecuteNonQuery(dbCommand); }
/// <summary> /// ����һ������ /// </summary> public void Add(wgiAdUnionSystem.Model.wgi_noticestat model) { StringBuilder strSql = new StringBuilder(); strSql.Append("insert into wgi_noticestat("); strSql.Append("noticeid,usertype,userid,unread,deleted)"); strSql.Append(" values ("); strSql.Append("@noticeid,@usertype,@userid,@unread,@deleted)"); Database db = DatabaseFactory.CreateDatabase(); DbCommand dbCommand = db.GetSqlStringCommand(strSql.ToString()); //db.AddInParameter(dbCommand, "id", DbType.Int32, model.id); db.AddInParameter(dbCommand, "noticeid", DbType.Int32, model.noticeid); db.AddInParameter(dbCommand, "usertype", DbType.Int32, model.usertype); db.AddInParameter(dbCommand, "userid", DbType.Int32, model.userid); db.AddInParameter(dbCommand, "unread", DbType.Int32, model.unread); db.AddInParameter(dbCommand, "deleted", DbType.Int32, model.deleted); db.ExecuteNonQuery(dbCommand); }
/// <summary> /// ����һ������ /// </summary> public void Add(wgiAdUnionSystem.Model.wgi_content model) { StringBuilder strSql=new StringBuilder(); strSql.Append("insert into wgi_content("); strSql.Append("id,title,content,author,showindex,pubtime,isshow)"); strSql.Append(" values ("); strSql.Append("@id,@title,@content,@author,@showindex,@pubtime,@isshow)"); 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, "author", DbType.String, model.author); db.AddInParameter(dbCommand, "showindex", DbType.Int32, model.showindex); db.AddInParameter(dbCommand, "pubtime", DbType.DateTime, model.pubtime); db.AddInParameter(dbCommand, "isshow", DbType.Int32, model.isshow); db.ExecuteNonQuery(dbCommand); }
/// <summary> /// ����һ������ /// </summary> public int Add(wgiAdUnionSystem.Model.wgi_contcate model) { StringBuilder strSql=new StringBuilder(); strSql.Append("insert into wgi_contcate("); strSql.Append("cname)"); strSql.Append(" values ("); strSql.Append("@cname)"); strSql.Append(";select @@IDENTITY"); Database db = DatabaseFactory.CreateDatabase(); DbCommand dbCommand = db.GetSqlStringCommand(strSql.ToString()); db.AddInParameter(dbCommand, "cname", DbType.String, model.cname); int result; object obj = db.ExecuteScalar(dbCommand); if(!int.TryParse(obj.ToString(),out result)) { return 0; } return result; }
/// <summary> /// ����һ������ /// </summary> public void Add(wgiAdUnionSystem.Model.wgi_adv_statis model) { StringBuilder strSql=new StringBuilder(); strSql.Append("insert into wgi_adv_statis("); strSql.Append("companyid,userid,siteid,advid,advtype,statistype,recordtime,ip)"); strSql.Append(" values ("); strSql.Append("@companyid,@userid,@siteid,@advid,@advtype,@statistype,@recordtime,@ip)"); Database db = DatabaseFactory.CreateDatabase(); DbCommand dbCommand = db.GetSqlStringCommand(strSql.ToString()); db.AddInParameter(dbCommand, "companyid", DbType.Int32, model.companyid); db.AddInParameter(dbCommand, "userid", DbType.Int32, model.userid); db.AddInParameter(dbCommand, "siteid", DbType.Int32, model.siteid); db.AddInParameter(dbCommand, "advid", DbType.Int32, model.advid); db.AddInParameter(dbCommand, "advtype", DbType.Int32, model.advtype); db.AddInParameter(dbCommand, "statistype", DbType.Int32, model.statistype); db.AddInParameter(dbCommand, "recordtime", DbType.DateTime, model.recordtime); db.AddInParameter(dbCommand, "ip", DbType.String, model.ip); db.ExecuteNonQuery(dbCommand); }
/// <summary> /// ����һ������ /// </summary> public int Add(wgiAdUnionSystem.Model.wgi_adv_site_host model) { StringBuilder strSql=new StringBuilder(); strSql.Append("insert into wgi_adv_site_host("); strSql.Append("companyid,userid)"); strSql.Append(" values ("); strSql.Append("@companyid,@userid)"); strSql.Append(";select @@IDENTITY"); Database db = DatabaseFactory.CreateDatabase(); DbCommand dbCommand = db.GetSqlStringCommand(strSql.ToString()); db.AddInParameter(dbCommand, "companyid", DbType.Int32, model.companyid); db.AddInParameter(dbCommand, "userid", DbType.Int32, model.userid); int result; object obj = db.ExecuteScalar(dbCommand); if(!int.TryParse(obj.ToString(),out result)) { return 0; } return result; }
/// <summary> /// ����һ������ /// </summary> public int Add(wgiAdUnionSystem.Model.wgi_sitehost model) { StringBuilder strSql=new StringBuilder(); strSql.Append("insert into wgi_sitehost("); strSql.Append("username,password,email,mobile,accountname,accountno,bank,branch,usertype,contact,qq,idcard,address,zipcode,tel,balance,regdate,regip,lastdate,lastip,status)"); strSql.Append(" values ("); strSql.Append("@username,@password,@email,@mobile,@accountname,@accountno,@bank,@branch,@usertype,@contact,@qq,@idcard,@address,@zipcode,@tel,@balance,@regdate,@regip,@lastdate,@lastip,@status)"); strSql.Append(";select @@IDENTITY"); Database db = DatabaseFactory.CreateDatabase(); DbCommand dbCommand = db.GetSqlStringCommand(strSql.ToString()); db.AddInParameter(dbCommand, "username", DbType.String, model.username); db.AddInParameter(dbCommand, "password", DbType.String, model.password); db.AddInParameter(dbCommand, "email", DbType.String, model.email); db.AddInParameter(dbCommand, "mobile", DbType.String, model.mobile); db.AddInParameter(dbCommand, "accountname", DbType.String, model.accountname); db.AddInParameter(dbCommand, "accountno", DbType.String, model.accountno); db.AddInParameter(dbCommand, "bank", DbType.String, model.bank); db.AddInParameter(dbCommand, "branch", DbType.String, model.branch); db.AddInParameter(dbCommand, "usertype", DbType.Int32, model.usertype); db.AddInParameter(dbCommand, "contact", DbType.String, model.contact); db.AddInParameter(dbCommand, "qq", DbType.String, model.qq); db.AddInParameter(dbCommand, "idcard", DbType.String, model.idcard); db.AddInParameter(dbCommand, "address", DbType.String, model.address); db.AddInParameter(dbCommand, "zipcode", DbType.String, model.zipcode); db.AddInParameter(dbCommand, "tel", DbType.String, model.tel); db.AddInParameter(dbCommand, "balance", DbType.Decimal, model.balance); db.AddInParameter(dbCommand, "regdate", DbType.DateTime, model.regdate); db.AddInParameter(dbCommand, "regip", DbType.String, model.regip); db.AddInParameter(dbCommand, "lastdate", DbType.DateTime, model.lastdate); db.AddInParameter(dbCommand, "lastip", DbType.String, model.lastip); db.AddInParameter(dbCommand, "status", DbType.Int32, model.status); int result; object obj = db.ExecuteScalar(dbCommand); if(!int.TryParse(obj.ToString(),out result)) { return 0; } return result; }
/// <summary> /// ����һ������ /// </summary> public int Add(wgiAdUnionSystem.Model.wgi_sysuser model) { StringBuilder strSql=new StringBuilder(); strSql.Append("insert into wgi_sysuser("); strSql.Append("username,password,email)"); strSql.Append(" values ("); strSql.Append("@username,@password,@email)"); strSql.Append(";select @@IDENTITY"); Database db = DatabaseFactory.CreateDatabase(); DbCommand dbCommand = db.GetSqlStringCommand(strSql.ToString()); db.AddInParameter(dbCommand, "username", DbType.String, model.username); db.AddInParameter(dbCommand, "password", DbType.String, model.password); db.AddInParameter(dbCommand, "email", DbType.String, model.email); int result; object obj = db.ExecuteScalar(dbCommand); if(!int.TryParse(obj.ToString(),out result)) { return 0; } return result; }
/// <summary> /// ����һ������ /// </summary> public int Add(wgiAdUnionSystem.Model.wgi_adhost_usersite model) { StringBuilder strSql = new StringBuilder(); strSql.Append("insert into wgi_adhost_usersite("); strSql.Append("companyid,siteid,status,applytime)"); strSql.Append(" values ("); strSql.Append("@companyid,@siteid,@status,@applytime)"); strSql.Append(";select @@IDENTITY"); Database db = DatabaseFactory.CreateDatabase(); DbCommand dbCommand = db.GetSqlStringCommand(strSql.ToString()); db.AddInParameter(dbCommand, "companyid", DbType.Int32, model.companyid); db.AddInParameter(dbCommand, "siteid", DbType.Int32, model.siteid); db.AddInParameter(dbCommand, "status", DbType.Int32, model.status); db.AddInParameter(dbCommand, "applytime", DbType.DateTime, model.applytime); int result; object obj = db.ExecuteScalar(dbCommand); if (!int.TryParse(obj.ToString(), out result)) { return 0; } return result; }
/// <summary> /// ����һ������ /// </summary> public int Add(wgiAdUnionSystem.Model.wgi_discount model) { StringBuilder strSql = new StringBuilder(); strSql.Append("insert into wgi_discount("); strSql.Append("companyid,payamt,payintro,endtime,addtime)"); strSql.Append(" values ("); strSql.Append("@companyid,@payamt,@payintro,@endtime,@addtime)"); strSql.Append(";select @@IDENTITY"); Database db = DatabaseFactory.CreateDatabase(); DbCommand dbCommand = db.GetSqlStringCommand(strSql.ToString()); db.AddInParameter(dbCommand, "companyid", DbType.Int32, model.companyid); db.AddInParameter(dbCommand, "payamt", DbType.String, model.payamt); db.AddInParameter(dbCommand, "payintro", DbType.String, model.payintro); db.AddInParameter(dbCommand, "endtime", DbType.DateTime, model.endtime); db.AddInParameter(dbCommand, "addtime", DbType.DateTime, model.addtime); int result; object obj = db.ExecuteScalar(dbCommand); if (!int.TryParse(obj.ToString(), out result)) { return 0; } return result; }
/// <summary> /// ����һ������ /// </summary> public void Update(wgiAdUnionSystem.Model.wgi_sysuser model) { StringBuilder strSql=new StringBuilder(); strSql.Append("update wgi_sysuser set "); strSql.Append("username=@username,"); strSql.Append("password=@password,"); strSql.Append("email=@email"); 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, "username", DbType.String, model.username); db.AddInParameter(dbCommand, "password", DbType.String, model.password); db.AddInParameter(dbCommand, "email", DbType.String, model.email); db.ExecuteNonQuery(dbCommand); }
/// <summary> /// ����һ������ /// </summary> public int Add(wgiAdUnionSystem.Model.wgi_mysite model) { return dal.Add(model); }
/// <summary> /// ����һ������ /// </summary> public void Update(wgiAdUnionSystem.Model.wgi_mysite model) { dal.Update(model); }
/// <summary> /// ����һ������ /// </summary> public void Update(wgiAdUnionSystem.Model.wgi_loginlog model) { StringBuilder strSql=new StringBuilder(); strSql.Append("update wgi_loginlog set "); strSql.Append("usertype=@usertype,"); strSql.Append("logtime=@logtime,"); strSql.Append("logip=@logip,"); strSql.Append("logname=@logname"); strSql.Append(" where logid=@logid "); Database db = DatabaseFactory.CreateDatabase(); DbCommand dbCommand = db.GetSqlStringCommand(strSql.ToString()); db.AddInParameter(dbCommand, "logid", DbType.Int32, model.logid); db.AddInParameter(dbCommand, "usertype", DbType.Int32, model.usertype); db.AddInParameter(dbCommand, "logtime", DbType.DateTime, model.logtime); db.AddInParameter(dbCommand, "logip", DbType.String, model.logip); db.AddInParameter(dbCommand, "logname", DbType.String, model.logname); db.ExecuteNonQuery(dbCommand); }
/// <summary> /// ����һ������ /// </summary> public void Update(wgiAdUnionSystem.Model.wgi_orders model) { StringBuilder strSql=new StringBuilder(); strSql.Append("update wgi_orders set "); strSql.Append("companyid=@companyid,"); strSql.Append("siteid=@siteid,"); strSql.Append("orderno=@orderno,"); strSql.Append("cash=@cash,"); strSql.Append("time=@time,"); strSql.Append("consumer=@consumer,"); strSql.Append("itemno=@itemno,"); strSql.Append("itemprice=@itemprice,"); strSql.Append("itemamount=@itemamount,"); strSql.Append("pay=@pay,"); strSql.Append("ischeck=@ischeck,"); strSql.Append("reason=@reason,"); strSql.Append("checktime=@checktime"); strSql.Append(" where orderid=@orderid "); Database db = DatabaseFactory.CreateDatabase(); DbCommand dbCommand = db.GetSqlStringCommand(strSql.ToString()); db.AddInParameter(dbCommand, "orderid", DbType.Int32, model.orderid); db.AddInParameter(dbCommand, "companyid", DbType.Int32, model.companyid); db.AddInParameter(dbCommand, "siteid", DbType.Int32, model.siteid); db.AddInParameter(dbCommand, "orderno", DbType.String, model.orderno); db.AddInParameter(dbCommand, "cash", DbType.Decimal, model.cash); db.AddInParameter(dbCommand, "time", DbType.DateTime, model.time); db.AddInParameter(dbCommand, "consumer", DbType.String, model.consumer); db.AddInParameter(dbCommand, "itemno", DbType.String, model.itemno); db.AddInParameter(dbCommand, "itemprice", DbType.Decimal, model.itemprice); db.AddInParameter(dbCommand, "itemamount", DbType.Decimal, model.itemamount); db.AddInParameter(dbCommand, "pay", DbType.Decimal, model.pay); db.AddInParameter(dbCommand, "ischeck", DbType.Int32, model.ischeck); db.AddInParameter(dbCommand, "reason", DbType.String, model.reason); db.AddInParameter(dbCommand, "checktime", DbType.DateTime, model.checktime); db.ExecuteNonQuery(dbCommand); }
/// <summary> /// ����һ������ /// </summary> public void Update(wgiAdUnionSystem.Model.wgi_order model) { dal.Update(model); }
/// <summary> /// ����һ������ /// </summary> public void Update(wgiAdUnionSystem.Model.wgi_content model) { StringBuilder strSql=new StringBuilder(); strSql.Append("update wgi_content set "); strSql.Append("title=@title,"); strSql.Append("content=@content,"); strSql.Append("author=@author,"); strSql.Append("showindex=@showindex,"); strSql.Append("pubtime=@pubtime,"); strSql.Append("isshow=@isshow"); 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, "author", DbType.String, model.author); db.AddInParameter(dbCommand, "showindex", DbType.Int32, model.showindex); db.AddInParameter(dbCommand, "pubtime", DbType.DateTime, model.pubtime); db.AddInParameter(dbCommand, "isshow", DbType.Int32, model.isshow); db.ExecuteNonQuery(dbCommand); }
/// <summary> /// ����һ������ /// </summary> public void Update(wgiAdUnionSystem.Model.wgi_adv_site_host model) { StringBuilder strSql=new StringBuilder(); strSql.Append("update wgi_adv_site_host set "); strSql.Append("companyid=@companyid,"); strSql.Append("userid=@userid"); 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, "companyid", DbType.Int32, model.companyid); db.AddInParameter(dbCommand, "userid", DbType.Int32, model.userid); db.ExecuteNonQuery(dbCommand); }
/// <summary> /// ����һ������ /// </summary> public void Update(wgiAdUnionSystem.Model.wgi_notice model) { StringBuilder strSql = new StringBuilder(); strSql.Append("update wgi_notice set "); strSql.Append("title=@title,"); strSql.Append("notice=@notice,"); strSql.Append("pubdate=@pubdate,"); strSql.Append("unread=@unread,"); strSql.Append("publisher=@publisher,"); strSql.Append("objid=@objid,"); strSql.Append("objtype=@objtype"); 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, "notice", DbType.String, model.notice); db.AddInParameter(dbCommand, "pubdate", DbType.DateTime, model.pubdate); db.AddInParameter(dbCommand, "unread", DbType.Int32, model.unread); db.AddInParameter(dbCommand, "publisher", DbType.Int32, model.publisher); db.AddInParameter(dbCommand, "objid", DbType.Int32, model.objid); db.AddInParameter(dbCommand, "objtype", DbType.Int32, model.objtype); db.ExecuteNonQuery(dbCommand); }
/// <summary> /// ����һ������ /// </summary> public void Update(wgiAdUnionSystem.Model.wgi_discount model) { StringBuilder strSql = new StringBuilder(); strSql.Append("update wgi_discount set "); strSql.Append("companyid=@companyid,"); strSql.Append("payamt=@payamt,"); strSql.Append("payintro=@payintro,"); strSql.Append("endtime=@endtime,"); strSql.Append("addtime=@addtime"); 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, "companyid", DbType.Int32, model.companyid); db.AddInParameter(dbCommand, "payamt", DbType.String, model.payamt); db.AddInParameter(dbCommand, "payintro", DbType.String, model.payintro); db.AddInParameter(dbCommand, "endtime", DbType.DateTime, model.endtime); db.AddInParameter(dbCommand, "addtime", DbType.DateTime, model.addtime); db.ExecuteNonQuery(dbCommand); }
/// <summary> /// ����һ������ /// </summary> public int Add(wgiAdUnionSystem.Model.wgi_adv_site_host model) { return dal.Add(model); }
/// <summary> /// ����һ������ /// </summary> public void Update(wgiAdUnionSystem.Model.wgi_adv_site_host model) { dal.Update(model); }