forums_forum_edit.aspx.cs
来自「ASP.NET的一些开发实例,有论坛管理系统等」· CS 代码 · 共 182 行
CS
182 行
using System;
using System.Collections;
using System.ComponentModel;
using System.Data;
using System.Drawing;
using System.Web;
using System.Web.SessionState;
using System.Web.UI;
using System.Web.UI.WebControls;
using System.Web.UI.HtmlControls;
namespace WhiteForum.forums
{
/// <summary>
/// forums_forum_edit 的摘要说明。
/// </summary>
public class forums_forum_edit : BDStudioBase.FormBase
{
protected System.Web.UI.WebControls.Label Label02;
protected System.Web.UI.WebControls.Label Out_Label1;
protected System.Web.UI.WebControls.TextBox In_TextBox1;
protected System.Web.UI.WebControls.Label Out_Label2;
protected System.Web.UI.WebControls.TextBox In_Textbox2;
protected System.Web.UI.WebControls.Label Out_Label3;
protected System.Web.UI.WebControls.TextBox In_TextBox3;
protected System.Web.UI.WebControls.Label Out_Label4;
protected System.Web.UI.WebControls.RequiredFieldValidator RequiredFieldValidator2;
protected System.Web.UI.WebControls.TextBox In_TextBox4;
protected System.Web.UI.WebControls.Label Out_Label5;
protected System.Web.UI.WebControls.TextBox In_TextBox5;
protected System.Web.UI.WebControls.Label Out_Label6;
protected System.Web.UI.WebControls.TextBox In_TextBox6;
protected System.Web.UI.WebControls.Label Out_Label7;
protected System.Web.UI.WebControls.TextBox In_TextBox7;
protected System.Web.UI.WebControls.Label Out_Label17;
protected System.Web.UI.WebControls.TextBox In_TextBox8;
protected System.Web.UI.WebControls.Button cbSaveReturn;
protected System.Web.UI.WebControls.Button cbSaveRun;
protected System.Web.UI.WebControls.Button cbSaveSearch;
protected System.Web.UI.WebControls.Button cbReturn;
protected System.Web.UI.WebControls.Label labMessage1;
protected System.Web.UI.WebControls.RequiredFieldValidator Requiredfieldvalidator4;
protected System.Web.UI.WebControls.Label labCurrentRow;
protected System.Web.UI.WebControls.DataGrid DataGrid1;
private string m_num="81";
private COM_ForumForum COM_ForumForum=new COM_ForumForum();
private string sReturn="";
private int i_RowCount=0;
private int i_CurrentRow=0;
private string sReceiveId="";
protected System.Web.UI.WebControls.RegularExpressionValidator RegularExpressionValidator1;
private string[] arr_ReceiveId;
private void Page_Load(object sender, System.EventArgs e)
{
/*定义窗体变量,根据设计报告改变*/
this.o_str_FormName = "forums_forum_edit";
this.o_str_FormUrl = "forums_forum_edit.aspx";
this.o_str_DisplayFile1 = "forums_forum_display.aspx";
this.o_str_Pk1 = string.Empty;
if (this.Param_check(this.o_str_FormName)==1)
{
this.o_str_Pk1=this.Param_get("as_pk");
this.sReceiveId=this.Param_get("as_sendid");
}
arr_ReceiveId=this.sReceiveId.Split(new char[]{','});
i_RowCount=arr_ReceiveId.Length;
if(!Page.IsPostBack)
{
//当前记录位置
i_CurrentRow=this.COMGfunction.GetNumFromArray(this.o_str_Pk1,arr_ReceiveId)+1;
this.labCurrentRow.Text=i_CurrentRow.ToString();
//填充标签内容
this.Out_label(m_num,"InputFace",this);
FormInit(this.o_str_Pk1,"0");
}
}
#region Web Form Designer generated code
override protected void OnInit(EventArgs e)
{
//
// CODEGEN:该调用是 ASP.NET Web 窗体设计器所必需的。
//
InitializeComponent();
base.OnInit(e);
}
/// <summary>
/// 设计器支持所需的方法 - 不要使用代码编辑器修改
/// 此方法的内容。
/// </summary>
private void InitializeComponent()
{
this.cbSaveReturn.Click += new System.EventHandler(this.cbSaveReturn_Click);
this.cbSaveRun.Click += new System.EventHandler(this.cbSaveRun_Click);
this.cbSaveSearch.Click += new System.EventHandler(this.cbSaveSearch_Click);
this.cbReturn.Click += new System.EventHandler(this.cbReturn_Click);
this.Load += new System.EventHandler(this.Page_Load);
}
#endregion
private void FormInit(string s_pk,string SearchType)
{
string[] str_FieldValue = {m_num,"InputFace",s_pk};
DataSet dsData=this.COM_ForumForum.DsSelectSingleData(str_FieldValue,SearchType,ref sReturn);
this.Put_IntextBox(m_num,"InputFace",dsData,this);
this.DataGrid1.DataSource=dsData;
this.DataGrid1.DataBind();
//this.labMessage1.Text=sReturn;
}
private void DataSave(string EditType)
{
DataSet dsData=this.SetFaceDataToDataSet(m_num,"InputFace",this);
// this.DataGrid1.DataSource=dsData;
// this.DataGrid1.DataBind();
string sReturn=string.Empty;
this.COM_ForumForum.EditData(dsData,EditType,ref sReturn);
this.labMessage1.Text=sReturn;
}
private void cbReturn_Click(object sender, System.EventArgs e)
{
this.ReturnToParent(this.o_str_FormName);
}
private void cbSaveReturn_Click(object sender, System.EventArgs e)
{
DataSave("0");
if (this.labMessage1.Text == "修改成功")
{
this.ReturnToParent(this.o_str_FormName);
}
}
private void cbSaveRun_Click(object sender, System.EventArgs e)
{
DataSave("0");
if (this.labMessage1.Text == "修改成功")
{
i_CurrentRow=Int32.Parse(this.labCurrentRow.Text);
i_CurrentRow++;
if(i_CurrentRow<=0)
{
i_CurrentRow=1;
}
else
{
if(i_CurrentRow>=i_RowCount)
{
i_CurrentRow=i_RowCount;
}
}
this.labCurrentRow.Text=i_CurrentRow.ToString();
FormInit(arr_ReceiveId[i_CurrentRow-1],"0");
}
}
private void cbSaveSearch_Click(object sender, System.EventArgs e)
{
DataSave("1");
if (this.labMessage1.Text != "修改失败")
{
this.Param_Open("forums_forum_display");
this.Param_set("as_pk",this.labMessage1.Text);
this.Param_set("as_sendid",sReceiveId);
this.CreatUserLogParentWindow("forums_forum_display",this.o_str_FormUrl);//建立子窗口的父窗口数据值
Response.Redirect(this.o_str_DisplayFile1);
}
}
}
}
⌨️ 快捷键说明
复制代码Ctrl + C
搜索代码Ctrl + F
全屏模式F11
增大字号Ctrl + =
减小字号Ctrl + -
显示快捷键?