pages/EditData/EnterPrise.aspx.cs
(开头部分) 4KB这里只显示每个文件的开头 60 行。登录后可以解锁完整代码。
using System;
using System.Data;
using System.Configuration;
using System.Collections;
using System.Web;
using System.Web.Security;
using System.Web.UI;
using System.Web.UI.WebControls;
using System.Web.UI.WebControls.WebParts;
using System.Web.UI.HtmlControls;
using System.Data.SqlClient;
public partial class pages_Default : System.Web.UI.Page
{
protected void Page_Load(object sender, EventArgs e)
{
if (!IsPostBack)
{
SqlConnection conn = DB.GetCon();////根据数据库中的记录数自动产生一个数作为入库单ID
conn.Open();
this.AutoID(conn);
bind();
this.Label1 .Text =DB.TYPE_SECTION;
}
}
//根据数据库中的记录数自动产生一个数作为入库单ID
public void AutoID(SqlConnection conn)
{
try
{
SqlCommand com = new SqlCommand("select count(*) from tb_Enterprise", conn);
int Count = Convert.ToInt32(com.ExecuteScalar());
this.txtID.Text = Convert.ToString(Count + 1);
if (conn.State == ConnectionState.Open)
{
com.Dispose();
conn.Close();
}
}
catch(Exception e)
{
conn.Close ();
conn.Dispose ();
}
}
public void bind()
{
DataSet ds = DB.reDs("select * from tb_Enterprise");
gvEnter.DataSource = ds;
this.gvEnter.DataBind();
}
//使页面恢复初始状态
public void clear()
{
this.txtName.Text="";
this.txtAddress.Text="";
this.txtPhone.Text="";
this.txtLinkMan.Text="";
this.txtBank.Text="";
后面还有 81 行代码,解锁后查看完整代码
24 小时内免费解锁 3 个项目,之后 1 积分/个。 规则说明
AI 解读
登录后可用,每次 10 积分,解读结果公开显示在下面。
还没有人解读过这个文件。
