您目前尚未登陆,请选择【登陆】或【注册
首页->全站代码->WebQuest发布系统源码及文档>>App-Code/ModelsContent.cs>>源码在线查看
温馨提示:代码在线浏览功能只能做为源码浏览参考,如果想更进一步了解该代码请下载:WebQuest发布系统源码及文档
当前文件:文件类型 WebQuest/App_Code/ModelsContent.cs打开代码结构图
普通视图
		            
1using System; 2using System.Data; 3using System.Configuration; 4using System.Web; 5using System.Web.Security; 6using System.Web.UI; 7using System.Web.UI.WebControls; 8using System.Web.UI.WebControls.WebParts; 9using System.Web.UI.HtmlControls; 10using System.Data.OleDb; 11/// <summary> 12/// ModelsContent 的摘要说明 13/// </summary> 14namespace WebQuest 15{ 16 public class ModelsContent 17 { 18 私有成员与属性 50 public int Update() 51 { 52 try 53 { 54 AccessDB myObj = new AccessDB(); 55 myObj.SqlStr = "update Webquest_Models_Content set content='" + _content + "' where modelContentId=" +_modelContentId.ToString(); 56 myObj.ExecuteSqlStr(); 57 return 0; 58 } 59 catch (Exception a) 60 { 61 62 throw a; 63 return -1; 64 } 65 } 66 public int Delete() 67 { 68 AccessDB myObj = new AccessDB(); 69 myObj.SqlStr = "delete from Webquest_Models_Content where ModelContentId=" + _modelContentId.ToString(); myObj.ExecuteSqlStr(); 70 return 0; 71 } 72 public OleDbDataReader RetrieveAll() 73 { 74 AccessDB myObj = new AccessDB(); 75 myObj.SqlStr = "select * from Webquest_Models_Content where webquestid=" + _webquestId.ToString(); 76 return myObj.ExecuteSqlStrReturnDr(); 77 } 78 public OleDbDataReader RetrieveContent() 79 { 80 AccessDB myObj = new AccessDB(); 81 myObj.SqlStr = "select * from Webquest_Models_Content where modelid=" + _modelId.ToString() + " and webquestid=" + _webquestId.ToString() + " order by modelcontentid asc"; 82 return myObj.ExecuteSqlStrReturnDr(); 83 } 84 public int Create() 85 { 86 try 87 { 88 AccessDB myObj = new AccessDB(); 89 myObj.SqlStr = "insert into Webquest_Models_Content (webquestid,modelid,content) values ('" + _webquestId + "','" + _modelId + "','" + _content + "')"; 90 myObj.ExecuteSqlStr(); 91 return 0; 92 } 93 catch (Exception) 94 { 95 96 throw; 97 return -1; 98 } 99 } 100 public DataSet Retrieve() 101 { 102 AccessDB myObj = new AccessDB(); 103 myObj.SqlStr = "select * from Webquest_Models_Content where webquestid="+_webquestId.ToString(); 104 return myObj.ExecuteSqlStrReturnDs(); 105 } 106 107 public ModelsContent() 108 { 109 // 110 // TODO: 在此处添加构造函数逻辑 111 // 112 } 113 } 114} 115
还没有找到您心仪的内容?请用.net源码大搜捕
代码片断 打包下载该项目完整源码:WebQuest发布系统源码及文档
51Aspx.com 版权所有 CopyRight © 2000-2008. 京ICP备06046876号