public static bool GiveNoticeToDegreeAuditor(string userid, string instituteName, string degreeName) { string title = "学院\"" + instituteName + "\"有新的学位申请"; string content = "有新的学位申请,请尽快进入\"学院管理\"的\"学院维护\"频道,审批这些申请。<br>\n申请学院:" + instituteName + "<br>\n申请学位:" + degreeName; GE.MyLearning.BL.Notices notice = GetNoticeByTitle(userid, title); if (notice != null) { notice.CreateTime = DateTime.Now; notice.UserReadTime = null; notice.NoticeDetail = content; DataRepository.NoticesProvider.Update(notice); } else { CreateNotice("", userid, title, content, NoticeType.ApplyDegree); } return(true); }
public static bool GiveNoticeToDegreeStudent(int studentid, bool state) { bool returnValue = false; GE.MyLearning.BL.Students student = DataRepository.StudentsProvider.GetByStudentId(studentid); if (student == null) { return(returnValue); } Degrees degree = DataRepository.DegreesProvider.GetByDegreeId(student.DegreeId); if (degree == null) { return(returnValue); } GE.MyLearning.BL.Institutes institute = DataRepository.InstitutesProvider.GetByInstituteId(degree.InstituteId); if (institute == null) { return(returnValue); } string title = "您于" + student.CreateTime.Value.ToLongDateString() + "申请的学位\"" + degree.DegreeName + "\"" + (state ? "已被批准" : "被拒绝"); string[] info = new string[] { title, "<br><br>申请学院:", institute.InstituteName, "<br>申请学位:", degree.DegreeName, "<br>申请时间:", student.CreateTime.ToString(), "<br>审批结果:", state ? "<span style='color:green'>批准</span>" : "<span style='color:red'>拒绝</span>" }; string content = string.Concat(info); GE.MyLearning.BL.Notices notice = GetNoticeByTitle(student.UserId, title); if (notice != null) { notice.CreateTime = DateTime.Now; notice.UserReadTime = null; notice.NoticeDetail = content; DataRepository.NoticesProvider.Update(notice); } else { CreateNotice("", student.UserId, title, content, NoticeType.DegreeAuditingComplete); } return(true); }
public static GE.MyLearning.BL.Notices CreateNotice(string from, string to, string title, string content, NoticeType type) { GE.MyLearning.BL.Notices data = NoticesBase.CreateNotices(title, content, (int)type, to, null, DateTime.Now, from, 0); DataRepository.NoticesProvider.Insert(data); return(data); }