public ActionResult Add(Leave leave) { leave.StaffNo = Session["StaffNo"].ToString(); leave.StaffName = Session["UserName"].ToString(); int state = 1; leave.LeaveState = state.ToString(); int result = BLL.Add(leave); if (result > 0) { Response.Write("<script>alert('添加成功');location.href='/Leave/Index';</script>"); } return(View()); }