📄 otherpaymentform.aspx.cs
字号:
//文件名:OtherPaymentForm.aspx.cs
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 ChargeManage_OtherPaymentForm : System.Web.UI.Page
{
protected void Page_Load(object sender, EventArgs e)
{
string MyForbidString = Session["MyForbid"].ToString();
if (MyForbidString.IndexOf("C7") > 1)
{
Server.Transfer("~/SystemManage/AllErrorHelp.aspx");
}
this.Button3.OnClientClick = "return confirm('请检查其他费用收据信息是否正确,一旦保存就无法修改,是否继续?')";
}
protected void Button1_Click(object sender, EventArgs e)
{//新增其他费用信息
this.TextBox1.Text = System.Guid.NewGuid().ToString().ToUpper();
this.TextBox2.Text = DateTime.Now.ToShortDateString();
this.TextBox6.Text = Session["MyUserName"].ToString();
}
protected void Button2_Click(object sender, EventArgs e)
{//打印其他费用信息
Server.Transfer("~/ChargeManage/OtherPaymentPrint.aspx");
}
protected void Button3_Click(object sender, EventArgs e)
{//保存其他费用信息
String MySQLConnectionString = ConfigurationManager.ConnectionStrings["MyCommunityDBConnectionString"].ConnectionString;
SqlConnection MyConnection = new SqlConnection(MySQLConnectionString);
MyConnection.Open();
SqlCommand MyCommand = MyConnection.CreateCommand();
string MySQL = "INSERT INTO 费用收据(收据编号,收款日期,交款人员,收款金额,收款形式,收款人员,收款事由,补充说明) VALUES('";
MySQL += this.TextBox1.Text + "','";
MySQL += this.TextBox2.Text + "','";
MySQL += this.TextBox3.Text + "',";
MySQL += this.TextBox4.Text + ",'";
MySQL += this.TextBox5.Text + "','";
MySQL += this.TextBox6.Text + "','";
MySQL += this.TextBox7.Text + "','";
MySQL += this.TextBox8.Text + "');";
MyCommand.CommandText = MySQL;
MyCommand.ExecuteNonQuery();
if (MyConnection.State == ConnectionState.Open)
{
MyConnection.Close();
}
Server.Transfer("~/ChargeManage/OtherPaymentForm.aspx");
}
public String MyPrint补充说明
{//设置要传递到打印页的数据
get
{
return this.TextBox8.Text;
}
}
public String MyPrint收据编号
{//设置要传递到打印页的数据
get
{
return this.TextBox1.Text;
}
}
public String MyPrint收款日期
{//设置要传递到打印页的数据
get
{
return this.TextBox2.Text;
}
}
public String MyPrint交款人员
{//设置要传递到打印页的数据
get
{
return this.TextBox3.Text;
}
}
public String MyPrint收款金额
{//设置要传递到打印页的数据
get
{
return this.TextBox4.Text;
}
}
public String MyPrint收款形式
{//设置要传递到打印页的数据
get
{
return this.TextBox5.Text;
}
}
public String MyPrint收款事由
{//设置要传递到打印页的数据
get
{
return this.TextBox7.Text;
}
}
public String MyPrint收款人员
{//设置要传递到打印页的数据
get
{
return this.TextBox6.Text;
}
}
}
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -