后台页面组织
public partial class PrivateWork_WorkSummary : System.Web.UI.Page
{
Page_Load#region Page_Load
protected void Page_Load(object sender, EventArgs e)
{
if (!IsPostBack)
{
fn_BindGrid();
}
}
#endregion
页面按钮事件#region 页面按钮事件
GridView 的 选择按钮事件#region GridView 的 选择按钮事件
protected void gv_DataShow_SelectedIndexChanged(object sender, EventArgs e)
{
string strWorkPlanSeqID = this.gv_DataShow.SelectedRow.Cells[1].Text.ToString().Trim();
string strSql = "";
DataTable dt = DBClass.RunSelectGetDataTable(strSql);
}
#endregion
新增 按钮 事件#region 新增 按钮 事件
protected void btn_NewAdd_Click(object sender, EventArgs e)
{
}
#endregion
修改 按钮 事件#region 修改 按钮 事件
protected void btn_Edit_Click(object sender, EventArgs e)
{
}
#endregion
保存 按钮 事件#region 保存 按钮 事件
protected void btn_Save_Click(object sender, EventArgs e)
{
}
#endregion
删除 按钮 事件#region 删除 按钮 事件
protected void btn_Delete_Click(object sender, EventArgs e)
{
}
#endregion
#endregion
自定义方法#region 自定义方法
绑定Grid数据#region 绑定Grid数据
private void fn_BindGrid()
{
string strSql = "SELECT WorkPlanSeqID , WorkPlanTitle ";
strSql += " ,REPLACE(CONVERT(CHAR(10),WorkPlanBeginDate,120),'-','.') AS WorkPlanBeginDate ";
strSql += " ,REPLACE(CONVERT(CHAR(10),WorkPlanEndDate,120),'-','.') AS WorkPlanEndDate ";
strSql += " WHERE WorkPlanRunnerID='" + Session["LoginID"].ToString() + "' ";
DataTable dt = DBClass.RunSelectGetDataTable(strSql);
this.gv_DataShow.DataSource = dt;
this.gv_DataShow.DataBind();
if (dt.Rows.Count > 0)
this.tab_DataShow.Visible = false;
else
this.tab_DataShow.Visible = true;
}
#endregion
清空编辑区#region 清空编辑区
private void fn_ClearEditArea()
{
}
#endregion
页面 栏位 可用与否#region 页面 栏位 可用与否
private void fn_EditAreaIsEnabled(bool isEnabled)
{
}
#endregion
#endregion
}
{
Page_Load#region Page_Load
protected void Page_Load(object sender, EventArgs e)
{
if (!IsPostBack)
{
fn_BindGrid();
}
}
#endregion
页面按钮事件#region 页面按钮事件
GridView 的 选择按钮事件#region GridView 的 选择按钮事件
protected void gv_DataShow_SelectedIndexChanged(object sender, EventArgs e)
{
string strWorkPlanSeqID = this.gv_DataShow.SelectedRow.Cells[1].Text.ToString().Trim();
string strSql = "";
DataTable dt = DBClass.RunSelectGetDataTable(strSql);
}
#endregion
新增 按钮 事件#region 新增 按钮 事件
protected void btn_NewAdd_Click(object sender, EventArgs e)
{
}
#endregion
修改 按钮 事件#region 修改 按钮 事件
protected void btn_Edit_Click(object sender, EventArgs e)
{
}
#endregion
保存 按钮 事件#region 保存 按钮 事件
protected void btn_Save_Click(object sender, EventArgs e)
{
}
#endregion
删除 按钮 事件#region 删除 按钮 事件
protected void btn_Delete_Click(object sender, EventArgs e)
{
}
#endregion
#endregion
自定义方法#region 自定义方法
绑定Grid数据#region 绑定Grid数据
private void fn_BindGrid()
{
string strSql = "SELECT WorkPlanSeqID , WorkPlanTitle ";
strSql += " ,REPLACE(CONVERT(CHAR(10),WorkPlanBeginDate,120),'-','.') AS WorkPlanBeginDate ";
strSql += " ,REPLACE(CONVERT(CHAR(10),WorkPlanEndDate,120),'-','.') AS WorkPlanEndDate ";
strSql += " WHERE WorkPlanRunnerID='" + Session["LoginID"].ToString() + "' ";
DataTable dt = DBClass.RunSelectGetDataTable(strSql);
this.gv_DataShow.DataSource = dt;
this.gv_DataShow.DataBind();
if (dt.Rows.Count > 0)
this.tab_DataShow.Visible = false;
else
this.tab_DataShow.Visible = true;
}
#endregion
清空编辑区#region 清空编辑区
private void fn_ClearEditArea()
{
}
#endregion
页面 栏位 可用与否#region 页面 栏位 可用与否
private void fn_EditAreaIsEnabled(bool isEnabled)
{
}
#endregion
#endregion
}
posted on 2008-03-13 10:27 freeliver54 阅读(299) 评论(0) 编辑 收藏 举报