Exemplo n.º 1
0
 public static object  Post(Dictionary <string, string> obj)
 {
     if (Utils.CheckPermission(2, 7, Utils.LoggedUser.Roles) < 1)
     {
         return(Utils.ServiceResponse("", new ModelResponse(101), null));
     }
     return(MgrConfigCenter.Post(obj));
 }
Exemplo n.º 2
0
        public int SendNewsLetter()
        {
            var      mr = MgrConfigCenter.GetValue(null, -1, -1, 2);
            DateTime newsLetterLastSentDate = Convert.ToDateTime(mr[0].Value);

            newsLetterLastSentDate = newsLetterLastSentDate.AddDays(int.Parse(mr[1].Value));
            if (DateTime.Compare(DateTime.Now.Date, newsLetterLastSentDate) == 0 && int.Parse(mr[1].Value) > 0)
            {
                var result = BllFactory.Singleton.PortalUsersManager.SubscribeNewsLetterUsers();
                Utils.SendEmailAttachments(result.Select(s => s.Email).ToList(), "News Letter", mr[2].Value, null);
                Dictionary <string, string> dictionary = new Dictionary <string, string>();
                dictionary.Add("NewsLetterLastSentDate", DateTime.Now.Date.ToString("yyyy/MM/dd"));
                MgrConfigCenter.Post(dictionary);
                return(0);
            }
            return(-1);
        }