📄 addstudentinform.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.Drawing;
using XTeamBBL;
public partial class RS_Admin_Sys_XS_Mgt_XS_info_Mgt_Addstudentinform : System.Web.UI.Page
{
protected void Page_Load(object sender, EventArgs e)
{
}
protected void AddStud_Click(object sender, EventArgs e)
{
if (Page.IsValid)
{
int classID = Convert.ToInt32(class_ID.SelectedValue.ToString());
string student_name = this.student_name.Text;
string student_num = this.student_num.Text;
string student_sex = this.student_sex.SelectedValue;
int student_age =Convert.ToInt32(this.student_age.Text.Trim());
string student_IDcard = this.student_IDcard.Text;
string student_feature = this.student_feature.Text;
string student_phone = this.student_phone.Text;
string student_born = this.student_born.Text;
string student_address = this.student_address.Text;
Boolean fileOK;
if (FileUpload1.HasFile)
{
String fileExtension = System.IO.Path.GetExtension(FileUpload1.FileName).ToLower();
String[] allowedExtension ={ ".gif", ".png", ".jpg" };
for (int i = 0; i < allowedExtension.Length; i++)
{
if (fileExtension == allowedExtension[i])
{
fileOK = true;
}
}
string student_email = this.student_email.Text;
string student_swap = this.student_swap.Text;
string enter_time = this.enter_time.Text;
string student_fun = this.student_fun.Text;
string student_intru = this.student_intru.Text;
student si = new student(classID,student_name, student_num, student_sex, student_age, student_IDcard, student_feature, student_phone, student_born, student_address,student_image.ToString(), student_email, student_swap, enter_time, student_fun, student_intru);
Boolean flag = student.Addstudentinform(si);
if (flag) Response.Write("<script>alert('添加成功');</script>");
else Response.Write("<script>alert('添加失败');</script>");
}
}
}
}
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -