//班级任务删除 public int DeleteClassTask(int userLevel, int taskid) { string where = "ClassId = " + taskid; if (userLevel == 0) { DALT_ClassTask_Stu csDal = new DALT_ClassTask_Stu(); csDal.DeleteWhere(where); } else { DALT_ClassTask_Tea csDal = new DALT_ClassTask_Tea(); csDal.DeleteWhere(where); } DALT_Event_ClassTask ectDal = new DALT_Event_ClassTask(); T_Event_ClassTask item = new T_Event_ClassTask(); item = ectDal.GetModel(taskid); if (item.IsAllStuTask == 0) { DALT_Event_StuClassTask escDal = new DALT_Event_StuClassTask(); where = "ClassTaskId = " + taskid; escDal.DeleteWhere(where); } ectDal.Delete(taskid); return(1); }
public string GetOneClassTask(int userLevel, int taskid, int userid, int classid) { DALT_Event_ClassTask dal = new DALT_Event_ClassTask(); T_Event_ClassTask item = dal.GetModel(taskid); int canEdit = dal.CanEdit(userLevel, userid, taskid); string allstudents = GetAllStu(classid); #region 连接传回数据 string res = "["; int taskAlert = 0; if (item.IsAlert != 0) { taskAlert = (int)item.AlertTime; } string students = ""; if (item.IsAllStuTask != 1) { //部分学生 DALT_Event_StuClassTask escDal = new DALT_Event_StuClassTask(); students = escDal.GetStus(taskid); } res += "{\"type\":\"" + item.Type + "\",\"des\":\"" + item.Description + "\",\"taskAlert\":\"" + taskAlert + "\",\"students\":\"" + students + "\",\"canEdit\":\"" + canEdit + "\",\"allstudents\":\"" + allstudents + "\",\"isAll\":\"" + item.IsAllStuTask + "\"}"; res += ","; if (res.Count() >= 1) { res = res.Substring(0, res.Count() - 1); } res += "]"; #endregion return(res); }