/// <summary> /// 增加一条数据 /// </summary> public bool Add(Thigh.Model.Admin model) { StringBuilder strSql=new StringBuilder(); strSql.Append("insert into tb_Admin("); strSql.Append("AdminAccount,AdminPassword,AdminName,AdminType)"); strSql.Append(" values ("); strSql.Append("@AdminAccount,@AdminPassword,@AdminName,@AdminType)"); OleDbParameter[] parameters = { new OleDbParameter("@AdminAccount", OleDbType.VarChar,50), new OleDbParameter("@AdminPassword", OleDbType.VarChar,50), new OleDbParameter("@AdminName", OleDbType.VarChar,50), new OleDbParameter("@AdminType", OleDbType.VarChar,50)}; parameters[0].Value = model.AdminAccount; parameters[1].Value = model.AdminPassword; parameters[2].Value = model.AdminName; parameters[3].Value = model.AdminType; int rows=DbHelperOleDb.ExecuteSql(strSql.ToString(),parameters); if (rows > 0) { return true; } else { return false; } }
/// <summary> /// 增加一条数据 /// </summary> public bool Add(Thigh.Model.News model) { StringBuilder strSql=new StringBuilder(); strSql.Append("insert into tb_News("); strSql.Append("NewsTitle,NewsContent,Keywords,Description,PicUrl,PubTime,Source,ClickTime,State,NewsTypeID,NewsTypeName,AdminID,AdminName)"); strSql.Append(" values ("); strSql.Append("@NewsTitle,@NewsContent,@Keywords,@Description,@PicUrl,@PubTime,@Source,@ClickTime,@State,@NewsTypeID,@NewsTypeName,@AdminID,@AdminName)"); OleDbParameter[] parameters = { new OleDbParameter("@NewsTitle", OleDbType.VarChar,50), new OleDbParameter("@NewsContent", OleDbType.VarChar,0), new OleDbParameter("@Keywords", OleDbType.VarChar,50), new OleDbParameter("@Description", OleDbType.VarChar,50), new OleDbParameter("@PicUrl", OleDbType.VarChar,50), new OleDbParameter("@PubTime", OleDbType.VarChar,50), new OleDbParameter("@Source", OleDbType.VarChar,50), new OleDbParameter("@ClickTime", OleDbType.VarChar,50), new OleDbParameter("@State", OleDbType.VarChar,50), new OleDbParameter("@NewsTypeID", OleDbType.VarChar,50), new OleDbParameter("@NewsTypeName", OleDbType.VarChar,50), new OleDbParameter("@AdminID", OleDbType.VarChar,50), new OleDbParameter("@AdminName", OleDbType.VarChar,50)}; parameters[0].Value = model.NewsTitle; parameters[1].Value = model.NewsContent; parameters[2].Value = model.Keywords; parameters[3].Value = model.Description; parameters[4].Value = model.PicUrl; parameters[5].Value = model.PubTime; parameters[6].Value = model.Source; parameters[7].Value = model.ClickTime; parameters[8].Value = model.State; parameters[9].Value = model.NewsTypeID; parameters[10].Value = model.NewsTypeName; parameters[11].Value = model.AdminID; parameters[12].Value = model.AdminName; int rows=DbHelperOleDb.ExecuteSql(strSql.ToString(),parameters); if (rows > 0) { return true; } else { return false; } }
/// <summary> /// 增加一条数据 /// </summary> public bool Add(Thigh.Model.Admin model) { return dal.Add(model); }
/// <summary> /// 更新一条数据 /// </summary> public bool Update(Thigh.Model.Admin model) { return dal.Update(model); }
/// <summary> /// 增加一条数据 /// </summary> public bool Add(Thigh.Model.News model) { return dal.Add(model); }
/// <summary> /// 更新一条数据 /// </summary> public bool Update(Thigh.Model.News model) { return dal.Update(model); }
public Leg() { Foot = new Foot(); Thigh = new Thigh(); }
/// <summary> /// 更新一条数据 /// </summary> public bool Update(Thigh.Model.Admin model) { StringBuilder strSql=new StringBuilder(); strSql.Append("update tb_Admin set "); strSql.Append("AdminAccount=@AdminAccount,"); strSql.Append("AdminPassword=@AdminPassword,"); strSql.Append("AdminName=@AdminName,"); strSql.Append("AdminType=@AdminType"); strSql.Append(" where AdminID=@AdminID"); OleDbParameter[] parameters = { new OleDbParameter("@AdminAccount", OleDbType.VarChar,50), new OleDbParameter("@AdminPassword", OleDbType.VarChar,50), new OleDbParameter("@AdminName", OleDbType.VarChar,50), new OleDbParameter("@AdminType", OleDbType.VarChar,50), new OleDbParameter("@AdminID", OleDbType.Integer,4)}; parameters[0].Value = model.AdminAccount; parameters[1].Value = model.AdminPassword; parameters[2].Value = model.AdminName; parameters[3].Value = model.AdminType; parameters[4].Value = model.AdminID; int rows=DbHelperOleDb.ExecuteSql(strSql.ToString(),parameters); if (rows > 0) { return true; } else { return false; } }
/// <summary> /// 更新一条数据 /// </summary> public bool Update(Thigh.Model.News model) { StringBuilder strSql=new StringBuilder(); strSql.Append("update tb_News set "); strSql.Append("NewsTitle=@NewsTitle,"); strSql.Append("NewsContent=@NewsContent,"); strSql.Append("Keywords=@Keywords,"); strSql.Append("Description=@Description,"); strSql.Append("PicUrl=@PicUrl,"); strSql.Append("PubTime=@PubTime,"); strSql.Append("Source=@Source,"); strSql.Append("ClickTime=@ClickTime,"); strSql.Append("State=@State,"); strSql.Append("NewsTypeID=@NewsTypeID,"); strSql.Append("NewsTypeName=@NewsTypeName,"); strSql.Append("AdminID=@AdminID,"); strSql.Append("AdminName=@AdminName"); strSql.Append(" where NewsID=@NewsID"); OleDbParameter[] parameters = { new OleDbParameter("@NewsTitle", OleDbType.VarChar,50), new OleDbParameter("@NewsContent", OleDbType.VarChar,0), new OleDbParameter("@Keywords", OleDbType.VarChar,50), new OleDbParameter("@Description", OleDbType.VarChar,50), new OleDbParameter("@PicUrl", OleDbType.VarChar,50), new OleDbParameter("@PubTime", OleDbType.VarChar,50), new OleDbParameter("@Source", OleDbType.VarChar,50), new OleDbParameter("@ClickTime", OleDbType.VarChar,50), new OleDbParameter("@State", OleDbType.VarChar,50), new OleDbParameter("@NewsTypeID", OleDbType.VarChar,50), new OleDbParameter("@NewsTypeName", OleDbType.VarChar,50), new OleDbParameter("@AdminID", OleDbType.VarChar,50), new OleDbParameter("@AdminName", OleDbType.VarChar,50), new OleDbParameter("@NewsID", OleDbType.Integer,4)}; parameters[0].Value = model.NewsTitle; parameters[1].Value = model.NewsContent; parameters[2].Value = model.Keywords; parameters[3].Value = model.Description; parameters[4].Value = model.PicUrl; parameters[5].Value = model.PubTime; parameters[6].Value = model.Source; parameters[7].Value = model.ClickTime; parameters[8].Value = model.State; parameters[9].Value = model.NewsTypeID; parameters[10].Value = model.NewsTypeName; parameters[11].Value = model.AdminID; parameters[12].Value = model.AdminName; parameters[13].Value = model.NewsID; int rows=DbHelperOleDb.ExecuteSql(strSql.ToString(),parameters); if (rows > 0) { return true; } else { return false; } }