Exemplo n.º 1
0
 public ActionResult AJaxCreateTopicReply(FormCollection fm)
 {
     string str = InjectionFilter.Filter((fm["Des"] != null) ? fm["Des"].ToString() : "");
     long pid = Globals.SafeLong(fm["Pid"], (long) 0L);
     int num2 = Globals.SafeInt(fm["GroupId"], 0);
     int num3 = Globals.SafeInt(fm["TopicId"], 0);
     string imageUrl = "";
     if (pid == 0L)
     {
         imageUrl = (fm["ImageUrl"] != null) ? fm["ImageUrl"].ToString() : "";
     }
     if (!string.IsNullOrEmpty(str))
     {
         Maticsoft.BLL.SNS.GroupTopicReply reply = new Maticsoft.BLL.SNS.GroupTopicReply();
         Maticsoft.Model.SNS.GroupTopicReply tModel = new Maticsoft.Model.SNS.GroupTopicReply {
             Description = str
         };
         string savePath = "/Upload/SNS/Images/Group/" + DateTime.Now.ToString("yyyyMMdd") + "/";
         string saveThumbsPath = "/Upload/SNS/Images/GroupThumbs/" + DateTime.Now.ToString("yyyyMMdd") + "/";
         tModel.PhotoUrl = Maticsoft.BLL.SNS.Photos.MoveImage(imageUrl, savePath, saveThumbsPath);
         tModel.GroupID = num2;
         tModel.CreatedDate = DateTime.Now;
         tModel.ReplyUserID = base.currentUser.UserID;
         tModel.ReplyNickName = base.currentUser.NickName;
         tModel.Status = 1;
         tModel.TopicID = num3;
         if ((tModel.ReplyID = reply.AddEx(tModel, pid)) > 0)
         {
             Maticsoft.BLL.SNS.GroupTopicReply reply3 = new Maticsoft.BLL.SNS.GroupTopicReply();
             List<Maticsoft.Model.SNS.GroupTopicReply> model = new List<Maticsoft.Model.SNS.GroupTopicReply>();
             tModel = reply3.GetModel(tModel.ReplyID);
             model.Add(tModel);
             return this.PartialView(base.CurrentThemeViewPath + "/Group/TopicReplyResult.cshtml", model);
         }
     }
     return base.Content("No");
 }
Exemplo n.º 2
0
 public void AjaxPostWeibo(FormCollection Fm)
 {
     UserBind bind = new UserBind();
     Maticsoft.BLL.SNS.Posts posts = new Maticsoft.BLL.SNS.Posts();
     Maticsoft.BLL.SNS.GroupTopics topics = new Maticsoft.BLL.SNS.GroupTopics();
     Maticsoft.BLL.SNS.GroupTopicReply reply = new Maticsoft.BLL.SNS.GroupTopicReply();
     if ((base.currentUser.UserType != "AA") && !string.IsNullOrWhiteSpace(Fm["MediaIds"]))
     {
         string mediaIDs = Fm["MediaIds"];
         string productName = Fm["ShareDes"];
         string str3 = Fm["ImageUrl"];
         string text1 = Fm["VideoRawUrl"];
         string url = Fm["Url"];
         string str5 = Fm["Type"];
         int targetId = Globals.SafeInt(Fm["TargetID"], 0);
         int postID = Globals.SafeInt(Fm["PostID"], 0);
         int topicID = Globals.SafeInt(Fm["TopicID"], 0);
         int num4 = Globals.SafeInt(Fm["AlumbID"], 0);
         int replyID = Globals.SafeInt(Fm["ReplyId"], 0);
         if (num4 > 0)
         {
             url = string.Concat(new object[] { "http://", Globals.DomainFullName, "/Album/Details?AlbumID=", num4 });
         }
         if (postID > 0)
         {
             Maticsoft.Model.SNS.Posts model = posts.GetModel(postID);
             if (model != null)
             {
                 if (model.Type == 1)
                 {
                     str5 = "Photo";
                     targetId = model.TargetId;
                     if (string.IsNullOrEmpty(productName))
                     {
                         productName = "分享图片";
                     }
                 }
                 else if (model.Type == 2)
                 {
                     str5 = "Product";
                     targetId = model.TargetId;
                     if (string.IsNullOrEmpty(productName))
                     {
                         productName = model.ProductName;
                     }
                 }
                 else if (model.Type == 0)
                 {
                     str5 = "Weibo";
                     productName = string.IsNullOrEmpty(model.Description) ? "分享图片" : model.Description;
                 }
                 str3 = model.ImageUrl.Replace("{0}", "T116x170_");
             }
         }
         if (topicID > 0)
         {
             url = string.Concat(new object[] { "http://", Globals.DomainFullName, "/Group/TopicReply?id=", topicID });
             Maticsoft.Model.SNS.GroupTopics topics2 = topics.GetModel(topicID);
             str3 = (topics2 != null) ? topics2.ImageUrl : "";
         }
         if (replyID > 0)
         {
             url = string.Concat(new object[] { "http://", Globals.DomainFullName, "/Group/TopicReply?id=", topicID });
             Maticsoft.Model.SNS.GroupTopicReply reply2 = reply.GetModel(replyID);
             str3 = (reply2 != null) ? reply2.PhotoUrl : "";
         }
         if ((!string.IsNullOrEmpty(str3) && (str3.Split(new char[] { '|' }).Length > 2)) && (str5 != "Product"))
         {
             str3 = "http://" + Globals.DomainFullName + str3.Split(new char[] { '|' })[0];
         }
         if (str5 == "Weibo")
         {
             url = string.Concat(new object[] { "http://", Globals.DomainFullName, "/User/Posts/", base.currentUser.UserID });
         }
         else if ((str5 == "Photo") || (str5 == "Product"))
         {
             url = string.Concat(new object[] { "http://", Globals.DomainFullName, "/Detail/", str5, "/", targetId });
         }
         try
         {
             bind.SendWeiBo(base.currentUser.UserID, mediaIDs, productName, url, str3);
         }
         catch (Exception exception)
         {
             base.Response.Write(exception);
         }
     }
 }
Exemplo n.º 3
0
 public ActionResult AJaxCreateReply(FormCollection fm)
 {
     string content = InjectionFilter.Filter(fm["Des"]);
     int replyId = Globals.SafeInt(fm["ReplyId"], 0);
     int userID = base.currentUser.UserID;
     string nickName = base.currentUser.NickName;
     Maticsoft.BLL.SNS.GroupTopicReply reply = new Maticsoft.BLL.SNS.GroupTopicReply();
     content = ViewModelBase.ReplaceFace(content);
     int replyID = reply.ForwardReply(replyId, content, userID, nickName);
     List<Maticsoft.Model.SNS.GroupTopicReply> model = new List<Maticsoft.Model.SNS.GroupTopicReply>();
     Maticsoft.Model.SNS.GroupTopicReply item = new Maticsoft.Model.SNS.GroupTopicReply();
     item = reply.GetModel(replyID);
     model.Add(item);
     return this.PartialView(base.CurrentThemeViewPath + "/Group/TopicReplyResult.cshtml", model);
 }