Ejemplo n.º 1
0
        protected void rptList_ItemCommand(object source, RepeaterCommandEventArgs e)
        {
            int id = Convert.ToInt32(((Label)e.Item.FindControl("lb_id")).Text);

            Cms.DAL.ProductInfo   dal   = new Cms.DAL.ProductInfo();
            Cms.Model.ProductInfo model = dal.GetModel(id);
            switch (e.CommandName.ToLower())
            {
            case "ibtntop":
                if (model.IsTop == 1)
                {
                    dal.UpdateField(id, "IsTop=0");
                }
                else
                {
                    dal.UpdateField(id, "IsTop=1");
                }
                break;
            }
            RptBind();
        }
        protected void Page_Load(object sender, EventArgs e)
        {
            if (!int.TryParse(Request.Params["specId"] as string, out this.specId))
            {
                Response.Write("<script>alert('您要查看的信息参数不正确或不存在!'),location.href='ProductList.aspx';</script>");
                return;
            }

            Cms.DAL.ProductInfo dal = new Cms.DAL.ProductInfo();
            model = dal.GetModel(this.specId);//获得Id
            if (model == null)
            {
                Response.Write("<script>alert('您要查看的信息参数不正确或不存在!'),location.href='ProductList.aspx';</script>");
                return;
            }
            //浏览数+1
            dal.UpdateField(this.specId, "Click=Click+1");
            ClientScript.RegisterStartupScript(this.GetType(), "", "<script type='text/javascript'>menuEnable(2);</script>");
        }
        protected void Page_Load(object sender, EventArgs e)
        {
            if (!int.TryParse(Request.Params["specId"] as string, out this.specId))
            {
                Response.Write("<script>alert('您要查看的信息参数不正确或不存在!'),location.href='ProductList.aspx';</script>");
                return;
            }

            Cms.DAL.ProductInfo dal = new Cms.DAL.ProductInfo();
            model = dal.GetModel(this.specId);//获得Id
            if (model == null)
            {
                Response.Write("<script>alert('您要查看的信息参数不正确或不存在!'),location.href='ProductList.aspx';</script>");
                return;
            }
            //浏览数+1
            dal.UpdateField(this.specId, "Click=Click+1");
            ClientScript.RegisterStartupScript(this.GetType(), "", "<script type='text/javascript'>menuEnable(2);</script>");
        }
Ejemplo n.º 4
0
 protected void rptList_ItemCommand(object source, RepeaterCommandEventArgs e)
 {
     int id = Convert.ToInt32(((Label)e.Item.FindControl("lb_id")).Text);
     Cms.DAL.ProductInfo dal = new Cms.DAL.ProductInfo();
     Cms.Model.ProductInfo model = dal.GetModel(id);
     switch (e.CommandName.ToLower())
     {
         case "ibtntop":
             if (model.IsTop == 1)
                 dal.UpdateField(id, "IsTop=0");
             else
                 dal.UpdateField(id, "IsTop=1");
             break;
     }
     RptBind();
 }