Exemplo n.º 1
0
        protected void lbtnDel_Click(object sender, EventArgs e)
        {
            CMS.DAL.CMS_Product dal = new CMS.DAL.CMS_Product();
            CMS.Model.CMS_Product model = new CMS.Model.CMS_Product();

            for (int i = 0; i < gvdataList.Rows.Count; i++)
            {
                Label label = (Label)gvdataList.Rows[i].FindControl("lb_id");
                int id = Convert.ToInt32(label.Text);
                CheckBox cb = (CheckBox)gvdataList.Rows[i].FindControl("cb_id");
                if (cb.Checked)
                {
                    model = dal.GetModel(id);
                    //删除图片
                    DeleteFile(model.CMS_ProductImg);
                    //保存日志
                   // SaveLogs("[资讯模块]删除文章:" + model.Title);
                    //删除记录
                    //bll.Delete(kindId, id);
                    dal.Delete(id);
                }
            }

            JscriptPrint("批量删除成功啦!", "ProductsList.aspx", "Success");
        }
Exemplo n.º 2
0
        private void InitData()
        {
            if (!string.IsNullOrEmpty(Request.QueryString["id"]))
            {
                int id = Int32.Parse(Request.QueryString["id"]);

                 CMS.Model.CMS_Product model = new CMS.Model.CMS_Product();
                CMS.DAL.CMS_Product dal = new CMS.DAL.CMS_Product();

                model = dal.GetModel(id);

                string ProductImg = model.CMS_ProductImg;
                string ProductName = model.CMS_ProductName;

                StringBuilder str = new StringBuilder();
                str.Append("<a href='" + ProductImg + "' title=\"" + ProductName + "\">");
                str.Append("<img alt=\"" + ProductName + "\" src=\"" + ProductImg + "\"  Width=\"300\" Height=\"300\" class=\"photo\"/>");
                str.Append("</a>");

                this.lblimgproduct.Text = str.ToString();

                this.lblProductName.Text = model.CMS_ProductName;
                this.lblProductClass.Text = model.CMS_ProductClassID.ToString();
                this.lblContent.Text = model.CMS_ProductContent;
            }
        }
Exemplo n.º 3
0
        private void ShowInfo(int ID)
        {
            CMS.DAL.CMS_Product bll = new CMS.DAL.CMS_Product();
            CMS.Model.CMS_Product model = bll.GetModel(ID);
            this.hdfid.Value = model.ID.ToString();
            this.txtProductName.Text = model.CMS_ProductName;
            this.ddlProductClass.SelectedValue = model.CMS_ProductClassID.ToString();
            this.txtContent.Value = model.CMS_ProductContent;
            this.txtProductImg.Text = model.CMS_ProductImg;

            this.txtPuter.Text = model.CMS_Puter;
            this.cbxIsSlide.Checked = (model.CMS_IsSlide == 1) ? true : false;
        }