예제 #1
0
 private void LoadData(string strType)
 {
     if (strType == "1")
     {
         string strID = Request.QueryString["value"];//操作ID
         zlzw.BLL.ADImageListBLL aDImageListBLL = new zlzw.BLL.ADImageListBLL();
         zlzw.Model.ADImageListModel aDImageListModel = aDImageListBLL.GetModel(int.Parse(Get_ID(aDImageListBLL, strID)));
         txbAdImageTitle.Text = aDImageListModel.AdImageTitle;//图片名称 `
         txbADLink.Text = aDImageListModel.ADLink;//链接地址
         txbADContent.Text = aDImageListModel.ADContent;//内容简介
         ViewState["fileADImagePath"] = aDImageListModel.ADImagePath.ToString();//图片地址
         ViewState["AdminGUID"] = aDImageListModel.ADImageGUID.ToString();
         ToolbarText2.Text = "编辑一个图片";
     }
     btnClose.OnClientClick = ActiveWindow.GetConfirmHideReference();
 }
예제 #2
0
        protected void btnDel_Click(object sender, EventArgs e)
        {
            if (grid1.SelectedRowIndexArray != null && grid1.SelectedRowIndexArray.Length > 0)
            {
                string strSelectID = "0";
                for (int i = 0, count = grid1.SelectedRowIndexArray.Length; i < count; i++)
                {
                    int rowIndex = grid1.SelectedRowIndexArray[i];
                    foreach (object key in grid1.DataKeys[rowIndex])
                    {
                        strSelectID = key.ToString();
                    }
                }
                #region 删除逻辑

                zlzw.BLL.ADImageListBLL aDImageListBLL = new zlzw.BLL.ADImageListBLL();
                DataTable dt = aDImageListBLL.GetList("ADImageGUID='" + strSelectID + "'").Tables[0];
                zlzw.Model.ADImageListModel aDImageListModel = aDImageListBLL.GetModel(int.Parse(dt.Rows[0]["ADImageID"].ToString()));
                aDImageListModel.IsEnable = 0;
                aDImageListBLL.Update(aDImageListModel);
                ADImageList_BindGrid();

                #endregion
            }
            else
            {
                return;
            }
        }