protected void Zhuce_Click(object sender, EventArgs e) { Student stu = new Student(); if (!HeFaXingJianCe()) { HeFa.Text = "该ID非法"; return; } setInFor(stu); Admin a = new Admin(); a.Id = Xuehao.Text; a.Password = "******"; a.Privilege = 0; AdminBLL.Add(a); bool bo = StudentBLL.Add(stu); SystemLog sl = new SystemLog(System.Environment.UserName, "AddStudent", "successed", Page.Request.UserHostAddress); BLLSaveLog.AddSL(sl); if (stu.Main) { YiChang.Text = "赋值成功"; } else { YiChang.Text = bo.ToString(); } //YiChang.Text = bo.ToString(); Response.Redirect("StuInforShow.aspx?id=" + stu.Id); }
protected void Button1_Click(object sender, EventArgs e) { if (AdminBLL.Delete(name) && StudentBLL.Delete(name)) { SystemLog sl = new SystemLog(System.Environment.UserName, "DelAdmin", "successed", Page.Request.UserHostAddress); BLLSaveLog.AddSL(sl); Response.Redirect("AdminList.aspx"); } else { SystemLog sl = new SystemLog(System.Environment.UserName, "DelAdmin", "failed", Page.Request.UserHostAddress); BLLSaveLog.AddSL(sl); Response.Write("<script>alert('删除失败');history.back();</script>"); } }
protected void Shanchu_Click(object sender, EventArgs e) { try { int x = int.Parse(GetXuehaoS.Text); StudentBLL.Delete(x); AdminBLL.Delete(x.ToString()); Shanchujieguo.Text = "删除成功"; SystemLog sl = new SystemLog(System.Environment.UserName, "DelStudent", "successed", Page.Request.UserHostAddress); BLLSaveLog.AddSL(sl); } catch { Shanchujieguo.Text = "删除失败"; SystemLog sl = new SystemLog(System.Environment.UserName, "DelStudent", "failed", Page.Request.UserHostAddress); BLLSaveLog.AddSL(sl); return; } }
protected void Button1_Click(object sender, EventArgs e) { Score s = new Score(); s.Sid = sid; s.Scores = int.Parse(TextBox1.Text); if (ScoreBLL.Update(s)) { SystemLog sl = new SystemLog(System.Environment.UserName, "UpdateScore", "successed", Page.Request.UserHostAddress); BLLSaveLog.AddSL(sl); Response.Redirect("GradeList.aspx"); } else { SystemLog sl = new SystemLog(System.Environment.UserName, "UpdateScore", "failed", Page.Request.UserHostAddress); BLLSaveLog.AddSL(sl); Response.Write("<script>alert('修改失败');history.back();</script>"); } }
protected void Zhuce_Click(object sender, EventArgs e) { x.Id = getId(); x.Name = Xingming.Text; x.Grade = GradeNew.Text; x.Major = Zhuanye.Text; x.Classes = Banji.Text; x.College = Xueyuan.Text; x.Political = Zhengzhi.Text; x.DayRuxue = Ruxueriqi.Text; x.Text = Beizhu.Text; if (Picture.HasFile) { Picture.SaveAs(Server.MapPath("~/images/") + Picture.FileName); x.Imgurl = Picture.FileName; } bool a = StudentBLL.Revise(x); SystemLog sl = new SystemLog(System.Environment.UserName, "UpdateStudent", "successed", Page.Request.UserHostAddress); BLLSaveLog.AddSL(sl); Yichang.Text = x.Id.ToString(); }
protected void Button1_Click(object sender, EventArgs e) { string uid = TextBox1.Text; string pwd = TextBox2.Text; int pri = 0; Admin a = new Admin(); a.Id = uid; a.Password = pwd; a.Privilege = pri; if (AdminBLL.Add(a)) { SystemLog sl = new SystemLog(System.Environment.UserName, "AddAdmin", "successed", Page.Request.UserHostAddress); BLLSaveLog.AddSL(sl); Response.Redirect("AdminList.aspx"); } else { SystemLog sl = new SystemLog(System.Environment.UserName, "AddAdmin", "failed", Page.Request.UserHostAddress); BLLSaveLog.AddSL(sl); Response.Write("<script>alert('添加错误');history.back();</script>"); } }
protected void Button1_Click(object sender, EventArgs e) { cid = int.Parse(DropDownList1.SelectedItem.Text); stuid = TextBox2.Text; scores = int.Parse(TextBox1.Text); Score s = new Score(); s.Cid = cid; s.Stuid = stuid; s.Scores = scores; if (ScoreBLL.Add(s)) { SystemLog sl = new SystemLog(System.Environment.UserName, "AddScore", "success", Page.Request.UserHostAddress); BLLSaveLog.AddSL(sl); Response.Redirect("GradeList.aspx"); } else { SystemLog sl = new SystemLog(System.Environment.UserName, "AddScore", "failed", Page.Request.UserHostAddress); BLLSaveLog.AddSL(sl); Response.Write("<script>alert('添加失败');history.back();</script>"); } }