public ActionResult Create(TimeLineInfo info) { if (string.IsNullOrEmpty(info.Detail)) { return(Json(new APIJson(-1, "总得写点东西吧"))); } ResearchInfo infoResearch = ResearchBLL.GetList(a => a.ID == info.ResearchID).FirstOrDefault(); if (null == infoResearch || infoResearch.UserID != CurrentUser.ID) { return(Json(new APIJson(-1, "提交失败,数据有误"))); } info.CreateDate = DateTime.Now; string checkboxUser = Function.GetRequestString("checkboxUser"); info.UserInfo = new List <UserInfo>(); foreach (var item in checkboxUser.Split(',')) { int ID = Function.ConverToInt(item); if (ID <= 0) { continue; } UserInfo u = UserBLL.GetList(a => a.ID == ID).FirstOrDefault(); if (null != u && !info.UserInfo.Any(a => a.ID == ID)) { info.UserInfo.Add(u); } } if (TimeLineBLL.Create(info).ID > 0) { return(Json(new APIJson(0, "提交成功,分享到微信中时,你现在可以打开右上角菜单进行分享了", new { info.ID }))); } return(Json(new APIJson(-1, "提交失败,请重试"))); }
public ActionResult Detail(int ID) { ResearchInfo info = ResearchBLL.GetList(a => a.ID == ID).FirstOrDefault(); if (null == info || info.ResearchPlanInfo.TypeEnum != (int)SysEnum.ResearchPlanType.组织调研) { return(RedirectToAction("Msg", "CommPage", new { Title = "好像没有这样一个听课反馈窝" })); } string GoBack = Function.GetRequestString("GoBack"); if (string.IsNullOrEmpty(GoBack)) { GoBack = Url.Action("index", new { PlanID = info.ResearchPlanID }); } infoHead.LeftURL = null == Url ? "" : GoBack; ViewBag.listResearchNote = info.ResearchNoteInfo.ToList() .Select(a => new { a.ID, a.Detail, a.CreateDate, ImageJSON = ResearchNoteAttachmentBLL.GetImageJSON(a, "image"), AudioJSON = ResearchNoteAttachmentBLL.GetImageJSON(a, "audio") }); return(View(info)); }
public ActionResult ListLectureUser(int page = 1) { var list = ResearchBLL.GetList(a => a.lectureUserID == CurrentUser.ID); list = list.OrderByDescending(a => a.ResearchPlanID); var result = list.ToPagedList(page, PageSize); return(View(result)); }
public ActionResult index(int ResearchID) { ResearchInfo info = ResearchBLL.GetList(p => p.ID == ResearchID).FirstOrDefault(); var listResearchNote = info.ResearchNoteInfo.OrderByDescending(a => a.ID).ToList() .Select(a => new { a.ID, a.Detail, CreateDate = a.CreateDate.ToString("yyyy-MM-dd HH:mm"), ImageJSON = ResearchNoteAttachmentBLL.GetImageJSON(a, "image"), AudioJSON = ResearchNoteAttachmentBLL.GetImageJSON(a, "audio") }); return(Json(new APIJson(0, "", listResearchNote), JsonRequestBehavior.AllowGet)); }
public ActionResult Create(ResearchInfo info) { var infoExist = ResearchBLL.GetList(a => a.ResearchPlanID == info.ResearchPlanID && a.UserID == CurrentUser.ID && a.ClassName == info.ClassName && a.GradeName == info.GradeName && a.LessionNumber == info.LessionNumber ).FirstOrDefault(); if (null != infoExist) { return(Json(new APIJson(2, "您还在听评当前课程,将直接进入", new { infoExist.ID }))); } info.UserID = CurrentUser.ID; //info.ResearchPlanID //info.SubjectID if (string.IsNullOrEmpty(info.Topic)) { return(Json(new APIJson(-1, "请填写课题"))); } if (string.IsNullOrEmpty(info.ClassName)) { return(Json(new APIJson(-1, "请填写年级"))); } if (string.IsNullOrEmpty(info.GradeName)) { return(Json(new APIJson(-1, "请填写班级"))); } if (info.SubjectID <= 0) { return(Json(new APIJson(-1, "请选择学科"))); } if (info.lectureUserID <= 0) { return(Json(new APIJson(-1, "教师不存在,请输入教师姓名关键字,并点击提示结果"))); } info.SubjectiveOpinion = string.Empty; info.NoteMemo = string.Empty; info.Status = (int)SysEnum.ResearchStatus.未评; info.ScoreTotal = 0; info.ScoreLever = (int)SysEnum.ResearchScoreLever.合格; info.CreateDate = DateTime.Now; ResearchBLL.Create(info); if (info.ID > 0) { return(Json(new APIJson(0, "新听评课事项创建成功", new { info.ID }))); } return(Json(new APIJson(-1, "创建失败,请重试"))); }
public ActionResult Delete(int id) { var info = ResearchBLL.GetList(p => p.ID == id).FirstOrDefault(); if (null == info) { return(Json(new APIJson(-1, "删除失败,参数有误", info))); } if (ResearchBLL.Delete(info)) { return(Json(new APIJson(0, "删除成功", info))); } return(Json(new APIJson(-1, "删除失败,请重试", info))); }
public ActionResult ResearchS() { DateTime DateBegin = Function.GetRequestDateTime("DateBegin"); DateTime DateEnd = Function.GetRequestDateTime("DateEnd"); int SubjectID = Function.GetRequestInt("SubjectID"); string Name = Function.GetRequestString("Name"); var listUser = UserBLL.GetList(a => a.Enable); var listResearch = ResearchBLL.GetList(a => true); if (SubjectID > 0) { listUser = listUser.Where(a => a.SubjectInfo.Select(s => s.ID).Contains(SubjectID)); ViewBag.DdlSubject = SubjectID; } if (!string.IsNullOrEmpty(Name)) { listUser = listUser.Where(a => a.Name.Contains(Name) || a.WechatNameNick.Contains(Name)); ViewBag.TxtName = Name; } var listUserFinal = listUser.ToList().Where(a => PowerActionBLL.PowerCheck(PowerInfo.P_评课管理.PP组织调研.PPP听评课管理.KEY, a)); if (DateBegin != DicInfo.DateZone) { listResearch = listResearch.Where(a => DbFunctions.DiffDays(a.ResearchPlanInfo.DateBegin, DateBegin) <= 0); ViewBag.TxtDateBegin = DateBegin.ToString("yyyy-MM-dd"); } if (DateEnd != DicInfo.DateZone) { listResearch = listResearch.Where(a => DbFunctions.DiffDays(a.ResearchPlanInfo.DateBegin, DateEnd) >= 0); ViewBag.TxtDateEnd = DateEnd.ToString("yyyy-MM-dd"); } var templistUserFinalIDs = listUserFinal.Select(u => u.ID); listResearch = listResearch.Where(a => templistUserFinalIDs.Contains(a.UserID)); ViewBag.listResearch = listResearch; ViewBag.listUserFinal = listUserFinal; return(View()); }
public ActionResult Edit(int ID) { infoHead.LeftURL = Url.Action("Detail", new { ID = ID }); ResearchInfo info = ResearchBLL.GetList(a => a.ID == ID).FirstOrDefault(); if (null == info || info.ResearchPlanInfo.TypeEnum != (int)SysEnum.ResearchPlanType.组织调研) { return(RedirectToAction("Msg", "CommPage", new { Title = "好像没有这样一个听课反馈窝" })); } ViewBag.listResearchNote = info.ResearchNoteInfo.ToList() .Select(a => new { a.ID, a.Detail, a.CreateDate, ImageJSON = ResearchNoteAttachmentBLL.GetImageJSON(a, "image"), AudioJSON = ResearchNoteAttachmentBLL.GetImageJSON(a, "audio") }); return(View(info)); }
public ActionResult ResearchS_Detail(int SubjectID, int UserID, SysEnum.ResearchPlanType researchPlanType, DateTime?DateBegin = null, DateTime?DateEnd = null) { ViewBag.SubjectInfo = SubjectBLL.GetList(a => a.ID == SubjectID).FirstOrDefault(); ViewBag.UserInfo = UserBLL.GetList(a => a.ID == UserID).FirstOrDefault(); ViewBag.researchPlanType = researchPlanType; var list = ResearchBLL.GetList(a => true); list = list.Where(a => a.SubjectID == SubjectID); list = list.Where(a => a.UserID == UserID); if (null != DateBegin) { list = list.Where(a => DbFunctions.DiffDays(a.ResearchPlanInfo.DateBegin, DateBegin) <= 0); } if (null != DateEnd) { list = list.Where(a => DbFunctions.DiffDays(a.ResearchPlanInfo.DateEnd, DateEnd) >= 0); } list = list.Where(a => a.ResearchPlanInfo.TypeEnum == (int)researchPlanType); return(View(list)); }
/// <summary> /// 学校教师调研报表 /// </summary> public ActionResult ResearchLectureUser() { int DepartmentID = Function.GetRequestInt("DepartmentID"); int SubjectID = Function.GetRequestInt("SubjectID"); int LectureUserID = Function.GetRequestInt("LectureUserID"); int EvalTemplateID = Function.GetRequestInt("EvalTemplateID"); DateTime DateBegin = Function.GetRequestDateTime("DateBegin"); DateTime DateEnd = Function.GetRequestDateTime("DateEnd"); if (EvalTemplateID <= 0) { EvalTemplateID = EvalTemplateBLL.GetList(a => a.Enable).OrderByDescending(a => a.ID).FirstOrDefault().ID; } ViewBag.infoEvalTemplate = EvalTemplateBLL.GetList(a => a.ID == EvalTemplateID).FirstOrDefault(); ViewBag.DdlEvalTemplateID = EvalTemplateID; ViewBag.listEvalTempate = EvalTemplateBLL.GetList(a => true).OrderByDescending(a => a.ID).ToList() .Select(a => new SelectListItem() { Text = a.Name, Value = a.ID.ToString() }); var listDepartment = DepartmentBLL.GetList(a => true); if (!PowerActionBLL.PowerCheck(PowerInfo.P_评课管理.PP组织调研.PPP听评课管理.查看所有学校)) { listDepartment = listDepartment.Where(a => a.ID == CurrentUser.DepartmentID); DepartmentID = CurrentUser.DepartmentID; } ViewBag.listDepartment = listDepartment.Select(a => new SelectListItem() { Text = a.Name, Value = a.ID.ToString() }); ViewBag.DdlDepartmentID = DepartmentID; ViewBag.DdlSubjectID = SubjectID; ViewBag.LectureUserID = LectureUserID; if (DateBegin > DicInfo.DateZone) { ViewBag.TxtDateBegin = DateBegin.ToString("yyyy-MM-dd"); } if (DateEnd > DicInfo.DateZone) { ViewBag.TxtDateEnd = DateEnd.ToString("yyyy-MM-dd"); } ViewBag.EvalTemplateID = EvalTemplateID; var listResearch = ResearchBLL.GetList(a => a.UserInfo.SubjectInfo.Any(s => s.ID == a.SubjectID)); if (LectureUserID > 0) { listResearch = listResearch.Where(a => a.lectureUserID == LectureUserID); var infoLectureUser = UserBLL.GetList(a => a.ID == LectureUserID).FirstOrDefault(); if (null != infoLectureUser) { ViewBag.TxtLectureUserID = infoLectureUser.Name; ViewBag.infoLectureUser = infoLectureUser; } } else { listResearch = listResearch.Where(a => false); } return(View(listResearch)); }
public ActionResult Edit(ResearchInfo info) { bool IsConfirm = Function.GetRequestString("HidenIsConfirm") == "true"; string EditProp = Function.GetRequestString("EditProp");///仅更新哪些字段 TemplateItem:评价项|SubjectiveOpinion主观评价|null 所有 ResearchInfo infoExist = ResearchBLL.GetList(a => a.ID == info.ID).FirstOrDefault(); if (null == infoExist || infoExist.UserID != CurrentUser.ID) { return(Json(new APIJson(-1, "数据非法。这不是你的评课数据"))); } if (EditProp == "TemplateItem" || string.IsNullOrEmpty(EditProp)) { foreach (var item in infoExist.ResearchPlanInfo.EvalTemplateInfo.TemplateItemInfo) { ResearchItemInfo infoItemExist = infoExist.ResearchItemInfo.FirstOrDefault(a => a.TemplateItemID == item.ID); if (null == infoItemExist) { infoItemExist = new ResearchItemInfo(); infoItemExist.ResearchID = infoExist.ID; infoItemExist.TemplateItemID = item.ID; infoExist.ResearchItemInfo.Add(infoItemExist); } infoItemExist.ScoreValue = Function.GetRequestInt("TxtEvalTemplate" + item.ID, -1); if (infoItemExist.ScoreValue < 0) { return(Json(new APIJson(-1, string.Format("请完善评价项 {0}", item.Name)))); } if (infoExist.ResearchPlanInfo.EvalTemplateInfo.TypeFlag == (int)SysEnum.TemplateTypeFlag.分值模板) { if (infoItemExist.ScoreValue > item.MaxScore) { return(Json(new APIJson(-1, string.Format("评价项 {0}最高给分不能超过{1} ", item.Name, item.MaxScore)))); } } } infoExist.ScoreTotal = infoExist.ResearchItemInfo.Sum(a => a.ScoreValue); infoExist.ScoreLever = 0; } if (EditProp == "SubjectiveOpinion" || string.IsNullOrEmpty(EditProp)) { infoExist.SubjectiveOpinion = info.SubjectiveOpinion; infoExist.NoteMemo = info.NoteMemo; if (null == infoExist.SubjectiveOpinion) { infoExist.SubjectiveOpinion = string.Empty; } if (null == infoExist.NoteMemo) { infoExist.NoteMemo = string.Empty; } } if (IsConfirm) { infoExist.Status = (int)SysEnum.ResearchStatus.已确认; if (infoExist.ResearchPlanInfo.TypeEnum == (int)SysEnum.ResearchPlanType.个人听课) { infoExist.ResearchPlanInfo.Status = (int)SysEnum.ResearchPlanStatus.已结束; } } else if (infoExist.Status != (int)SysEnum.ResearchStatus.已确认) { infoExist.Status = (int)SysEnum.ResearchStatus.待确认; } if (ResearchBLL.Edit(infoExist)) { string SuccessMsg = "评价保存成功"; if (infoExist.Status != (int)SysEnum.ResearchStatus.已确认) { // SuccessMsg += "。你还需对你的评价项进行确认提交"; } else { SuccessMsg += "。你已进行确认完成了此项评课活动"; } return(Json(new APIJson(0, SuccessMsg))); } else { return(Json(new APIJson(-1, "提交失败了,请重试"))); } }
public ActionResult Create(ResearchPlanInfo info) { #region 计划对象ResearchPlanInfo info.Name = string.Format("{0}听评{1}", CurrentUser.Name, SysEnum.GetName(typeof(SysEnum.ResearchArea), info.AreaID)); if (string.IsNullOrEmpty(info.Memo)) { info.Memo = string.Empty; } if (info.DateBegin.Date < DateTime.Now.Date) { return(Json(new APIJson("日期有误"))); } if (info.TemplateID <= 0) { return(Json(new APIJson("请选择评价模板"))); } info.CategoryID = PlanCategoryPersonalID; info.Address = string.Empty; info.DateEnd = info.DateBegin; info.TypeEnum = (int)SysEnum.ResearchPlanType.个人听课; info.CreateUserID = CurrentUser.ID; info.CreateDate = DateTime.Now; info.Status = (int)SysEnum.ResearchPlanStatus.进行中; info.SummaryDetail = string.Empty; info.SummaryUserName = string.Empty; #endregion #region 听评课对象ResearchInfo var infoResearch = new ResearchInfo(); infoResearch.UserID = CurrentUser.ID; infoResearch.SubjectID = Function.GetRequestInt("SubjectID"); infoResearch.lectureUserID = Function.GetRequestInt("lectureUserID", 0); infoResearch.Topic = Function.GetRequestString("Topic"); infoResearch.LessionNumber = Function.GetRequestInt("LessionNumber"); infoResearch.ClassName = Function.GetRequestString("ClassName"); infoResearch.GradeName = Function.GetRequestString("GradeName"); infoResearch.SubjectiveOpinion = string.Empty; infoResearch.NoteMemo = string.Empty; infoResearch.Status = (int)SysEnum.ResearchStatus.未评; infoResearch.ScoreTotal = 0; infoResearch.ScoreLever = (int)SysEnum.ResearchScoreLever.合格; infoResearch.CreateDate = DateTime.Now; var infoExist = ResearchBLL.GetList(a => DbFunctions.DiffDays(a.CreateDate, infoResearch.CreateDate) == 0 && a.ResearchPlanID == infoResearch.ResearchPlanID && a.UserID == CurrentUser.ID && a.ClassName == infoResearch.ClassName && a.GradeName == infoResearch.GradeName && a.LessionNumber == infoResearch.LessionNumber ).FirstOrDefault(); if (null != infoExist) { return(Json(new APIJson(2, "您还在听评当前课程,将直接进入", new { PlanID = infoExist.ResearchPlanID, ResearchID = infoExist.ID }))); } //infoResearch.ResearchPlanID //infoResearch.SubjectID if (string.IsNullOrEmpty(infoResearch.Topic)) { return(Json(new APIJson(-1, "请填写课题"))); } if (string.IsNullOrEmpty(infoResearch.ClassName)) { return(Json(new APIJson(-1, "请填写年级"))); } if (string.IsNullOrEmpty(infoResearch.GradeName)) { return(Json(new APIJson(-1, "请填写班级"))); } if (infoResearch.SubjectID <= 0) { return(Json(new APIJson(-1, "请选择学科"))); } SubjectInfo infoSubject = SubjectBLL.GetList(a => a.ID == infoResearch.SubjectID).FirstOrDefault(); if (null == infoSubject) { return(Json(new APIJson(-1, "请选择学科"))); } infoResearch.SubjectInfo = infoSubject; infoResearch.SubjectiveOpinion = string.Empty; infoResearch.NoteMemo = string.Empty; infoResearch.Status = (int)SysEnum.ResearchStatus.未评; infoResearch.ScoreTotal = 0; infoResearch.ScoreLever = (int)SysEnum.ResearchScoreLever.合格; infoResearch.ResearchPlanInfo = info; info.ResearchInfo.Add(infoResearch); #endregion if (!CreatePConfirmDepartmentID(info)) { return(Json(new APIJson(-1, "请认真输放学校信息,对于系统未录入的学校,请务必认真输入全名"))); } if (!CreatePConfirmlectureUserID(infoResearch)) { return(Json(new APIJson(-1, "请认真输放听课对象,对于系统未录入的老师,请务必认真填写其姓名"))); } if (ResearchPlanBLL.Create(info).ID > 0) { return(Json(new APIJson(0, "提交成功", new { PlanID = info.ID, ResearchID = infoResearch.ID }))); } return(Json(new APIJson(-1, "提交失败,请重试"))); }