Пример #1
0
 private void BatchActionManage(string idlist)
 {
     Products products = new Products();
     Photos photos = new Photos();
     int result = 0;
     int num2 = 0;
     foreach (string str in idlist.Split(new char[] { ',' }, StringSplitOptions.RemoveEmptyEntries))
     {
         string[] strArray2 = str.Split(new char[] { '_' }, StringSplitOptions.RemoveEmptyEntries);
         if (strArray2[0] == "0")
         {
             this.Postbll.DeleteListByNormalPost(strArray2[1], true, base.CurrentUser.UserID);
         }
         else if (strArray2[0] == "1")
         {
             DataSet set = photos.DeleteListEx(strArray2[1], out result, true, base.CurrentUser.UserID);
             if (set != null)
             {
                 this.PhysicalFileInfo(set.Tables[0]);
             }
         }
         else
         {
             DataSet set2 = products.DeleteListEx(strArray2[1], out num2, false, 1);
             if (set2 != null)
             {
                 this.PhysicalFileInfo(set2.Tables[0]);
             }
         }
     }
 }
Пример #2
0
 public ActionResult AjaxRecommandOperation(FormCollection fm)
 {
     if (base.UserPrincipal.HasPermissionID(base.GetPermidByActID(base.Act_ApproveList)))
     {
         string str = fm["Type"];
         string str2 = fm["TargetType"];
         int productId = Globals.SafeInt(fm["TargetId"], 0);
         if (((productId > 0) && !string.IsNullOrEmpty(str)) && !string.IsNullOrEmpty(str2))
         {
             if (str2 == "product")
             {
                 Products products = new Products();
                 if (products.UpdateRecomend(productId, (str == "recommand") ? 1 : 0))
                 {
                     return base.Content("Yes");
                 }
             }
             else
             {
                 Photos photos = new Photos();
                 if (photos.UpdateRecomend(productId, (str == "recommand") ? 1 : 0))
                 {
                     return base.Content("Yes");
                 }
             }
         }
     }
     return base.Content("No");
 }
Пример #3
0
 private void ShowInfo(int PhotoID)
 {
     Maticsoft.Model.SNS.Photos model = new Maticsoft.BLL.SNS.Photos().GetModel(PhotoID);
     this.txtImage.ImageUrl = model.ThumbImageUrl;
     this.radlState.SelectedValue = model.Status.ToString();
     this.txtDescription.Text = model.Description;
     this.txtCreatedNickName.Text = model.CreatedNickName;
     this.PhotoCategory.SelectedValue = model.CategoryId.ToString();
     this.rabRecomend.SelectedValue = model.IsRecomend.ToString();
     this.txtCommentCount.Text = model.CommentCount.ToString();
     this.txtFavouriteCount.Text = model.FavouriteCount.ToString();
     this.ddlTags.DataSource = this.bllTags.GetList("");
     this.ddlTags.DataTextField = "TagName";
     this.ddlTags.DataValueField = "TagName";
     this.ddlTags.DataBind();
     this.TagsValue = model.Tags;
 }
Пример #4
0
        public ActionResult AjaxDelPost(FormCollection Fm)
        {
            int postID = Globals.SafeInt(Fm["PostId"], 0);
            Maticsoft.Model.SNS.Posts model = base.PostsBll.GetModel(postID);
            Maticsoft.BLL.SNS.Photos photos = new Maticsoft.BLL.SNS.Photos();
            Maticsoft.BLL.SNS.Products products = new Maticsoft.BLL.SNS.Products();
            int result = 0;
            DataSet set = new DataSet();
            int valueOrDefault = model.Type.GetValueOrDefault();
            if (model.Type.HasValue)
            {
                switch (valueOrDefault)
                {
                    case 0:
                        if ((base.PostsBll.DeleteEx(postID, false, 1) && !string.IsNullOrWhiteSpace(model.ImageUrl)) && !model.ImageUrl.StartsWith("http://"))
                        {
                            this.DeletePhysicalFile(model.ImageUrl);
                        }
                        goto Label_017A;

                    case 1:
                        set = photos.DeleteListEx(model.TargetId.ToString(), out result, false, 1);
                        if (set != null)
                        {
                            this.PhysicalFileInfo(set.Tables[0]);
                        }
                        goto Label_017A;

                    case 2:
                        set = products.DeleteListEx(model.TargetId.ToString(), out result, false, 1);
                        if (set != null)
                        {
                            this.PhysicalFileInfo(set.Tables[0]);
                        }
                        goto Label_017A;

                    case 4:
                        new Maticsoft.BLL.SNS.UserBlog().DeleteEx(model.TargetId);
                        goto Label_017A;
                }
            }
            if ((base.PostsBll.DeleteEx(postID, false, 1) && !string.IsNullOrWhiteSpace(model.ImageUrl)) && !model.ImageUrl.StartsWith("http://"))
            {
                this.DeletePhysicalFile(model.ImageUrl);
            }
        Label_017A:
            return base.Content(postID.ToString());
        }
Пример #5
0
        protected void gridView_RowCommand(object sender, GridViewCommandEventArgs e)
        {
            if (!e.CommandArgument.Equals("Delete"))
            {
                return;
            }
            if ((e.CommandName == null) || (e.CommandName.ToString() == ""))
            {
                return;
            }
            int postID = Globals.SafeInt(e.CommandName, -1);
            Maticsoft.Model.SNS.Posts modelByCache = this.bll.GetModelByCache(postID);
            Maticsoft.BLL.SNS.Photos photos = new Maticsoft.BLL.SNS.Photos();
            Maticsoft.BLL.SNS.Products products = new Maticsoft.BLL.SNS.Products();
            int result = 0;
            DataSet set = new DataSet();
            int valueOrDefault = modelByCache.Type.GetValueOrDefault();
            if (modelByCache.Type.HasValue)
            {
                switch (valueOrDefault)
                {
                    case 0:
                        if ((this.bll.DeleteEx(postID, true, base.CurrentUser.UserID) && !string.IsNullOrWhiteSpace(modelByCache.ImageUrl)) && !modelByCache.ImageUrl.StartsWith("http://"))
                        {
                            this.DeletePhysicalFile(modelByCache.ImageUrl);
                        }
                        goto Label_01B3;

                    case 1:
                        set = photos.DeleteListEx(modelByCache.TargetId.ToString(), out result, true, base.CurrentUser.UserID);
                        if (set != null)
                        {
                            this.PhysicalFileInfo(set.Tables[0]);
                        }
                        goto Label_01B3;

                    case 2:
                        set = products.DeleteListEx(modelByCache.TargetId.ToString(), out result, true, base.CurrentUser.UserID);
                        if (set != null)
                        {
                            this.PhysicalFileInfo(set.Tables[0]);
                        }
                        goto Label_01B3;
                }
            }
            if ((this.bll.DeleteEx(postID, true, base.CurrentUser.UserID) && !string.IsNullOrWhiteSpace(modelByCache.ImageUrl)) && !modelByCache.ImageUrl.StartsWith("http://"))
            {
                this.DeletePhysicalFile(modelByCache.ImageUrl);
            }
        Label_01B3:
            this.gridView.OnBind();
            LogHelp.AddUserLog(base.CurrentUser.UserName, base.CurrentUser.UserType, "删除动态(PostID=" + postID + ")成功", this);
            MessageBox.ShowSuccessTip(this, "删除成功!");
        }
Пример #6
0
 protected void btnDelete_Click(object sender, EventArgs e)
 {
     Maticsoft.BLL.SNS.Products products = new Maticsoft.BLL.SNS.Products();
     Maticsoft.BLL.SNS.Photos photos = new Maticsoft.BLL.SNS.Photos();
     if (this.GetSelIDlist().Trim().Length != 0)
     {
         int result = 0;
         int num2 = 0;
         string selIDTypelist = this.GetSelIDTypelist("1");
         if (!string.IsNullOrEmpty(selIDTypelist) && (selIDTypelist.Length > 0))
         {
             DataSet set = photos.DeleteListEx(selIDTypelist, out result, true, base.CurrentUser.UserID);
             if (set != null)
             {
                 this.PhysicalFileInfo(set.Tables[0]);
             }
             LogHelp.AddUserLog(base.CurrentUser.UserName, base.CurrentUser.UserType, "批量删除图片动态(ProductID=" + selIDTypelist + ")成功", this);
         }
         string str3 = this.GetSelIDTypelist("2");
         if (!string.IsNullOrEmpty(str3) && (str3.Length > 0))
         {
             DataSet set2 = products.DeleteListEx(str3, out num2, true, base.CurrentUser.UserID);
             if (set2 != null)
             {
                 this.PhysicalFileInfo(set2.Tables[0]);
             }
             LogHelp.AddUserLog(base.CurrentUser.UserName, base.CurrentUser.UserType, "批量删除商品动态(ProductID=" + str3 + ")成功", this);
         }
         string postIDs = this.GetSelIDTypelist("0");
         bool flag = false;
         if (postIDs.Length > 0)
         {
             LogHelp.AddUserLog(base.CurrentUser.UserName, base.CurrentUser.UserType, "批量删除文字动态(PostID=" + postIDs + ")成功", this);
             flag = this.bll.DeleteListByNormalPost(postIDs, true, base.CurrentUser.UserID);
         }
         if (((result == 1) || (num2 == 1)) || flag)
         {
             MessageBox.ShowSuccessTip(this, "删除成功!");
         }
         else
         {
             MessageBox.ShowSuccessTip(this, "删除失败!");
         }
         this.gridView.OnBind();
     }
 }
Пример #7
0
 public ActionResult WaterfallPhotoListData(string keyword, string type, int startIndex)
 {
     keyword = InjectionFilter.Filter(keyword);
     Maticsoft.BLL.SNS.Photos photos = new Maticsoft.BLL.SNS.Photos();
     PhotoList model = new PhotoList();
     ((dynamic) base.ViewBag).BasePageSize = this._basePageSize;
     startIndex = (startIndex > 1) ? (startIndex + 1) : 0;
     int endIndex = (startIndex > 1) ? ((startIndex + this._waterfallDetailCount) - 1) : this._waterfallDetailCount;
     if (photos.GetSearchCountByQ(keyword) < 1)
     {
         return new EmptyResult();
     }
     model.PhotoListWaterfall = photos.GetListByKeyWord(keyword, type, startIndex, endIndex, "");
     string valueByCache = Maticsoft.BLL.SysManage.ConfigSystem.GetValueByCache("SNSIsStatic");
     if ((model.PhotoListWaterfall != null) && (model.PhotoListWaterfall.Count > 0))
     {
         foreach (PostContent content in model.PhotoListWaterfall)
         {
             if (valueByCache != "true")
             {
                 content.StaticUrl = (string) ((((dynamic) base.ViewBag).BasePath + "Photo/Detail/") + content.TargetId);
                 continue;
             }
             content.StaticUrl = string.IsNullOrWhiteSpace(content.StaticUrl) ? ((string) ((((dynamic) base.ViewBag).BasePath + "Photo/Detail/") + content.TargetId)) : content.StaticUrl;
         }
     }
     return base.View(base.CurrentThemeViewPath + "/Photo/PhotoListWaterfall.cshtml", model);
 }
Пример #8
0
 public ActionResult Photo(int? pageIndex)
 {
     ((dynamic) base.ViewBag).Title = "图片搜索";
     string inputString = string.IsNullOrWhiteSpace(base.Request.Params["keyword"]) ? "" : base.Server.UrlDecode(base.Request.Params["keyword"]);
     string orderby = string.IsNullOrWhiteSpace(base.Request.Params["type"]) ? "hot" : base.Request.Params["type"];
     inputString = InjectionFilter.Filter(inputString);
     this.LogKeyWord(inputString);
     PhotoList model = new PhotoList();
     Maticsoft.BLL.SNS.Photos photos = new Maticsoft.BLL.SNS.Photos();
     int pageSize = this._basePageSize + this._waterfallSize;
     ((dynamic) base.ViewBag).BasePageSize = this._basePageSize;
     pageIndex = new int?((pageIndex.HasValue && (pageIndex.Value > 1)) ? pageIndex.Value : 1);
     int startIndex = (pageIndex.Value > 1) ? (((pageIndex.Value - 1) * pageSize) + 1) : 0;
     int endIndex = (pageIndex.Value > 1) ? ((startIndex + this._basePageSize) - 1) : this._basePageSize;
     int searchCountByQ = 0;
     searchCountByQ = photos.GetSearchCountByQ(inputString);
     ((dynamic) base.ViewBag).CurrentPageAjaxStartIndex = endIndex;
     int num5 = pageIndex.Value * pageSize;
     ((dynamic) base.ViewBag).CurrentPageAjaxEndIndex = (num5 > searchCountByQ) ? searchCountByQ : num5;
     if (searchCountByQ >= 1)
     {
         ((dynamic) base.ViewBag).sequence = orderby;
         int? nullable = pageIndex;
         model.PhotoPagedList = photos.GetListByKeyWord(inputString, orderby, startIndex, endIndex, "").ToPagedList<PostContent>(nullable.HasValue ? nullable.GetValueOrDefault() : 1, pageSize, new int?(searchCountByQ));
         string valueByCache = Maticsoft.BLL.SysManage.ConfigSystem.GetValueByCache("SNSIsStatic");
         if ((model.PhotoPagedList != null) && (model.PhotoPagedList.Count > 0))
         {
             foreach (PostContent content in model.PhotoPagedList)
             {
                 if (valueByCache != "true")
                 {
                     content.StaticUrl = (string) ((((dynamic) base.ViewBag).BasePath + "Photo/Detail/") + content.TargetId);
                     continue;
                 }
                 content.StaticUrl = string.IsNullOrWhiteSpace(content.StaticUrl) ? ((string) ((((dynamic) base.ViewBag).BasePath + "Photo/Detail/") + content.TargetId)) : content.StaticUrl;
             }
         }
         if (base.Request.IsAjaxRequest())
         {
             return this.PartialView("PhotoList", model);
         }
     }
     return base.View(model);
 }
Пример #9
0
 public PartialViewResult PhotoPart(int Top = 5, string viewName = "_PhotoPart")
 {
     List<Maticsoft.Model.SNS.Photos> topPhotoList = new Maticsoft.BLL.SNS.Photos().GetTopPhotoList(Top, -1);
     return this.PartialView(viewName, topPhotoList);
 }
Пример #10
0
 private List<string> PhotoPhysicalInfo(int ID)
 {
     List<Maticsoft.Model.SNS.Photos> list = new Maticsoft.BLL.SNS.Photos().UserUploadPhotoList(ID);
     if ((list != null) && (list.Count > 0))
     {
         List<string> list2 = new List<string>();
         foreach (Maticsoft.Model.SNS.Photos photos2 in list)
         {
             if (!string.IsNullOrWhiteSpace(photos2.PhotoUrl) && !photos2.PhotoUrl.StartsWith("http://"))
             {
                 list2.Add(base.Server.MapPath(photos2.PhotoUrl));
                 list2.Add(base.Server.MapPath(photos2.ThumbImageUrl));
                 list2.Add(base.Server.MapPath(photos2.NormalImageUrl));
             }
         }
         if (list2.Count > 0)
         {
             return list2;
         }
     }
     return null;
 }
Пример #11
0
 public PartialViewResult PhotoPart(int Top = 12, int Type = -1, string ViewName = "PhotoPart")
 {
     List<Maticsoft.Model.SNS.Photos> topPhotoList = new Maticsoft.BLL.SNS.Photos().GetTopPhotoList(Top, Type);
     if ((topPhotoList != null) && (topPhotoList.Count > 0))
     {
         string valueByCache = Maticsoft.BLL.SysManage.ConfigSystem.GetValueByCache("SNSIsStatic");
         foreach (Maticsoft.Model.SNS.Photos photos2 in topPhotoList)
         {
             if (valueByCache != "true")
             {
                 photos2.StaticUrl = (string) ((((dynamic) base.ViewBag).BasePath + "Photo/Detail/") + photos2.PhotoID);
                 continue;
             }
             photos2.StaticUrl = string.IsNullOrWhiteSpace(photos2.StaticUrl) ? ((string) ((((dynamic) base.ViewBag).BasePath + "Photo/Detail/") + photos2.PhotoID)) : photos2.StaticUrl;
         }
     }
     return this.PartialView(ViewName, topPhotoList);
 }
Пример #12
0
 public static string GetPhotoUrl(int photoId)
 {
     Maticsoft.Model.SNS.Photos model = new Maticsoft.BLL.SNS.Photos().GetModel(photoId);
     if (model != null)
     {
         return GetPhotoUrl(model);
     }
     return "";
 }