急!!!帮我把这段代码加注释~!!!!

2025-06-20 15:10:48
推荐回答(1个)
回答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