Exemplo n.º 1
0
        public SystemNotify GetSystemNotify(int notifyID)
        {
#if !Passport
            PassportClientConfig settings = Globals.PassportClient;
            if (settings.EnablePassport)
            {
                SystemNotifyProxy proxy = settings.PassportService.Notify_GetSystemNotify(notifyID);

                return(ProxyToSystemNotify(proxy));
            }
            else
#endif
            {
                return(NotifyDao.Instance.GetSystemNotify(notifyID));
            }
        }
Exemplo n.º 2
0
        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);
        }
Exemplo n.º 3
0
        public SystemNotify ProxyToSystemNotify(SystemNotifyProxy proxy)
        {
            if (proxy == null)
            {
                return(null);
            }

            SystemNotify result = new SystemNotify();

            foreach (NotifyActionProxy action in proxy.Actions)
            {
                result.Actions.Add(new NotifyAction(action.Title, action.Url, action.IsDialog));
            }

            result.BeginDate  = proxy.BeginDate;
            result.ClientID   = proxy.ClientID;
            result.Content    = proxy.Content;
            result.CreateDate = proxy.CreateDate;

            result.DataTable = new StringTable();

            foreach (StringKeyValueProxy keyValue in proxy.DataTable)
            {
                result.DataTable.Add(keyValue.Key, keyValue.Value);
            }

            result.DispatcherID   = proxy.DispatcherID;
            result.DispatcherIP   = proxy.DispatcherIP;
            result.EndDate        = proxy.EndDate;
            result.IsRead         = proxy.IsRead;
            result.Keyword        = proxy.Keyword;
            result.NotifyID       = proxy.NotifyID;
            result.CreateDate     = proxy.PostDate;
            result.ReadUserIDs    = proxy.ReadUserIDs;
            result.ReceiveUserIDs = new List <int>(proxy.ReceiveUserIDs);
            result.ReceiveRoles   = new List <Guid>(proxy.ReceiveRoles);
            result.Subject        = proxy.Subject;
            result.TypeID         = proxy.TypeID;
            result.TypeName       = proxy.TypeName;
            result.UpdateDate     = proxy.UpdateDate;
            result.UserID         = proxy.UserID;

            return(result);
        }
Exemplo n.º 4
0
        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);
        }