示例#1
0
        //编辑绑定
        private void editProduct(int id)
        {

            ProductDal red = new ProductDal();
            ProductInfo pro = red.read(id);
            ProductName.Value = pro.productName;
            title1.Value = pro.title1;
            //title2.Value = "";//pro.title2;
            content.Value = pro.content;
            content1.Value = pro.content1;
            content2.Value = pro.content2;
            content3.Value = pro.content3;
            articleImg.Src = pro.productImgUrl;
            listImgA.HRef = pro.productImgUrl;
            filePath.Value = pro.productImgUrl;

            int TypeId = pro.TypeId;
            foreach (ListItem list in typeId.Items)
            {
                if (list.Value.ToString() == TypeId.ToString())
                {
                    list.Selected = true;
                    break;
                }
            }

        }
示例#2
0
文件: manage.aspx.cs 项目: joleye/1.6
 private void bind_update(int id, string showHome)
 {
     ProductInfo info = new ProductInfo();
     if (showHome == "True")
         info.showHome = true;
     else
         info.showHome = false;
     ProductDal dal = new ProductDal();
     dal.setShowHome(id, info);
 }
示例#3
0
文件: Search.cs 项目: joleye/1.6
        public List<ProductInfo> search()
        {
            ProductDal pro = new ProductDal();
            int id = 0;
            gnum(ref id, "tid");
            int page = 1;
            int pagesize = 12;
            PageCurrent pc = new PageCurrent();
            page = pc.get("page");
            List<JoleYe.Model.ProductInfo> list = pro.view_list(id,page,pagesize);

            int recordcount = pro.recordcount;
            pageBox = pc.page_list("?page=", pagesize, recordcount);

            return list;
        }
示例#4
0
    protected void create_279_thumbs_Click(object sender, EventArgs e)
    {
        List<ProductInfo> list = new List<ProductInfo>();
        ProductDal dal = new ProductDal();

        list = dal.view_list();

        foreach (ProductInfo info in list)
        {
            if (dal.set_thumbs_img(info.Id, 279, "small"))
            {
                Response.Write("成功 <a target=\"_blank\" href=\"" + cimg(info.productImgUrl, "small") + "\">" + cimg(info.productImgUrl, "small") + "</a><br/>");
            }
            else
                Response.Write("<font color=red>失败</font> " + info.productImgUrl + "<br/>");
        }
    }
示例#5
0
文件: manage.aspx.cs 项目: joleye/1.6
        private void setBind()
        {
            int pagesize = 10;
            int page = 1;
            int recordcount=2;
            PageCurrent pc = new PageCurrent();
            page = pc.get("page");
            wd.Value = keyword;


            //DataTable dt = find("view_product", page, pagesize, " showId ,id desc");
            ProductDal p = new ProductDal();
                


                
            Pageer.value = pc.page_list("?page=", pagesize, recordcount);
            detail.DataSource = p.view_list(page, pagesize, 0, keyword);
            detail.DataBind();
        }
示例#6
0
文件: manage.aspx.cs 项目: joleye/1.6
        public bool bind_del(int id)
        {
            ProductDal sd = new ProductDal();
            return sd.del(id);

        }
示例#7
0
文件: manage.aspx.cs 项目: joleye/1.6
 private void setOrder(int id, int showId)
 {
     ProductDal sd = new ProductDal();
     sd.setOrder(id, showId);
 }
示例#8
0
        //保存
        protected void Submit1_ServerClick(object sender, EventArgs e)
        {
            ProductInfo proinfo = new ProductInfo();
            
            proinfo.productName = ProductName.Value.ToString();
            proinfo.title1 = title1.Value.ToString();
            proinfo.title2 = "";//title2.Value.ToString();
            proinfo.TypeId = Int32.Parse(typeId.Text);
            proinfo.content = content.Value.ToString();
            proinfo.content1 = content1.Value.ToString();
            proinfo.content2 = content2.Value.ToString();
            proinfo.content3 = content3.Value.ToString();

            Img im = new Img();
            im.savePathName = "products";

            proinfo.productImgUrl = im.saveImage(filePath.Value);


            if (string.IsNullOrEmpty(im.error))
            {
                ProductDal dal = new ProductDal();
                if (app == "edit")
                {
                    proinfo.Id = id;
                    dal.updateProduct(proinfo);
                    editProduct(id);
                }
                else
                {
                    
                    dal.createProduct(proinfo);
                }

                showMessage("保存成功", "manage.aspx");
            }
            else
            {
                showMessage("出现了错误:"+im.error);
            }
        }