public SystemNotifyProxy[] Notify_SystemNotifies() { if (!CheckClient()) return null; SystemNotifyProxy[] systemnotifies = new SystemNotifyProxy[SystemNotifyProvider.CurrentSystemNotifys.Count]; int i = 0; foreach (SystemNotify sn in SystemNotifyProvider.CurrentSystemNotifys) { systemnotifies[i++] = ProxyConverter.GetSystemNotifyProxy(sn); } return systemnotifies; }
public static SystemNotifyProxy GetSystemNotifyProxy(SystemNotify notify) { if (notify == null) return null; SystemNotifyProxy systemNotifyProxy = new SystemNotifyProxy(); foreach (NotifyAction action in notify.Actions) { systemNotifyProxy.Actions.Add(new NotifyActionProxy(action.Title, action.Url, action.IsDialog)); } systemNotifyProxy.BeginDate = notify.BeginDate; systemNotifyProxy.ClientID = notify.ClientID; systemNotifyProxy.Content = notify.Content; systemNotifyProxy.CreateDate = notify.CreateDate; systemNotifyProxy.DataTable = new List<StringKeyValueProxy>(); foreach (string key in notify.DataTable.Keys) { systemNotifyProxy.DataTable.Add(new StringKeyValueProxy(key, notify.DataTable[key])); } systemNotifyProxy.DispatcherID = notify.DispatcherID; systemNotifyProxy.DispatcherIP = notify.DispatcherIP; systemNotifyProxy.EndDate = notify.EndDate; systemNotifyProxy.IsRead = notify.IsRead; systemNotifyProxy.Keyword = notify.Keyword; systemNotifyProxy.NotifyID = notify.NotifyID; systemNotifyProxy.PostDate = notify.CreateDate; systemNotifyProxy.ReadUserIDs = notify.ReadUserIDs; systemNotifyProxy.ReceiveUserIDs = notify.ReceiveUserIDs; systemNotifyProxy.ReceiveRoles = notify.ReceiveRoles; systemNotifyProxy.Subject = notify.Subject; systemNotifyProxy.TypeID = notify.TypeID; systemNotifyProxy.TypeName = notify.TypeName; systemNotifyProxy.UpdateDate = notify.UpdateDate; systemNotifyProxy.Url = notify.Url; systemNotifyProxy.UserID = notify.UserID; //systemNotifyProxy.ReceiveUserIDs = new int[notify.ReceiveUserIDs.Count]; //systemNotifyProxy.ReceiveRoles = new Guid[notify.ReceiveRoles.Count]; //notify.ReceiveRoles.CopyTo(systemNotifyProxy.ReceiveRoles); //notify.ReceiveUserIDs.CopyTo(systemNotifyProxy.ReceiveUserIDs); //if (notify.ReadUserIDs != null) //{ // systemNotifyProxy.ReadedUserIDs = notify.ReadUserIDs.Split(new char[] { ',' }, StringSplitOptions.RemoveEmptyEntries); //} //else //{ // systemNotifyProxy.ReadedUserIDs = new string[0]; //} //systemNotifyProxy.BeginDate = notify.BeginDate; //systemNotifyProxy.EndDate = notify.EndDate; //systemNotifyProxy.Content = notify.Content; //systemNotifyProxy.Subject = notify.Subject; return systemNotifyProxy; }