GroupNoticeInfo _NoticeDataToInfo(NoticeData data) { GroupNoticeInfo notice = new GroupNoticeInfo(); notice.GroupID = data.GroupID; notice.Message = data.Data["Message"]; notice.noticeData = _NoticeDataToData(data); return notice; }
ExtendedGroupNoticeData _NoticeDataToData(NoticeData data) { ExtendedGroupNoticeData notice = new ExtendedGroupNoticeData(); notice.FromName = data.Data["FromName"]; notice.NoticeID = data.NoticeID; notice.Subject = data.Data["Subject"]; notice.Timestamp = uint.Parse((string)data.Data["TMStamp"]); notice.HasAttachment = data.Data["HasAttachment"] == "1" ? true : false; if (notice.HasAttachment) { notice.AttachmentName = data.Data["AttachmentName"]; notice.AttachmentItemID = new UUID(data.Data["AttachmentItemID"].ToString()); notice.AttachmentType = byte.Parse(data.Data["AttachmentType"].ToString()); notice.AttachmentOwnerID = data.Data["AttachmentOwnerID"].ToString(); } return notice; }
protected bool _AddNotice(UUID groupID, UUID noticeID, string fromName, string subject, string message, bool hasAttachment, byte attType, string attName, UUID attItemID, string attOwnerID) { NoticeData data = new NoticeData(); data.GroupID = groupID; data.NoticeID = noticeID; data.Data = new Dictionary<string, string>(); data.Data["FromName"] = fromName; data.Data["Subject"] = subject; data.Data["Message"] = message; data.Data["HasAttachment"] = hasAttachment ? "1" : "0"; if (hasAttachment) { data.Data["AttachmentType"] = attType.ToString(); data.Data["AttachmentName"] = attName; data.Data["AttachmentItemID"] = attItemID.ToString(); data.Data["AttachmentOwnerID"] = attOwnerID; } data.Data["TMStamp"] = ((uint)Util.UnixTimeSinceEpoch()).ToString(); return m_Database.StoreNotice(data); }