Exemplo n.º 1
0
        public void SendVideo(string userIds, string subject, string comments, string vidlink)
        {
            var suser = (User)Session["user"];

            subject = "New Video Message from " + suser.FirstName + " " + suser.LastName;
            string activitycontent = "<div class='recieve'><img src='../../Images/video-msg.png' width='114' height='62' data-href=" + vidlink + " class='videosimg' /></div>" + "<div class='dt'>" + CultureInfo.CurrentCulture.DateTimeFormat.GetMonthName(DateTime.Now.Month) + " " + DateTime.Now.Day + ", " + DateTime.Now.Year + "</div>" + "<h2>" + subject + "</h2>" + "<p class='wallcomment'>Message:&nbsp" + comments + "</p>";
            var    common          = new CommonClient();

            if (Session["subid"] != null && Session["id"] != null)
            {
                common.CreateActivity(int.Parse(Session["id"].ToString()), userIds,
                                      int.Parse(Session["subid"].ToString()),
                                      3, activitycontent);
                common.SendMailFromWall(2, suser.FirstName + " " + suser.LastName, userIds, false);
            }
        }
Exemplo n.º 2
0
        public bool Reply(string useridslist, string batchid, string subject, int usersubids, string comments, HttpPostedFileBase replyFile)
        {
            subject = subject.Replace("Re:", "Re: ");
            try
            {
                bool hasAttachment = false;
                var  attachment    = string.Empty;
                if (replyFile != null)
                {
                    hasAttachment = true;
                    var name = Path.GetFileName(replyFile.FileName);
                    if (name != null)
                    {
                        var fileName = DateTime.Now.Ticks + name.Replace(" ", "");
                        var path     = Path.Combine(Server.MapPath("~/Uploads"), fileName);
                        replyFile.SaveAs(path);
                        attachment = "<div class='filespathrcvd'> file attached</div><a href='/Uploads/" + fileName + "' target='_blank'><img src='/Images/mail_attachment.png' alt='Attach'  class='fileattach'/></a>";
                    }
                }

                var suser = (User)Session["user"];
                if (Session["subid"] != null && Session["id"] != null)
                {
                    string activitycontent = " <div class='recieve' style='height:60px'></div>" + attachment +
                                             " <div class='dt'>" +
                                             CultureInfo.CurrentCulture.DateTimeFormat.GetMonthName(DateTime.Now.Month) +
                                             " " + DateTime.Now.Day + ", " + DateTime.Now.Year + "</div>" + "<h2>" +
                                             subject + "</h2>" + "<p class='wallcomment'>Message:&nbsp" + comments +
                                             "</p>";
                    var common = new CommonClient();
                    common.CreateActivity(int.Parse(Session["id"].ToString()), useridslist,
                                          int.Parse(Session["subid"].ToString()),
                                          1, activitycontent);
                    common.SendMailFromWall(3, suser.FirstName + " " + suser.LastName, useridslist, hasAttachment);
                }
                return(true);
            }
            catch (Exception)
            {
                return(false);
            }
        }
Exemplo n.º 3
0
        public void SendAppreciationtoBoth(string userIds, string subject, string appreciation, string comments, string selectedmembersemailids, HttpPostedFileBase replyFile)
        {
            var selectedEmailArray = selectedmembersemailids.Split(';');
            var doc = new XmlDocument();

            doc.LoadXml(appreciation);
            var nodes  = doc.DocumentElement.SelectNodes("img");
            var images = nodes.Cast <XmlNode>().Aggregate("", (current, node) => current + node.Attributes["src"].Value + "@");
            var suser  = (User)Session["user"];

            subject = subject + " from " + suser.FirstName + " " + suser.LastName;
            if (SaveOpenGraph(comments, subject, images, suser.EmailAddress, selectedEmailArray) != "gettoken")
            {
                var hasAttachment = false;
                var attachment    = string.Empty;
                if (replyFile != null)
                {
                    hasAttachment = true;

                    var name = Path.GetFileName(replyFile.FileName);
                    if (name != null)
                    {
                        var fileName = DateTime.Now.Ticks + name.Replace(" ", "");
                        var path     = Path.Combine(Server.MapPath("~/Uploads"), fileName);
                        replyFile.SaveAs(path);
                        attachment = "<div class='filespathrcvd'> file attached</div><a href='/Uploads/" + fileName + "' target='_blank'><img src='/Images/mail_attachment.png' alt='Attach' class='fileattach'/></a>";
                    }
                }
                var activitycontent = appreciation + attachment + " <div class='dt'>" + CultureInfo.CurrentCulture.DateTimeFormat.GetMonthName(DateTime.Now.Month) + " " + DateTime.Now.Day + ", " + DateTime.Now.Year + "</div>" + "<h2>" + subject + "</h2>" + "<p class='wallcomment'>Message:&nbsp" + comments + "</p>";
                var common          = new CommonClient();
                if (Session["subid"] != null && Session["id"] != null)
                {
                    common.CreateActivity(int.Parse(Session["id"].ToString()), userIds,
                                          int.Parse(Session["subid"].ToString()),
                                          1, activitycontent);
                    common.SendMailFromWall(1, suser.FirstName + " " + suser.LastName, userIds, hasAttachment);
                }
            }
        }
Exemplo n.º 4
0
        public void SendAppreciation(string userIds, string subject, string appreciation, string comments, string selectedmembersemailids, HttpPostedFileBase replyFile)
        {
            bool hasAttachment = false;
            var  attachment    = string.Empty;

            if (replyFile != null)
            {
                hasAttachment = true;

                var name = Path.GetFileName(replyFile.FileName);
                if (name != null)
                {
                    var fileName = DateTime.Now.Ticks + name.Replace(" ", "");

                    /*  var fileName = CultureInfo.CurrentCulture.DateTimeFormat.GetMonthName(DateTime.Now.Month) +
                     *           DateTime.Now.Day + DateTime.Now.Year + Path.GetFileName(replyFile.FileName);*/
                    var path = Path.Combine(Server.MapPath("~/Uploads"), fileName);
                    replyFile.SaveAs(path);
                    attachment = "<div class='filespathrcvd'> file attached</div><a href='/Uploads/" + fileName + "' target='_blank'><img src='/Images/mail_attachment.png' alt='Attach' class='fileattach'/></a>";
                }
            }

            var suser = (User)Session["user"];

            subject = subject + " from " + suser.FirstName + " " + suser.LastName;
            var activitycontent = appreciation + attachment + " <div class='dt'>" + CultureInfo.CurrentCulture.DateTimeFormat.GetMonthName(DateTime.Now.Month) + " " + DateTime.Now.Day + ", " + DateTime.Now.Year + "</div>" + "<h2>" + subject + "</h2>" + "<p class='wallcomment'>Message: " + comments + "</p>";
            var common          = new CommonClient();

            if (Session["subid"] != null && Session["id"] != null)
            {
                common.CreateActivity(int.Parse(Session["id"].ToString()), userIds,
                                      int.Parse(Session["subid"].ToString()),
                                      1, activitycontent);
                common.SendMailFromWall(1, suser.FirstName + " " + suser.LastName, userIds, hasAttachment);
            }
        }