您目前尚未登陆,请选择【登陆】或【注册
首页->行政办公->库存管理系统V1.0源码>>chukujetongji.aspx.cs>>源码在线查看
温馨提示:代码在线浏览功能只能做为源码浏览参考,如果想更进一步了解该代码请下载:库存管理系统V1.0源码
当前文件:文件类型 StoreManage/chukujetongji.aspx.cs打开代码结构图
普通视图
		            
1using System; 2using System.Data; 3using System.Configuration; 4using System.Collections; 5using System.Web; 6using System.Web.Security; 7using System.Web.UI; 8using System.Web.UI.WebControls; 9using System.Web.UI.WebControls.WebParts; 10using System.Web.UI.HtmlControls; 11using System.Data.SqlClient; 12 13public partial class chukujetongji : System.Web.UI.Page 14{ 15 protected void Page_Load(object sender, EventArgs e) 16 { 17 if (!IsPostBack) 18 { 19 gridviewBind(); 20 } 21 } 22 //gridview绑定 23 private void gridviewBind() 24 { 25 string str = "select rukuID,rukuDate,rukuBianma,huoName,shuliang,jinjia,zhonge,beizhu,ghdw,jingbanren,huokuan from chuku order by rukuID desc"; 26 SqlConnection scon = new SqlConnection(ConfigurationManager.AppSettings["ConnectionString"]); 27 scon.Open(); 28 SqlDataAdapter dbAdapter = new SqlDataAdapter(str, scon); 29 DataSet ds = new DataSet(); 30 dbAdapter.Fill(ds); 31 scon.Close(); 32 GridView1.DataSource = ds.Tables[0].DefaultView; 33 GridView1.DataKeyNames = new string[] { "rukuID" }; 34 GridView1.DataBind(); 35 } 36 ////f分页 37 protected void GridView1_PageIndexChanging1(object sender, GridViewPageEventArgs e) 38 { 39 GridView1.PageIndex = e.NewPageIndex; 40 GridView1.DataBind(); 41 gridviewBind(); 42 } 43 protected void GridView1_RowDeleting(object sender, GridViewDeleteEventArgs e) 44 { 45 string ss = "delete from chuku where rukuID='" + this.GridView1.DataKeys[e.RowIndex].Value.ToString() + "'"; 46 SqlConnection scon = new SqlConnection(ConfigurationManager.AppSettings["ConnectionString"]); 47 scon.Open(); 48 SqlCommand scmd = new SqlCommand(ss, scon); 49 scmd.ExecuteNonQuery(); 50 scon.Close(); 51 GridView1.DataBind(); 52 gridviewBind(); 53 } 54 protected void Button2_Click(object sender, EventArgs e) 55 { 56 string str = "select rukuID,rukuDate,rukuBianma,huoName,shuliang,jinjia,zhonge,beizhu,ghdw,jingbanren,huokuan from chuku where ghdw like '%" + TextBox1.Text + "%'"; 57 SqlConnection scon = new SqlConnection(ConfigurationManager.AppSettings["ConnectionString"]); 58 scon.Open(); 59 SqlDataAdapter dbAdapter = new SqlDataAdapter(str, scon); 60 DataSet ds = new DataSet(); 61 dbAdapter.Fill(ds); 62 scon.Close(); 63 GridView1.DataSource = ds.Tables[0].DefaultView; 64 GridView1.DataKeyNames = new string[] { "rukuID" }; 65 GridView1.DataBind(); 66 67 } 68} 69
还没有找到您心仪的内容?请用.net源码大搜捕
代码片断 打包下载该项目完整源码:库存管理系统V1.0源码
51Aspx.com 版权所有 CopyRight © 2000-2008. 京ICP备06046876号