Exemplo n.º 1
0
        public ActionResult CreateContent(Treeview.Models.Content content)
        {
            using (var ctx = new CosmicVerseEntities1())
            {
                Content cont = new Content();
                cont.Title = content.ContentTitle;
                cont.Body  = content.ContentBody;

                contentRepository.InsertContent(cont);
                contentRepository.Save();
            }
            return(RedirectToAction("Index"));
        }
Exemplo n.º 2
0
        public ActionResult Links()
        {
            Content cont = new Content();

            Treeview.Models.Content contM = new Treeview.Models.Content();

            using (var ctx = new CosmicVerseEntities1())
            {
                cont = contentRepository.GetContentByID(4);
                contM.ContentTitle = cont.Title;
                contM.ContentBody  = cont.Body;
            }
            return(View(contM));
        }
Exemplo n.º 3
0
        public ActionResult SendMail(Treeview.Models.Content cont)
        {
            MailMessage objeto_mail = new MailMessage();
            SmtpClient  client      = new SmtpClient();

            client.Port                  = 25;
            client.Host                  = "smtp.internal.cosmicverse.info";
            client.Timeout               = 10000;
            client.DeliveryMethod        = SmtpDeliveryMethod.Network;
            client.UseDefaultCredentials = false;
            client.Credentials           = new System.Net.NetworkCredential("*****@*****.**", "75337533");
            objeto_mail.From             = new MailAddress(cont.Email.ToString());
            objeto_mail.To.Add(new MailAddress("*****@*****.**"));
            objeto_mail.Subject = "Cosmic Verse";
            objeto_mail.Body    = cont.Name + ":" + cont.Message;
            client.Send(objeto_mail);
            return(RedirectToAction("Index"));
        }