Beispiel #1
0
        public static SendStatus SendInnerMessage(SiteSettings settings, string subject, string message, string sendto)
        {
            SendStatus result;

            if (string.IsNullOrEmpty(subject) || string.IsNullOrEmpty(message) || subject.Trim().Length == 0 || message.Trim().Length == 0)
            {
                result = SendStatus.RequireMsg;
            }
            else
            {
                if (settings == null)
                {
                    result = SendStatus.NoProvider;
                }
                else
                {
                    if (settings.IsDistributorSettings)
                    {
                        IUser user = Users.GetUser(settings.UserId.Value);
                        result = (InnerMessageProvider.Instance().SendDistributorMessage(subject, message, user.Username, sendto) ? SendStatus.Success : SendStatus.Fail);
                    }
                    else
                    {
                        result = (InnerMessageProvider.Instance().SendMessage(subject, message, sendto) ? SendStatus.Success : SendStatus.Fail);
                    }
                }
            }
            return(result);
        }
Beispiel #2
0
 static InnerMessageProvider()
 {
     InnerMessageProvider.DefaultInstance = (DataProviders.CreateInstance("Hidistro.Messages.Data.InnerMessageData,Hidistro.Messages.Data") as InnerMessageProvider);
 }