Exemplo n.º 1
0
 public ActionResult AjaxTopicOperation(FormCollection fm)
 {
     int topicID = Globals.SafeInt(fm["TopicId"], 0);
     int recommand = Globals.SafeInt(fm["Type"], 0);
     Maticsoft.BLL.SNS.GroupTopics topics = new Maticsoft.BLL.SNS.GroupTopics();
     Maticsoft.Model.SNS.GroupTopics model = new Maticsoft.Model.SNS.GroupTopics();
     model = topics.GetModel(topicID);
     if (recommand < 2)
     {
         if (topics.UpdateRecommand(topicID, recommand))
         {
             return base.Content("Ok");
         }
         return base.Content("No");
     }
     if (recommand != 2)
     {
         return null;
     }
     model.IsRecomend = 0;
     if (topics.DeleteEx(topicID))
     {
         return base.Content("Ok");
     }
     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);
         }
     }
 }