//批量删除
        protected void btnDelete_Click(object sender, EventArgs e)
        {
            ChkAdminLevel("SettingBanner", DTEnums.ActionEnum.Delete.ToString()); //检查权限
            int sucCount   = 0;
            int errorCount = 0;

            BLL.t_bannerimage bll = new BLL.t_bannerimage();
            for (int i = 0; i < rptList.Items.Count; i++)
            {
                int      id = Convert.ToInt32(((HiddenField)rptList.Items[i].FindControl("hidId")).Value);
                CheckBox cb = (CheckBox)rptList.Items[i].FindControl("chkId");
                if (cb.Checked)
                {
                    if (bll.Delete(id))
                    {
                        sucCount += 1;
                    }
                    else
                    {
                        errorCount += 1;
                    }
                }
            }
            AddAdminLog(DTEnums.ActionEnum.Delete.ToString(), "删除管理员" + sucCount + "条,失败" + errorCount + "条"); //记录日志
            JscriptMsg("删除成功" + sucCount + "条,失败" + errorCount + "条!", Utils.CombUrlTxt("SettingBanner.aspx", "keywords={0}", this.keywords));
        }
Ejemplo n.º 2
0
        private void ShowInfo(int _id)
        {
            BLL.t_bannerimage   bll   = new BLL.t_bannerimage();
            Model.t_bannerimage model = bll.GetModel(_id);
            txt_BannerTitle.Text          = model.BannerTitle;
            model.ClickStatus             = Convert.ToInt32(sel_ClickStatus.SelectedValue);
            sel_ClickStatus.SelectedValue = model.ClickStatus.ToString();
            //txt_TrunUrl.Text = model.ClickTrunOnUrl;
            txt_UpOnLineTime.Text       = Convert.ToDateTime(model.UpOnLineTime).ToString("yyyy-MM-dd HH:mm:ss");
            txt_DownOnLimeTime.Text     = Convert.ToDateTime(model.DownOnLimeTime).ToString("yyyy-MM-dd HH:mm:ss");
            img_UpdateResult.ImageUrl   = model.ImgUrl;
            img_ClickTrunOnUrl.ImageUrl = model.ClickTrunOnUrl;

            btn_upload.Text = "修改";
            //btn_upload.Click += new EventHandler(btn_Update_Click, null);
        }