Esempio n. 1
0
 protected void rpTopic_ItemCommand(object source, System.Web.UI.WebControls.RepeaterCommandEventArgs e)
 {
     if (e.CommandName == "del")
     {
         int num = System.Convert.ToInt32(e.CommandArgument);
         if (VShopHelper.Deletetopic(num))
         {
             VShopHelper.RemoveReleatesProductBytopicid(num);
             this.ShowMsg("删除成功!", true);
             this.BindTopicList();
         }
     }
 }
Esempio n. 2
0
 protected void rpTopic_ItemCommand(object source, RepeaterCommandEventArgs e)
 {
     if (e.CommandName == "del")
     {
         int topicId = Convert.ToInt32(e.CommandArgument);
         if (VShopHelper.Deletetopic(topicId))
         {
             VShopHelper.RemoveReleatesProductBytopicid(topicId);
             this.ShowMsg("删除成功!", true);
             this.BindTopicList();
         }
     }
 }
Esempio n. 3
0
        private void Delete(HttpContext context)
        {
            int value = base.GetIntParam(context, "TopicId", false).Value;

            if (value <= 0)
            {
                throw new HidistroAshxException("错误的参数");
            }
            TopicInfo topicInfo = VShopHelper.Gettopic(value);

            if (topicInfo != null)
            {
                if (VShopHelper.Deletetopic(value))
                {
                    string empty  = string.Empty;
                    string empty2 = string.Empty;
                    if (topicInfo.TopicType == 1)
                    {
                        empty  = context.Server.MapPath("/Templates/topic/waptopic/topic_" + value + ".json");
                        empty2 = context.Server.MapPath("/Templates/topic/waptopic/Skin-TopicHomePage_" + value + ".html");
                    }
                    if (topicInfo.TopicType == 3)
                    {
                        empty  = context.Server.MapPath("/Templates/topic/pctopic/pctopic_" + value + ".json");
                        empty2 = context.Server.MapPath("/Templates/topic/pctopic/Skin-PcTopicHomePage_" + value + ".html");
                    }
                    else
                    {
                        empty  = context.Server.MapPath("/Templates/topic/apptopic/apptopic_" + value + ".json");
                        empty2 = context.Server.MapPath("/Templates/topic/apptopic/Skin-ApptopicHomePage_" + value + ".html");
                    }
                    File.Delete(empty);
                    File.Delete(empty2);
                    base.ReturnSuccessResult(context, "删除成功!", 0, true);
                }
                return;
            }
            throw new HidistroAshxException("错误的参数");
        }