/// <summary> /// /// </summary> /// <param name="noticeType"></param> /// <param name="versionId"></param> public NoticeMessage(NoticeType noticeType, int versionId) :base(false) { _id = Guid.NewGuid(); _noticeType = noticeType; VersionId = versionId; }
/// <summary> /// /// </summary> /// <param name="noticeType"></param> /// <param name="versionId"></param> public NoticeMessage(NoticeType noticeType, int versionId) : base(AccessLevel.ReadWrite) { _id = Guid.NewGuid(); _noticeType = noticeType; VersionId = versionId; }
public static void Show(string message, NoticeType type) { WarehouseMainPage holderPage = MainHandlers.GetMainPage(); if (holderPage != null) { Notice notice = new Notice(); notice.Message = message; notice.Type = (long)type; holderPage.Notices.Add(notice); } }
public ActionResult Delete(NoticeType ntype, int curPage) { resp = noticeService.DeleteNotice(Request); return this.JudgeResult(resp, () => RedirectToAction("Details", new { ntype = NoticeType.ASSOCIATION, curpage = curPage, msg = string.Format("删除公告完成") })); }
/// <summary> /// 创建广播消息对象 /// </summary> /// <param name="noticeType">类型</param> /// <param name="content">内容</param> /// <param name="title">标题</param> /// <param name="expiryDate">过期时间</param> /// <returns></returns> public NoticeMessage Create(NoticeType noticeType, string content, string title, DateTime expiryDate) { return new NoticeMessage(noticeType, Version.NextId) { Content = content, SendDate = MathUtils.Now, Title = title, ExpiryDate = expiryDate }; }
/// <summary> /// Broadcasts Notice in region. /// </summary> /// <param name="region"></param> /// <param name="type"></param> /// <param name="duration"></param> /// <param name="format"></param> /// <param name="args"></param> public static void Notice(Region region, NoticeType type, int duration, string format, params object[] args) { var packet = new Packet(Op.Notice, MabiId.Broadcast); packet.PutByte((byte)type); packet.PutString(string.Format(format, args)); if (duration > 0) { packet.PutInt(duration); } region.Broadcast(packet); }
/// <summary> /// Sends Notice to creature's client. /// </summary> /// <param name="creature"></param> /// <param name="type"></param> /// <param name="duration">Ignored if 0</param> /// <param name="format"></param> /// <param name="args"></param> public static void Notice(Creature creature, NoticeType type, int duration, string format, params object[] args) { var packet = new Packet(Op.Notice, MabiId.Broadcast); packet.PutByte((byte)type); packet.PutString(string.Format(format, args)); if (duration > 0) { packet.PutInt(duration); } creature.Client.Send(packet); }
/// <summary> /// Broadcasts Notice to every player in any region. /// </summary> /// <param name="type"></param> /// <param name="duration">Ignored if 0</param> /// <param name="format"></param> /// <param name="args"></param> public static void Notice(NoticeType type, int duration, string format, params object[] args) { var packet = new Packet(Op.Notice, MabiId.Broadcast); packet.PutByte((byte)type); packet.PutString(string.Format(format, args)); if (duration > 0) { packet.PutInt(duration); } ChannelServer.Instance.World.Broadcast(packet); }
private static string GetTitleFromType(NoticeType type) { string title; switch (type) { case NoticeType.PlayerConnected: { title = "Player connected!"; break; } case NoticeType.NextMapSelected: { title = "Next map selected!"; break; } case NoticeType.MapChanged: { title = "Map has changed"; break; } case NoticeType.OnlinePlayersValueReached: { title = "Number of online players reached"; break; } case NoticeType.ServerNotResponding: { title = "Server not responding"; break; } case NoticeType.LevelOfMapReached: { title = "Map level reached"; break; } default: { title = "Not handled notice"; break; } } return(title); }
private static ToastAudio GetAudioFromType(NoticeType type) { ToastAudio audio; switch (type) { case NoticeType.PlayerConnected: { audio = ToastAudio.Default; break; } case NoticeType.NextMapSelected: { audio = ToastAudio.Silent; break; } case NoticeType.MapChanged: { audio = ToastAudio.Silent; break; } case NoticeType.OnlinePlayersValueReached: { audio = ToastAudio.Reminder; break; } case NoticeType.ServerNotResponding: { audio = ToastAudio.LoopingAlarm; break; } case NoticeType.LevelOfMapReached: { audio = ToastAudio.Mail; break; } default: { audio = ToastAudio.Default; break; } } return(audio); }
public PagedListResult <NoticeInfo> SearchNotices(DateRange range, int pagina, Guid userId, NoticeType noticeType) { var userRepository = new UserRepository(_context); var user = userRepository.GetById(userId); var deliveryPlans = new List <long>(); if (user is Student student) { deliveryPlans = student.DeliveryPlans.Select(x => x.Id).ToList(); } var notices = _context.GetList <Notice>() .Where(a => DbFunctions.TruncateTime(a.DateTime) >= DbFunctions.TruncateTime(user.CreatedAt) && (!range.StartDate.HasValue || range.StartDate.HasValue && range.StartDate.Value <= a.DateTime && (!range.EndDate.HasValue || range.EndDate.HasValue && range.EndDate.Value >= a.DateTime)) && ((noticeType == NoticeType.Personal || noticeType == NoticeType.All) && a.User != null && a.User.Id == userId || (noticeType == NoticeType.Classroom || noticeType == NoticeType.All) && a.DeliveryPlan != null && deliveryPlans.Contains(a.DeliveryPlan.Id) || (noticeType == NoticeType.Public || noticeType == NoticeType.All) && a.DeliveryPlan == null && a.User == null) ) .Select(x => new NoticeInfo { Notice = x }); var repo = new GenericRepository <NoticeInfo>(_context, notices); var query = new SearchQuery <NoticeInfo> { Take = 8, Skip = (pagina - 1) * 8 }; query.SortCriterias.Add(new DynamicFieldSortCriteria <NoticeInfo>("Notice.DateTime desc")); var paginaResultados = repo.Search(query); foreach (var item in paginaResultados.Entities) { item.DateTimeDescription = _humanizer.Humanize(item.Notice.DateTime, DateTime.Now, CultureInfo.CurrentUICulture); } return(paginaResultados); }
/// <summary> /// 注册Notice回调 /// </summary> /// <param name="noticeType">Notice类型</param> /// <param name="root">Root节点</param> /// <param name="action">触发回调</param> /// <param name="immediateInvoke">触发当前新增的触发回调</param> public void RegisterCallBack(NoticeType noticeType, Transform root, Action <BaseNotice> action, bool immediateInvoke = true) { BaseNotice notice; if (noticeDic.TryGetValue(noticeType, out notice)) { notice.RegisterCallBack(root, action); if (immediateInvoke) { action.Invoke(notice); } } }
public Task(DateTime expires, NoticeType type, EmailAddress email, TaskActionDelegate noticeAction = null) { if (noticeAction != null) { NoticeAction = noticeAction; } Guid = System.Guid.NewGuid().ToString(); NoticeControlNumber = Name = Data = ""; this.EmailAddress = email; Created = DateTime.Now; ScheduledTime = expires; IsTimed = true; NoticeType = type; }
public void SetBattleResultData(NoticeType resType, BattleResultData resInfo, bool isPlayBack = false) { resultInfo = resInfo; #region Judge winning or losing if (resType == NoticeType.BattleResultBlueWin) { switch (myselfMatchSide) { case MatchSide.Red: currentResultType = BattleResultType.Lose; break; case MatchSide.Blue: currentResultType = BattleResultType.Win; break; } redVictroy = false; } else if (resType == NoticeType.BattleResultRedWin) { switch (myselfMatchSide) { case MatchSide.Red: currentResultType = BattleResultType.Win; break; case MatchSide.Blue: currentResultType = BattleResultType.Lose; break; } redVictroy = true; } #endregion view.RefreshBattleResult(); if (!isPlayBack) { DataManager dataM = DataManager.GetInstance(); dataM.SetPlayerExp(resInfo.currentExp); int currentGold = dataM.GetPlayerGold(); dataM.SetPlayerGold(currentGold += resInfo.gainGold); dataM.SetPlayerLevel(resInfo.playerLevel); } }
public ActionResult ListNoticeHistory(DateTime?startDate, DateTime?endDate, NoticeType noticeType = NoticeType.All, int page = 1) { var range = new DateRange { StartDate = startDate, EndDate = endDate }; var historyService = new HistoryService(_context, new DefaultDateTimeHumanizeStrategy()); return(Json( NoticeViewModel.FromEntityList(historyService.SearchNotices(range, page, _loggedUser.Id, noticeType)), JsonRequestBehavior.AllowGet)); }
public static PacketWriter Notice(string message, NoticeType type = NoticeType.Mint, short durationSec = 0) { PacketWriter pWriter = PacketWriter.Of(SendOp.Notice); pWriter.Write(NoticePacketMode.Send); pWriter.WriteShort((short)type); pWriter.WriteByte(); pWriter.WriteInt(); pWriter.WriteUnicodeString(message); if (type.HasFlag(NoticeType.Mint)) { pWriter.WriteShort(durationSec); } return(pWriter); }
public static void SendNotice(NoticeType thisNotice, List <string> emailRecipients, string facultyName, string studentName, string studentID, string courseSection, string dropDate, string lastDate) { if (thisNotice != NoticeType.NoNotice) { string messageText = NoticeText.GetNoticeText(thisNotice); string subjectText = NoticeText.GetSubjectText(thisNotice); messageText = messageText.Replace("FACULTY_NAME", facultyName).Replace("STUDENT_NAME", studentName).Replace("STUDENT_ID", studentID).Replace("COURSE_SECTION", courseSection).Replace("DROP_DATE", dropDate).Replace("LAST_DATE", lastDate); SendGenericNotification(subjectText, messageText, emailRecipients); // extra insurance to not send emails to faculty when testing or debugging //SendGenericNotification(subjectText, messageText, (new string[] {"*****@*****.**"}).ToList()); } }
private IEnumerator EnableBattleResult(NoticeType resType, BattleResultData resInfo, GameObject banner) { yield return(new WaitForSeconds(3f)); Destroy(banner); UIManager.Instance.GetUIByType(UIType.BattleResultScreen, (ViewBase ui, System.Object param) => { if (!ui.openState) { ui.OnEnter(); (ui as BattleResultView).SetIsMainUIOpen(false); (ui as BattleResultView).SetBattleResultData(resType, resInfo, true); } }); }
public void AddNotice(string message, int ReciveUserID, int SendUserID, NoticeType NoticeType = NoticeType.系统通知) { using (IFMPDBContext db = new IFMPDBContext()) { Notice Notice = new Notice(); Notice.Contenet = "【" + Enum.GetName(typeof(NoticeType), NoticeType) + "】" + message; Notice.IsSend = false; Notice.NoticeType = NoticeType; Notice.ReciveUserID = ReciveUserID; Notice.SendDate = DateTime.Now; Notice.SendUserID = SendUserID; db.Notice.Add(Notice); db.SaveChanges(); } }
public ActionResult Index() { const NoticeType notivceType = NoticeType.Public; ViewBag.NoticeTypes = new SelectList(notivceType.ToDataSource <NoticeType>(), "Key", "Value"); var range = new DateRange { StartDate = DateTime.Now.AddMonths(-1), EndDate = DateTime.Now }; var historyService = new HistoryService(_context, new DefaultDateTimeHumanizeStrategy()); return(View( NoticeViewModel.FromEntityList(historyService.SearchNotices(range, 1, _loggedUser.Id, NoticeType.All)))); }
public static void WriteNotice(PacketWriter pWriter, SystemNotice notice, NoticeType type = NoticeType.Mint, List <string> parameters = null, short durationSec = 0) { pWriter.WriteShort((short)type); pWriter.WriteByte(0x1); pWriter.WriteInt(0x1); pWriter.Write(notice); pWriter.WriteInt(parameters.Count); foreach (string parameter in parameters) { pWriter.WriteUnicodeString(parameter); } if (type.HasFlag(NoticeType.Mint)) { pWriter.WriteShort(durationSec); } }
public void Notify(string message, NoticeType type = NoticeType.Pink) { using (OutPacket oPacket = new OutPacket(SendOps.BroadcastMsg)) { oPacket.WriteByte((byte)type); if (type == NoticeType.Ticker) { oPacket.WriteBool(!string.IsNullOrEmpty(message)); } oPacket.WriteMapleString(message); this.Client.Send(oPacket); } }
public Notice(DateTime sheduledTime, NoticeType type, EmailAddress email, NoticeActionDelegate noticeAction = null) { this.IsExpirable = false; this.Expires = DateTime.Now.AddMonths(12); if (noticeAction != null) { NoticeAction = noticeAction; } Guid = System.Guid.NewGuid().ToString(); NoticeControlNumber = ""; Data = ""; this.EmailAddress = email; Created = DateTime.Now; Scheduled = sheduledTime; IsTimed = true; NoticeType = type; }
public static Packet BroadcastMessage(NoticeType messageType, string message) { Packet broadcastMessage = new Packet(ServerOperationCode.BroadcastMsg); broadcastMessage .WriteByte((byte)messageType); if (messageType == NoticeType.ScrollingText) { broadcastMessage.WriteBool(!string.IsNullOrEmpty(message)); } broadcastMessage.WriteString(message); return(broadcastMessage); }
public static EntityList <Notice> FindAllByUidAndType(Int32 uid, NoticeType type, Int32 start = 0, Int32 max = 0) { if (Meta.Count >= 1000) { return(FindAll(_.Uid == uid & _.Type == type, _.ID.Desc(), null, start, max)); } else // 实体缓存 { var list = Meta.Cache.Entities.FindAll(__.Uid, uid); if (type != NoticeType.All) { list = list.FindAll(__.Type, type); } return(list.Sort(__.ID, true).Page(start, max)); } }
private static Color GetOutlineColor(NoticeType type) { switch (type) { case NoticeType.Info: return(Color.FromArgb(100, 135, 220)); case NoticeType.Tip: return(Color.FromArgb(255, 204, 0)); case NoticeType.Warning: return(Color.FromArgb(255, 153, 51)); default: throw new ArgumentException(nameof(type)); } }
public static Packet Notice(SystemNotice notice, NoticeType type = NoticeType.Mint, List <string> parameters = null) { parameters ??= new List <string>(); PacketWriter pWriter = PacketWriter.Of(SendOp.NOTICE); pWriter.WriteEnum(NoticePacketMode.Send); pWriter.WriteShort((short)type); pWriter.WriteByte(0x1); pWriter.WriteInt(0x1); pWriter.WriteInt((int)notice); pWriter.WriteInt(parameters.Count); foreach (string parameter in parameters) { pWriter.WriteUnicodeString(parameter); } return(pWriter); }
private static Icon GetIcon(NoticeType type) { switch (type) { case NoticeType.Info: return(Icons.Information); case NoticeType.Tip: return(Icons.Bulb); case NoticeType.Warning: return(Icons.Warning); default: throw new ArgumentException(nameof(type)); } }
private void UpdataProgressByID(long id, int progress, NoticeType type = NoticeType.BattleLoading) { if (cacheList == null) { return; } for (int i = 0; i < cacheList.Count; i++) { if (id == cacheList[i].PlayerID) { cacheList[i].Progress = progress; cacheList[i].isLoadComplted = progress >= 100; break; } } }
private static Color GetFillColor(NoticeType type) { switch (type) { case NoticeType.Info: return(Color.FromArgb(140, 170, 230)); case NoticeType.Tip: return(Color.FromArgb(255, 255, 155)); case NoticeType.Warning: return(Color.FromArgb(255, 204, 0)); default: throw new ArgumentException(nameof(type)); } }
public static void SendToastAsync(string body, NoticeType type) { var audio = GetAudioFromType(type); var title = GetTitleFromType(type); var request = new ToastRequest { ToastAudio = audio, ToastTitle = title, ToastBody = body, ShortcutFileName = "zRageAdminMain.lnk", ShortcutTargetFilePath = Assembly.GetExecutingAssembly().Location, AppId = "zRageAdminMain", }; ToastManager.ShowAsync(request).RunSynchronously(); }
private void SetCurrentBattleResult(NoticeC2S noticeC2S = null) { NoticeS2C noticeS2C = new NoticeS2C(); NoticeType type = NoticeType.BattleResultBlueWin; if (noticeC2S != null) { type = noticeC2S.type; } else { type = NoticeType.BattleResultBlueWin; } DebugUtils.Log(DebugUtils.Type.SimulateBattleMessage, string.Format("Send {0} feed back succeed ", MsgCode.NoticeMessage)); // battle end need to stop send updateS2CS if (type == NoticeType.BattleResultBlueWin || type == NoticeType.BattleResultRedWin || type == NoticeType.BattleResultDraw) { DataManager clientData = DataManager.GetInstance(); NoticeS2C.BattleResult resultData = new NoticeS2C.BattleResult(); resultData.battleDuration = (int)(battleDurationTimer * 0.001f); FillSituantionData(MatchSide.Red, resultData.redBattleSituations); FillSituantionData(MatchSide.Blue, resultData.blueBattleSituations); resultData.gainGold = 0; resultData.gainExp = 0; resultData.currentExp = 0; resultData.upLevelExp = 0; resultData.playerLevel = 0; noticeS2C.battleResult = resultData; status = SimulateBattleStatus.End; DebugUtils.Log(DebugUtils.Type.SimulateBattleMessage, string.Format("Send battle result feed back succeed: {0}", type)); } noticeS2C.type = type; byte[] dataS2C = ProtobufUtils.Serialize(noticeS2C); simMessageHandlers[MsgCode.NoticeMessage](dataS2C); }
/// <summary> /// 发送输入状态 /// Paused/Typing /// </summary> /// <param name="status"></param> public void SendTypingNotice(int isStarted) { try { NoticeType noticeType = NoticeType.TypingStopped; if (isStarted > 0) { noticeType = NoticeType.TypingStarted; } if (this.Room == null) { return; } this.SendMessage(string.Format("$$CustomerNoticeType$$:{0}", noticeType)); } catch { } }
public ResponseStatus GetTopCount(ref int topCount, NoticeType nType, bool isClose) { dalBase.sql = "SELECT COUNT(*) FROM db_notice WHERE publishTime <= CURDATE() AND isTop=1 "; if (nType != NoticeType.NONE) { dalBase.sql += string.Format("AND isTop=1 AND ntype={0}", Convert.ToByte(nType)); } if (dalBase.Run(Behavious.SELECT_WITHOUT_PARAM, isClose)) { dalBase.DataRead.Read(); topCount = Convert.ToInt32(dalBase.DataRead[0]); return(ResponseStatus.SUCCESS); } else { dalBase.CloseConnect(); return(ResponseStatus.FAILED); } }
/// <summary> /// Trims the conditional fields /// </summary> public void Trim(NoticeType type) { var isSocial = type.IsSocial(); if (!AnyGreenOptionSelected()) { ListedGreenCriteriaUsed = null; } if (EmploymentCondition != true) { HowManyOpportunitiesIsEstimated = null; } if (!isSocial) { EndUserInvolved = null; } }
/// <summary> /// 获取指定用户和分页下的通知 /// </summary> /// <param name="uid">用户id</param> /// <returns>通知集合</returns> public static NoticeinfoCollection GetNoticeinfoCollectionByUid(int uid, NoticeType noticetype, int pageid, int pagesize) { return (uid > 0 && pageid > 0) ? Discuz.Data.Notices.GetNoticeinfoCollectionByUid(uid, noticetype, pageid, pagesize) : null; }
public IDataReader GetNoticeByUid(int uid, NoticeType noticeType) { DbParameter[] parms = { DbHelper.MakeInParam("@uid", (DbType)SqlDbType.Int, 4, uid), DbHelper.MakeInParam("@type", (DbType)SqlDbType.Int, 4, noticeType), }; return DbHelper.ExecuteReader(CommandType.Text, string.Format("{0}getnoticebyuid", BaseConfigs.GetTablePrefix), parms); }
/// <summary> /// 创建广播消息对象 /// </summary> /// <param name="noticeType"></param> /// <param name="content"></param> /// <returns></returns> public NoticeMessage Create(NoticeType noticeType, string content) { return Create(noticeType, content, "", DateTime.MinValue); }
/// <summary> /// 作者:Vincen /// 时间:2013.12.06 /// 描述:获取公告信息列表,通过中心编号和区域编号 /// </summary> /// <param name="branchId"></param> /// <param name="noticeType"></param> /// <returns></returns> public static List<Notice> GetNoticeListByBranchId(int branchId, NoticeType noticeType) { var Db = new EmeEntities(dbRead); var ntype = CommonHelper.To<int>(noticeType); var list1 = Db.Notice.Where(p => p.Status == ConvertEnum.StatusTypeForActive && p.NoticeType == ntype && !p.IsRights); var list2 = Db.Notice.Where(p => p.Status == ConvertEnum.StatusTypeForActive && p.NoticeType == ntype && p.NoticeRights.Any(n => n.BranchId == branchId)); var list = list1.Union(list2); return list.Distinct().OrderByDescending(p => p.SetTopTime).ThenBy(p => p.BeginDate).ToList(); }
/// <summary> /// Sends Notice to creature's client. /// </summary> /// <param name="creature"></param> /// <param name="type"></param> /// <param name="duration">Ignored if 0</param> /// <param name="format"></param> /// <param name="args"></param> public static void Notice(Creature creature, NoticeType type, int duration, string format, params object[] args) { var packet = new Packet(Op.Notice, MabiId.Broadcast); packet.PutByte((byte)type); packet.PutString(string.Format(format, args)); if (duration > 0) packet.PutInt(duration); creature.Client.Send(packet); }
/// <summary> /// Broadcasts Notice to every player in any region. /// </summary> /// <param name="type"></param> /// <param name="duration">Ignored if 0</param> /// <param name="format"></param> /// <param name="args"></param> public static void Notice(NoticeType type, int duration, string format, params object[] args) { var packet = new Packet(Op.Notice, MabiId.Broadcast); packet.PutByte((byte)type); packet.PutString(string.Format(format, args)); if (duration > 0) packet.PutInt(duration); ChannelServer.Instance.World.Broadcast(packet); }
protected void Notice(WorldClient client, string msg, NoticeType type = NoticeType.MiddleTop) { if (client == null) return; Send.Notice(client, msg, type); }
public void DeleteNotice(NoticeType noticeType, int days) { string commandText; if (noticeType == NoticeType.All) { commandText = string.Format("DELETE FROM [{0}notices] WHERE DATEDIFF(d,[postdatetime], GETDATE()) > {1}", BaseConfigs.GetTablePrefix, days); DbHelper.ExecuteNonQuery(CommandType.Text, commandText); } else { commandText = string.Format("DELETE FROM [{0}notices] WHERE [type] = {1} AND DATEDIFF(d,[postdatetime], GETDATE()) > {2}", BaseConfigs.GetTablePrefix, (int)noticeType, days); DbHelper.ExecuteNonQuery(CommandType.Text, commandText); } }
/// <summary> /// 作者:Vincen /// 时间:2013.12.06 /// 描述:获取通过列表,通过用户编号和通知类型,并指定显示行数 /// </summary> /// <param name="userId"></param> /// <param name="noticeType"></param> /// <param name="showNum"></param> /// <returns></returns> public static List<Notice> GetNoticeListByUserId(int userId, int branchId, NoticeType noticeType, int showNum) { return GetNoticeListByUserId(userId, branchId, noticeType).Take(showNum).ToList(); }
/// <summary> /// 作者:Vincen /// 时间:2013.11.20 /// 描述:获取最新通知,通过通知类型 /// </summary> /// <param name="noticeType"></param> /// <returns></returns> public static Notice GetNoticeNewByNoticeType(NoticeType noticeType) { var Db = new EmeEntities(dbRead); var ntype = CommonHelper.To<int>(noticeType); return Db.Notice.OrderByDescending(p => p.SetTopTime).ThenByDescending(p => p.CreateTime).FirstOrDefault(p => p.NoticeType == ntype && p.Status == ConvertEnum.StatusTypeForActive); }
/// <summary> /// 作者:Vincen /// 时间:2013.12.06 /// 描述:获取通过列表,通过用户编号和通知类型 /// </summary> /// <param name="userId"></param> /// <param name="noticeType"></param> /// <returns></returns> public static List<Notice> GetNoticeListByUserId(int userId, int branchId, NoticeType noticeType) { var Db = new EmeEntities(dbRead); var noRightsList = Db.Notice.Where(p => p.Status == ConvertEnum.StatusTypeForActive && !p.IsRights); var tempList = Db.Notice.Where(p => p.Status == ConvertEnum.StatusTypeForActive && p.NoticeRights.Any(n => n.Branch.UserBranch.Any(u => u.UserId == userId))); noRightsList = noRightsList.Union(tempList); var allList = noRightsList.Distinct().OrderByDescending(p => p.SetTopTime).ThenBy(p => p.BeginDate).ToList(); return allList; }
/// <summary> /// 作者:Vincen /// 时间:2013.12.06 /// 描述:获取公告信息列表,通过中心编号或区域编号,并指定显示的行数 /// </summary> /// <param name="branchId"></param> /// <param name="noticeType"></param> /// <param name="platformType"></param> /// <param name="showNum"></param> /// <returns></returns> public static List<Notice> GetNoticeListByBranchId(int branchId, NoticeType noticeType, PlatformType platformType, int showNum) { return GetNoticeListByBranchId(branchId, noticeType, platformType).Take(showNum).ToList(); }
/// <summary> /// 作者:Vincen /// 时间:2013.12.19 /// 描述:获取公告信息列表,通过中心编号和区域编号 /// </summary> /// <param name="branchId"></param> /// <param name="noticeType"></param> /// <param name="platformType"></param> /// <returns></returns> public static List<Notice> GetNoticeListByBranchId(int branchId, NoticeType noticeType, PlatformType platformType) { var platform = CommonHelper.To<int>(platformType); return GetNoticeListByBranchId(branchId, noticeType).Where(p => p.PlatformType == platform).ToList(); }
public IDataReader GetNoticeByUid(int uid, NoticeType noticeType, int pageId, int pageSize) { string commandText = ""; if (pageId == 1) { commandText = string.Format("SELECT TOP {0} [nid], [uid], [type], [new], [posterid], [poster], [note], [postdatetime] FROM [{1}notices] WHERE [uid]={2} {3} ORDER BY [postdatetime] DESC", pageSize, BaseConfigs.GetTablePrefix, uid, noticeType == NoticeType.All ? "" : " AND [type]=" + (int)noticeType); } else { commandText = string.Format("SELECT TOP {0} [nid], [uid], [type], [new], [posterid], [poster], [note], [postdatetime] FROM [{1}notices] WHERE [nid] < (SELECT MIN([nid]) FROM (SELECT TOP {2} [nid] FROM [{1}notices] WHERE [uid]={3} {4} ORDER BY [postdatetime] DESC) AS tblTmp ) AND [uid]={3} {4} ORDER BY [postdatetime] DESC", pageSize, BaseConfigs.GetTablePrefix, (pageId - 1) * pageSize, uid, noticeType == NoticeType.All ? "" : " AND [type]=" + (int)noticeType); } return DbHelper.ExecuteReader(CommandType.Text, commandText); }
protected void Broadcast(string msg, NoticeType type = NoticeType.Top) { Send.ChannelNotice(type, msg); }
public int GetNoticeCountByUid(int uid, NoticeType noticeType) { DbParameter[] parms = { DbHelper.MakeInParam("@uid", (DbType)SqlDbType.Int, 4, uid), DbHelper.MakeInParam("@type", (DbType)SqlDbType.Int, 4, (int)noticeType) }; return TypeConverter.ObjectToInt(DbHelper.ExecuteScalar(CommandType.StoredProcedure, string.Format("{0}getnoticecountbyuid", BaseConfigs.GetTablePrefix), parms)); }
/// <summary> /// 获取指定用户id及通知类型的通知数 /// </summary> /// <param name="uid">指定用户id</param> /// <param name="noticetype">通知类型</param> /// <returns></returns> public static int GetNoticeCountByUid(int uid, NoticeType noticetype) { return DatabaseProvider.GetInstance().GetNoticeCountByUid(uid, noticetype); }
/// <summary> /// Sends Notice to creature's client. /// </summary> /// <param name="creature"></param> /// <param name="type"></param> /// <param name="format"></param> /// <param name="args"></param> public static void Notice(Creature creature, NoticeType type, string format, params object[] args) { Notice(creature, type, 0, format, args); }
/// <summary> /// 获取指定用户和分页下的通知 /// </summary> /// <param name="uid">用户id</param> /// <returns>通知集合</returns> public static NoticeinfoCollection GetNoticeinfoCollectionByUid(int uid, NoticeType noticetype, int pageid, int pagesize) { return NoticeinfoCollectionDTO(DatabaseProvider.GetInstance().GetNoticeByUid(uid, noticetype, pageid, pagesize)); }
/// <summary> /// Broadcasts Notice to every player in any region. /// </summary> /// <param name="type"></param> /// <param name="format"></param> /// <param name="args"></param> public static void Notice(NoticeType type, string format, params object[] args) { Notice(type, 0, format, args); }
public NoticeSystem(int jobId, NoticeType noticeType, int substituteUserId, int clerkUserId) { try { JobId = jobId; type = noticeType; SubstituteUserId = substituteUserId; Substitute substitute = new Substitute(); substitute.LoadByUserId(SubstituteUserId); SubstituteId = substitute.SubstituteId; Job job = new Job(jobId); jobView = job.LoadByPrimaryKey(jobId); substituteView = (new Miami.Substitute.Dal.User()).LoadForMain(SubstituteUserId)[0]; int.TryParse(jobView["LocationId"].ToString(), out LocationId); DataView dv = (new Dal.Job()).GetEmployee(LocationId); if (clerkUserId > 0) ClerkUserId = clerkUserId; else if (dv.Count > 0) ClerkUserId = Convert.ToInt32(dv[0]["Employee_Number"]); clerkView = (new Miami.Substitute.Dal.User()).LoadForMain(ClerkUserId)[0]; switch (type) { case NoticeType.AcceptedJobCancelledBySubstitute: // Send to Clerks case NoticeType.JobAppliedForBySubstitute: from = new MailAddress(substituteView["Email"].ToString()); if (substituteView["Email"].ToString().Trim().Length > 0) to.Add(new MailAddress(clerkView["Email"].ToString())); if (dv != null) foreach (DataRow dr in dv.Table.Rows) cc.Add(new MailAddress(dr["Employee_email_address"].ToString())); break; case NoticeType.AcceptedJobDeletedByClerk: // Send to Substitute case NoticeType.JobAcceptedByClerk: case NoticeType.JobConfirmedBySubstitute: case NoticeType.JobDeclinedBySubstitute: from = new MailAddress(clerkView["Email"].ToString()); if (substituteView["Email"].ToString().Trim().Length > 0) to.Add(new MailAddress(substituteView["Email"].ToString())); if (dv != null) foreach (DataRow dr in dv.Table.Rows) { if (type != NoticeType.JobAcceptedByClerk) cc.Add(new MailAddress(dr["Employee_email_address"].ToString())); if (from.Address.Length == 0) from = new MailAddress(dr["Employee_email_address"].ToString()); } break; } } catch { } }
/// <summary> /// Broadcasts Notice in region. /// </summary> /// <param name="region"></param> /// <param name="type"></param> /// <param name="duration"></param> /// <param name="format"></param> /// <param name="args"></param> public static void Notice(Region region, NoticeType type, int duration, string format, params object[] args) { var packet = new Packet(Op.Notice, MabiId.Broadcast); packet.PutByte((byte)type); packet.PutString(string.Format(format, args)); if (duration > 0) packet.PutInt(duration); region.Broadcast(packet); }
/// <summary> /// 获取指定用户id及通知类型的通知数 /// </summary> /// <param name="uid">指定用户id</param> /// <param name="noticetype">通知类型</param> /// <returns></returns> public static int GetNoticeCountByUid(int uid, NoticeType noticetype) { return uid > 0 ? Discuz.Data.Notices.GetNoticeCountByUid(uid, noticetype) : 0; }
static public void Log(string path, NoticeType type, string note) { FlickrLogic.UploadEventList.Add(new Notice() { Type = type, Note = note, FullPath = path }); }
/// <summary> /// Displays notice. /// </summary> /// <param name="type"></param> /// <param name="format"></param> /// <param name="args"></param> public void Notice(NoticeType type, string format, params object[] args) { Send.Notice(this.Player, type, format, args); }