📄 system_work_sumup11_input1.aspx.cs
字号:
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 BDStudioBase.syssoft
{
/// <summary>
/// system_work_sumup11_input1 的摘要说明。
/// </summary>
public class system_work_sumup11_input1 :FormBase
{
protected System.Web.UI.WebControls.Label Out_Label5;
protected System.Web.UI.WebControls.Label labMessage1;
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.Label Out_Label6;
protected System.Web.UI.WebControls.TextBox In_TextBox4;
protected System.Web.UI.WebControls.TextBox In_TextBox5;
protected System.Web.UI.WebControls.TextBox In_TextBox6;
protected System.Web.UI.WebControls.TextBox In_TextBox7;
protected System.Web.UI.WebControls.TextBox In_TextBox8;
protected System.Web.UI.WebControls.TextBox C_TextBox3;
protected System.Web.UI.WebControls.TextBox In_TextBox3;
protected System.Web.UI.WebControls.ImageButton cbReturn;
protected System.Web.UI.WebControls.ImageButton cbSaveSearch;
protected System.Web.UI.WebControls.ImageButton cbSaveRun;
protected System.Web.UI.WebControls.ImageButton cbSaveReturn;
string[] sFieldName={"work_num","w_date","start_emp","work_topic","work_note","work_type","work_status","receive_emp"};
protected COM_SystemWorkPlan COM_SystemWorkPlan=new COM_SystemWorkPlan();
protected COM_NumToChina COM_NumToChina=new COM_NumToChina();
protected Gfunction Gfunction=new Gfunction();
private string as_type="";
private void Page_Load(object sender, System.EventArgs e)
{
// 在此处放置用户代码以初始化页面
/*定义窗体变量,根据设计报告改变*/
this.o_str_FormName = "system_work_sumup11_input1";
this.o_str_Pk1 = "work_num";
this.o_str_FormUrl = "system_work_sumup11_input1.aspx";
this.o_str_DisplayFile1 = "system_work_sumup11_display1.aspx";
if(!Page.IsPostBack)
{
this.In_TextBox2.Text=Gfunction.DataTimeValue(0,1);
this.In_TextBox3.Text=Session["userid"].ToString();
this.In_TextBox8.Text="W";
this.C_TextBox3.Text=this.COM_NumToChina.GetAccountEmp(this.In_TextBox3.Text);
if (this.Param_check(this.o_str_FormName)==1)//该页是否需要接收值
{
this.as_type=this.Param_get("as_type");
}
}
}
#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.Web.UI.ImageClickEventHandler(this.cbSaveReturn_Click);
this.cbSaveRun.Click += new System.Web.UI.ImageClickEventHandler(this.cbSaveRun_Click);
this.cbSaveSearch.Click += new System.Web.UI.ImageClickEventHandler(this.cbSaveSearch_Click);
this.cbReturn.Click += new System.Web.UI.ImageClickEventHandler(this.cbReturn_Click);
this.Load += new System.EventHandler(this.Page_Load);
}
#endregion
private void DataSave(string InsertType)
{
DataSet dsData=new DataSet();
DataTable dtData=new DataTable();
DataRow dr;
for(int i=0;i<sFieldName.Length;i++)
{
dtData.Columns.Add(new DataColumn(sFieldName[i],typeof(string)));
}
string ls_id;
int li_start,li_count;
dr=dtData.NewRow();
foreach (System.Web.UI.Control con in this.Controls[1].Controls)
{
ls_id=con.ID;
if (ls_id==null) continue;
li_start=ls_id.IndexOf("In_TextBox");
if (li_start>=0)//如果是字段标题
{
li_count=int.Parse(ls_id.Substring(10));
if (con.GetType().ToString()== "System.Web.UI.WebControls.TextBox")
{
dr[sFieldName[li_count -1]]=((System.Web.UI.WebControls.TextBox)con).Text;
}
}
}
dtData.Rows.Add(dr);
dsData.Tables.Add(dtData);
//DataGrid1.DataSource=dsData;
//DataGrid1.DataBind();
string sReturn = string.Empty;
this.COM_SystemWorkPlan.InsertData(dsData,InsertType,ref sReturn);
this.labMessage1.Text = sReturn;
this.labMessage1.Visible=true;
}
private void ImageButton1_Click(object sender, System.Web.UI.ImageClickEventArgs e)
{
Response.Redirect("../forums/forums_main_public.aspx");
}
private void cbReturn_Click(object sender, System.Web.UI.ImageClickEventArgs e)
{
this.ReturnToParent(this.o_str_FormName);
}
private void cbSaveSearch_Click(object sender, System.Web.UI.ImageClickEventArgs e)
{
this.DataSave("2");
this.Param_Open("system_work_sumup11_display1");
this.Param_set("as_type",this.as_type);
this.Param_set("as_sendid","W");
this.Param_set(this.o_str_Pk1,this.labMessage1.Text);
this.CreatUserLogParentWindow("system_work_sumup11_display1",this.o_str_FormUrl);//建立子窗口的父窗口数据值
Response.Redirect(this.o_str_DisplayFile1);
}
private void cbSaveRun_Click(object sender, System.Web.UI.ImageClickEventArgs e)
{
this.DataSave("1");
}
private void cbSaveReturn_Click(object sender, System.Web.UI.ImageClickEventArgs e)
{
this.DataSave("0");
if (this.labMessage1.Text == "增加成功")
{
this.ReturnToParent(this.o_str_FormName);
}
}
}
}
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -