public JsonResult ChangeStudentScore(T.Models.Stu_Score studentInfo) { Commen.ReturnValue returnval = new Commen.ReturnValue(0, "修改成功!", ""); var change = _sco.ChangeStuScore(studentInfo); if (change) { return(Json(returnval)); } else { returnval.Success = 1; returnval.Message = "修改失败!"; return(Json(returnval)); } }
/// <summary> /// 修改学生信息 /// </summary> /// <param name="student"></param> /// <returns></returns> public bool ChangeStuScore(T.Models.Stu_Score student) { string stuNum = student.stuNum.ToString(); string stuName = student.stuName; float stuTime = Convert.ToSingle(student.stuTime); float chinese = Convert.ToSingle(student.chinese); float math = Convert.ToSingle(student.math); float english = Convert.ToSingle(student.english); float history = Convert.ToSingle(student.history); float geography = Convert.ToSingle(student.geography); float political = Convert.ToSingle(student.political); float physics = Convert.ToSingle(student.physics); float chemistry = Convert.ToSingle(student.chemistry); float biology = Convert.ToSingle(student.biology); return(dal.ChangeStuScore(stuNum, stuName, stuTime, chinese, math, english, history, geography, political, physics, chemistry, biology)); }
public JsonResult AddStudentScoreInformation(T.Models.Stu_Score studentInfo) { Commen.ReturnValue returnValue = new Commen.ReturnValue(0, "增加成功!", ""); var IsTrueOrFalse = _sco.AddStudent(studentInfo); if (IsTrueOrFalse) { return(Json(returnValue)); } else { returnValue.Success = 1; returnValue.Message = "增加失败!"; return(Json(returnValue)); } }
/// <summary> /// 增加学生信息 /// </summary> /// <param name="student"></param> /// <returns></returns> public bool AddStudent(T.Models.Stu_Score student) { float ID = Convert.ToSingle(dal.GetMaxID()); float stuNum = Convert.ToSingle(student.stuNum); string stuName = student.stuName; float stuTime = Convert.ToSingle(student.stuTime); float chinese = Convert.ToSingle(student.chinese); float math = Convert.ToSingle(student.math); float english = Convert.ToSingle(student.english); float history = Convert.ToSingle(student.history); float geography = Convert.ToSingle(student.geography); float political = Convert.ToSingle(student.political); float physics = Convert.ToSingle(student.physics); float chemistry = Convert.ToSingle(student.chemistry); float biology = Convert.ToSingle(student.biology); return(dal.AddStudent(ID, stuNum, stuName, stuTime, chinese, math, english, history, geography, political, physics, chemistry, biology)); }