📄 recordadd.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;
public partial class RecordAdd : System.Web.UI.Page
{
protected void Page_Load(object sender, EventArgs e)
{
if (Session["flag"] == null&&Session["UserName"]==null)
{
Response.Redirect("../Login.aspx");
}
if (!IsPostBack)
{
this.Label1.Text = "请填写下面的信息,我们将及时回复你:";
this.Panel1.Visible = true;//用Panel1控制显示发布信息添加模块
this.Panel2.Visible = false; // 用Panel2控制隐藏服务调查信息添加模块
}
}
protected void btnClickOK_Click(object sender, EventArgs e)
{
Operation oper = new Operation();//生成Operation类对象oper
Records ds = new Records();//生成Records类对象ds
ds.RecordTitle = this.txtRecordTitle.Text.Trim();//将txtRecordTitle的文本值绑定到ds的RecordTitle属性字段上
ds.RecordDetails = this.txtRecordDetails.Text.Trim();//将txtRecordDetails的文本值绑定到ds的RecordDetails属性字段上
ds.UserName = Session["UserName"].ToString();//用Session取得当前用户的用户名
ds.Allot = "0";//把定回复工程师的状态值设为0,(0为未指定工程师,1为指定了)
DateTime dt = DateTime.Now;//取得当前系统时间
ds.CreateDate = dt;
if (oper.InsertRecords(ds))
{
Response.Write("<script>alert('插入成功!');location='RecordAdd.aspx'</script>");
}
else
{
Response.Write("<script>alert('插入失败!')</script>");
}
}
protected void btnSubmis_Click(object sender, EventArgs e)
{
Operation ope = new Operation();
Research Research = new Research();
Research.UserName = Session["UserName"].ToString();
DateTime dt = DateTime.Now;
Research.ResearchDate = dt;
Research.Appraise = this.txtyijian.Text.Trim();
if (this.radButtonbumanyi.Checked)//使用单选按钮控件来判断用户对网站的满意度
{
Research.ReIdea = 0;//0为不满意
}
if (this.radButtonmanyi.Checked)
{
Research.ReIdea = 1;//1为满意
}
if (this.radButtonyiban.Checked)
{
Research.ReIdea = 2;//2为感觉一般
}
if (ope.InsertResearchInfo(Research))
{
Response.Write("<script>alert('发布成功!')</script>");
this.Panel1.Visible = true;
this.Panel2.Visible = false;
}
else
{
Response.Write("<script>alert('插入失败!')</script>");
}
}
protected void LinkButton1_Click(object sender, EventArgs e)
{
this.Label1.Text = "谢谢你的参与,您的参与将使我们的服务变的更好:";
this.Panel1.Visible = false;//用Panel1控制隐藏发布信息添加模块
this.Panel2.Visible = true;// 用Panel2控制显示服务调查信息添加模块
}
}
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -