您目前尚未登陆,请选择【登陆】或【注册
首页->其他源码->商务维基网源码>>ArticleList.aspx.cs>>源码在线查看
温馨提示:代码在线浏览功能只能做为源码浏览参考,如果想更进一步了解该代码请下载:商务维基网源码
当前文件:文件类型 MerchantViki/ArticleList.aspx.cs打开代码结构图
普通视图
		            
1using System; 2using System.Data; 3using System.Data.SqlClient; 4using System.Configuration; 5using System.Collections; 6using System.Web; 7using System.Web.Security; 8using System.Web.UI; 9using System.Web.UI.WebControls; 10using System.Web.UI.WebControls.WebParts; 11using System.Web.UI.HtmlControls; 12 13public partial class ArticleList : System.Web.UI.Page 14{ 15 protected void Page_Load(object sender, EventArgs e) 16 { 17 this.Header.Title = Application.Get("siteName") + "---" + this.Header.Title; 18 19 if (Request.Params["EditionID"] != null) 20 { 21 int editionID = int.Parse(Request.Params["EditionID"]); 22 //info.Text = editionID.ToString(); 23 if (AddClick(editionID)) 24 { 25 26 info.Text = "操纵成功"; 27 } 28 else 29 { 30 info.Text = "操纵错误"; 31 } 32 } 33 else 34 { 35 info.Text = "版块未选定!"; 36 } 37 } 38 39 private bool AddClick(int id) 40 { 41 try 42 { 43 string conStr = Application.Get("conStr").ToString(); 44 SqlConnection sqlCon = new SqlConnection(conStr); 45 sqlCon.Open(); 46 SqlCommand sqlCmd = new SqlCommand(); 47 48 string cmdStr = "select click,name from edition where id = "+ id +" "; 49 sqlCmd.CommandText = cmdStr; 50 sqlCmd.Connection = sqlCon; 51 SqlDataReader sqlDR = sqlCmd.ExecuteReader(); 52 53 if (sqlDR.Read()) 54 { 55 int click = int.Parse(sqlDR.GetValue(0).ToString()) + 1; 56 Edition.Text = sqlDR.GetValue(1).ToString().Trim() + Edition.Text; 57 sqlDR.Close(); 58 cmdStr = "update edition set click = "+ click +" where id = "+ id +""; 59 sqlCmd.CommandText = cmdStr; 60 sqlCmd.ExecuteNonQuery(); 61 62 sqlCon.Close(); 63 return true; 64 } 65 else 66 { 67 sqlDR.Close(); 68 sqlCon.Close(); 69 return false; 70 } 71 } 72 catch (Exception ex) 73 { 74 //info.Text = ex.Message; 75 throw new Exception(ex.Message, ex); 76 return false; 77 } 78 } 79 80} 81
还没有找到您心仪的内容?请用.net源码大搜捕
代码片断 打包下载该项目完整源码:商务维基网源码
51Aspx.com 版权所有 CopyRight © 2000-2008. 京ICP备06046876号