protected void LinkButton1_Click(object sender, EventArgs e) { if (TextBox1.Text == "") { ClientScript.RegisterStartupScript(GetType(), "", "alert('请输入您投诉的理由" + "');window.location='tousu.aspx';", true); //Response.Write("<script>alert('请输入您的投诉理由!')</script>"); return; } else { tousuModel model = new tousuModel(); model.touname = DropDownList1.SelectedItem.Text; model.toufang = Convert.ToInt32(DropDownList2.SelectedItem.Text); model.toudui = DropDownList3.SelectedItem.Text; model.touliyou = TextBox1.Text; LBH_BLL blll = new LBH_BLL(); int result = 0; result = blll.addUser(model); if (result > 0) { ClientScript.RegisterStartupScript(GetType(), "", "alert('添加成功');window.location='tousu.aspx';", true); //Response.Write("<script>alert('保存成功!')</script>"); return; } } }
protected void Repeater1_ItemCommand(object source, RepeaterCommandEventArgs e) { string cmdType = e.CommandName; string touid = e.CommandArgument.ToString(); if (cmdType == "delete") { LBH_BLL bll = new LBH_BLL(); int result = bll.delete(Convert.ToInt32(touid)); if (result > 0) { ClientScript.RegisterStartupScript(GetType(), "", "alert('处理成功');window.location='seltousu.aspx';", true); return; } else { Response.Write("<script>alert('删除失败!')</script>"); return; } } }
protected void LinkButton1_Click(object sender, EventArgs e) { if (TextBox2.Text == "") { ClientScript.RegisterStartupScript(GetType(), "", "alert('请输入您的姓名" + "');window.location='insbaoxiu.aspx';", true); //Response.Write("<script>alert('请输入您的投诉理由!')</script>"); return; } else { if (TextBox3.Text == "") { ClientScript.RegisterStartupScript(GetType(), "", "alert('请输入损坏物品的名称" + "');window.location='insbaoxiu.aspx';", true); //Response.Write("<script>alert('请输入您的投诉理由!')</script>"); return; } baoxiuModel model = new baoxiuModel(); model.baoname = TextBox2.Text; model.baofang = Convert.ToInt32(DropDownList2.SelectedItem.Text); model.wupin = TextBox3.Text; model.shijian = DateTime.Now.ToString(); //model.ischuli = Convert.ToInt32(""); LBH_BLL blll = new LBH_BLL(); int result = 0; result = blll.insbaoxiu(model); if (result > 0) { ClientScript.RegisterStartupScript(GetType(), "", "alert('添加成功');window.location='insbaoxiu.aspx';", true); //Response.Write("<script>alert('保存成功!')</script>"); return; } } }