public void CreateMessage(MsgNotifyType notifyType, List <dynamic> users, dynamic ob, dynamic evtDef) { List <dynamic> items = new List <dynamic>(); foreach (var user in users) { items.Add(createMsg(notifyType, user, ob, evtDef)); } saveMsgToDb(items); }
private dynamic createMsg(MsgNotifyType notifyType, dynamic user, dynamic ob, dynamic evtDef) { dynamic item = new SqlDataProxy(this.model, this.conFac, LoadType.Null, this.con); item.NotifyType = notifyType; item.NotifyUser = user.User; item.ObjId = (ob.ID ?? "").ToString(); item.View = evtDef.View; item.GenerateTime = DateTime.Now; item.EvtId = evtDef.EventId; item.MessageId = Guid.NewGuid(); item.MessageFmt = evtDef.Defination.MsgFmt; item.State = MsgState.Generate; item.ReadOperation = evtDef.Defination.Operation; return(item); }