急!!!帮我把这段代码加注释~!!!!
usingSystem;usingSystem.Data;usingSystem.Configuration;usingSystem.Web;usingSystem.We...
using System;
using System.Data;
using System.Configuration;
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 University.Model;
using Castle.MonoRail.Framework;
using Castle.MonoRail.Framework.Helpers;
namespace University.Controllers {
public class AdminController : BaseController {
public void index() {
this.RedirectToAction("listUser");
}
public void delUser(String ID) {
Person staff = Person.Find(ID);
staff.Delete();
this.RedirectToAction("listUser");
}
public void viewNewUser() {
}
public void newUser([DataBind("user")]Person user){
user.Create();
this.PropertyBag["NewUser"] = user;
}
public void newStudent([DataBind("user")]Student user) {
user.Create();
this.Flash["NewUser"] = user;
this.RenderView("newUser");
}
public void newStaff([DataBind("user")]Staff user) {
user.Create();
this.Flash["NewUser"] = user;
this.RenderView("newUser");
}
public void viewSearchMedical() {
}
public void searchMedical(String ID) {
MedicalInfo medical = MedicalInfo.Find(ID);
this.PropertyBag["Medical"] = medical;
}
public void search(int query_type, String[] ID, String type) {
System.Collections.ArrayList listUsers = new System.Collections.ArrayList();
Person[] users = null;
if (query_type == 0) {//按照姓名查询
if (type.Equals("学生"))
users = Student.queryByNickName(ID[query_type]);
if (type.Equals("教师"))
users = Staff.queryByNickName(ID[query_type]);
}
if (query_type == 1) {//按照 学号/教师号
if (type.Equals("学生"))
users = Student.FindAllByProperty("ID", ID[query_type]);
if (type.Equals("教师"))
users = Staff.FindAllByProperty("ID", ID[query_type]);
}
由于字数太多,剩下的一半发在下面。 展开
using System.Data;
using System.Configuration;
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 University.Model;
using Castle.MonoRail.Framework;
using Castle.MonoRail.Framework.Helpers;
namespace University.Controllers {
public class AdminController : BaseController {
public void index() {
this.RedirectToAction("listUser");
}
public void delUser(String ID) {
Person staff = Person.Find(ID);
staff.Delete();
this.RedirectToAction("listUser");
}
public void viewNewUser() {
}
public void newUser([DataBind("user")]Person user){
user.Create();
this.PropertyBag["NewUser"] = user;
}
public void newStudent([DataBind("user")]Student user) {
user.Create();
this.Flash["NewUser"] = user;
this.RenderView("newUser");
}
public void newStaff([DataBind("user")]Staff user) {
user.Create();
this.Flash["NewUser"] = user;
this.RenderView("newUser");
}
public void viewSearchMedical() {
}
public void searchMedical(String ID) {
MedicalInfo medical = MedicalInfo.Find(ID);
this.PropertyBag["Medical"] = medical;
}
public void search(int query_type, String[] ID, String type) {
System.Collections.ArrayList listUsers = new System.Collections.ArrayList();
Person[] users = null;
if (query_type == 0) {//按照姓名查询
if (type.Equals("学生"))
users = Student.queryByNickName(ID[query_type]);
if (type.Equals("教师"))
users = Staff.queryByNickName(ID[query_type]);
}
if (query_type == 1) {//按照 学号/教师号
if (type.Equals("学生"))
users = Student.FindAllByProperty("ID", ID[query_type]);
if (type.Equals("教师"))
users = Staff.FindAllByProperty("ID", ID[query_type]);
}
由于字数太多,剩下的一半发在下面。 展开
1个回答
展开全部
this.RedirectToAction("listUser"); //以字符串("listUser")为参数执行RedirectToAction方法。
Person staff = Person.Find(ID); //以ID为参数执行Person类的Find静态方法,返回相应的Person实体类
staff.Delete(); //执行staff类的删除方法,可能是实例或静态方法
this.RedirectToAction("listUser");//以字符串("listUser")为参数执行RedirectToAction方法。
user.Create(); //执行user类的Create方法,可能是实例或静态方法
this.PropertyBag["NewUser"] = user; //设定本类实例中属性包的["NewUser"]为user类
this.Flash["NewUser"] = user; //设定本类实例中Flash数组的["NewUser"]为user类
this.RenderView("newUser"); //以字符串("listUser")为参数执行RenderView实例方法。
MedicalInfo medical = MedicalInfo.Find(ID);//以ID为参数执行MedicalInfo类的Find静态方法,返回相应的MedicalInfo实体类
public void search(int query_type, String[] ID, String type) {
System.Collections.ArrayList listUsers = new System.Collections.ArrayList(); //构造一个数组listUsers
Person[] users = null; //构造一个Person类集合users
if (query_type == 0) {//按照姓名查询
if (type.Equals("学生"))
users = Staff.queryByNickName(ID[query_type]);
//从参数ID数组中下标query_type的字符串为参数,执行Staff的queryByNickName方法,返回users类
if (type.Equals("教师"))
users = Staff.queryByNickName(ID[query_type]);
//从参数ID数组中下标query_type的字符串为参数,执行Staff的queryByNickName方法,返回users类
}
if (query_type == 1) {//按照 学号/教师号
if (type.Equals("学生"))
users = Student.FindAllByProperty("ID", ID[query_type]);
//从参数ID数组中下标query_type的字符串为参数,执行Student的FindAllByProperty方法,返回users类
if (type.Equals("教师"))
users = Staff.FindAllByProperty("ID", ID[query_type]);
//从参数ID数组中下标query_type的字符串为参数,执行Student的FindAllByProperty方法,返回users类
}
this.PropertyBag["Medical"] = medical;
//设定本类实例中属性包的["Medical"]为medical
Person staff = Person.Find(ID); //以ID为参数执行Person类的Find静态方法,返回相应的Person实体类
staff.Delete(); //执行staff类的删除方法,可能是实例或静态方法
this.RedirectToAction("listUser");//以字符串("listUser")为参数执行RedirectToAction方法。
user.Create(); //执行user类的Create方法,可能是实例或静态方法
this.PropertyBag["NewUser"] = user; //设定本类实例中属性包的["NewUser"]为user类
this.Flash["NewUser"] = user; //设定本类实例中Flash数组的["NewUser"]为user类
this.RenderView("newUser"); //以字符串("listUser")为参数执行RenderView实例方法。
MedicalInfo medical = MedicalInfo.Find(ID);//以ID为参数执行MedicalInfo类的Find静态方法,返回相应的MedicalInfo实体类
public void search(int query_type, String[] ID, String type) {
System.Collections.ArrayList listUsers = new System.Collections.ArrayList(); //构造一个数组listUsers
Person[] users = null; //构造一个Person类集合users
if (query_type == 0) {//按照姓名查询
if (type.Equals("学生"))
users = Staff.queryByNickName(ID[query_type]);
//从参数ID数组中下标query_type的字符串为参数,执行Staff的queryByNickName方法,返回users类
if (type.Equals("教师"))
users = Staff.queryByNickName(ID[query_type]);
//从参数ID数组中下标query_type的字符串为参数,执行Staff的queryByNickName方法,返回users类
}
if (query_type == 1) {//按照 学号/教师号
if (type.Equals("学生"))
users = Student.FindAllByProperty("ID", ID[query_type]);
//从参数ID数组中下标query_type的字符串为参数,执行Student的FindAllByProperty方法,返回users类
if (type.Equals("教师"))
users = Staff.FindAllByProperty("ID", ID[query_type]);
//从参数ID数组中下标query_type的字符串为参数,执行Student的FindAllByProperty方法,返回users类
}
this.PropertyBag["Medical"] = medical;
//设定本类实例中属性包的["Medical"]为medical
推荐律师服务:
若未解决您的问题,请您详细描述您的问题,通过百度律临进行免费专业咨询