/// <summary> /// There are no comments for NotifyMap in the schema. /// </summary> public void AddToNotifyMap(NotifyMap notifyMap) { base.AddObject("NotifyMap", notifyMap); }
/// <summary> /// 保存添加的单位通知信息 /// </summary> public void OrgNotifySave() { int notifyType = 2; string notifyTitle = GetString("Title"); string notifyContent = GetString("Content"); if (notifyTitle != "" && notifyContent != "") { Notify notify = new Notify(); notify.NotifyType = notifyType; notify.Title = notifyTitle; notify.Content = notifyContent; notify.PublishTime = DateTime.Now; CQGJ.AddToNotify(notify); CQGJ.SaveChanges(); int notifyId = notify.NotifyID; string orgString = Request.Form["org"].ToString(); string[] orgIDList = orgString.Split(','); for (int i = 0; i < orgIDList.Length; i++) { string orgIDCode = orgIDList[i]; NotifyMap nm = new NotifyMap(); try { nm.Notify = (from n in CQGJ.Notify where n.NotifyID == notifyId select n).First(); } catch { // } nm.NotifyMapType = 1; nm.ObjectID = ToOrgID(orgIDCode); CQGJ.AddToNotifyMap(nm); CQGJ.SaveChanges(); } } RedirectToAction("OrgList"); }
/// <summary> /// Create a new NotifyMap object. /// </summary> /// <param name="mapID">Initial value of MapID.</param> /// <param name="notifyMapType">Initial value of NotifyMapType.</param> public static NotifyMap CreateNotifyMap(int mapID, int notifyMapType) { NotifyMap notifyMap = new NotifyMap(); notifyMap.MapID = mapID; notifyMap.NotifyMapType = notifyMapType; return notifyMap; }
/// <summary> /// 保存添加的班级通知信息 /// </summary> public void NotifySave() { int notifyType = 1; string notifyTitle = GetString("Title"); string notifyContent = GetString("Content"); if (notifyTitle != "" && notifyContent != "") { Notify notify = new Notify(); notify.NotifyType = notifyType; notify.Title = notifyTitle; notify.Content = notifyContent; notify.PublishTime = DateTime.Now; CQGJ.AddToNotify(notify); CQGJ.SaveChanges(); int notifyId = notify.NotifyID; string classesString = Request.Form["classes"].ToString(); string[] classIDList = classesString.Split(','); for (int i = 0; i < classIDList.Length; i++) { string classID = classIDList[i].ToString(); NotifyMap nm = new NotifyMap(); try { nm.Notify = (from n in CQGJ.Notify where n.NotifyID == notifyId select n).First(); } catch { // } nm.NotifyMapType = 1; nm.ObjectID = int.Parse(classID); CQGJ.AddToNotifyMap(nm); CQGJ.SaveChanges(); } RedirectToAction("ClassesList"); } }