Beispiel #1
0
        private bool DoEdit(int _id)
        {
            bool result = false;

            BLL.banner   bll   = new BLL.banner();
            Model.banner model = bll.GetModel(_id);

            model.site_path   = this.ddlSitePath.SelectedValue;
            model.title       = txtTitle.Text.Trim();
            model.href_url    = txtHref_url.Text;
            model.href_target = rblHref_target.SelectedValue;
            model.bg_color    = txtBg_color.Text;
            model.img_src     = txtImgUrl.Text;
            model.sort_id     = Utils.StrToInt(txtSortId.Text.Trim(), 99);
            if (cbIsLock.Checked == true)
            {
                model.is_lock = 0;
            }
            else
            {
                model.is_lock = 1;
            }

            if (bll.Update(model))
            {
                AddAdminLog(DTEnums.ActionEnum.Edit.ToString(), "修改Banner:" + model.title); //记录日志
                result = true;
            }

            return(result);
        }
Beispiel #2
0
 private void ShowInfo(int _id)
 {
     BLL.banner   bll   = new BLL.banner();
     Model.banner model = bll.GetModel(_id);
     this.ddlSitePath.SelectedValue = model.site_path;
     txtTitle.Text                = model.title;
     txtHref_url.Text             = model.href_url;
     rblHref_target.SelectedValue = model.href_target;
     txtBg_color.Text             = model.bg_color;
     txtSortId.Text               = model.sort_id.ToString();
     if (model.is_lock == 0)
     {
         cbIsLock.Checked = true;
     }
     else
     {
         cbIsLock.Checked = false;
     }
     this.txtImgUrl.Text = model.img_src;
 }