Esempio n. 1
0
        public ActionResult DoneReply(int id)  //答辩给分
        {
            int     tid = Convert.ToInt32(Request.Cookies["userID"].Value);
            directs d   = db.direct_table.Single(c => c.teacherID == tid && c.stuID == id);
            reply   r   = db.reply_table.Single(c => c.teacherID == tid && c.stuID == id);

            r.score = Convert.ToDouble(Request.Form["myScore"].ToString());
            db.SaveChanges();
            return(RedirectToAction("Reply"));
        }
Esempio n. 2
0
        public ActionResult DoTutorAlloc(int id)   //提交指导老师分配
        {
            var a       = db.user_table.First(c => c.ID == id);
            var student = (from p in db.user_table
                           where p.academy == a.academy && p.roleID == 0
                           select p).ToArray();

            for (int i = 0; i < student.Length; i++)
            {
                var      str    = student[i].ID.ToString();
                string[] values = Request.Form.GetValues(str);  //????假定每个学生对应的复选框组名称为学号
                for (int j = 0; j < values.Count(); j++)
                {
                    directs d = new directs();
                    d.stuID = student[i].ID;
                    //var u = db.user_table.First(c => c.name == values[i]);  //复选框值为老师姓名
                    //d.teacherID = u.ID;
                    d.teacherID = int.Parse(values[i]);      //复选框值为老师工号
                    db.direct_table.Add(d);
                    db.SaveChanges();
                }
            }
            return(tutorAllocResult(id));    //显示结果
        }