Beispiel #1
0
 private void ShowInfo(int _id)
 {
     BLL.plugin_images   bll   = new BLL.plugin_images();
     Model.plugin_images model = bll.GetModel(_id);
     txtName.Text             = model.title;
     txtUrl.Text              = model.link_url;
     rblTarget.SelectedValue  = model.target;
     txtSort.Text             = model.sort_id.ToString();
     rblHide.SelectedValue    = model.is_lock.ToString();
     ddlClassId.SelectedValue = model.class_id.ToString();
     txtColor.Text            = model.back_color;
     txtContent.Value         = model.content;
     this.contentType         = model.is_type;
     ddlType.SelectedValue    = this.contentType.ToString();
     txtImgUrl.Text           = model.img_url;
     if (!string.IsNullOrEmpty(model.img_url))
     {
         divImg.Visible  = true;
         imgUrl.ImageUrl = model.img_url;
     }
     txtIconUrl.Text = model.icon_url;
     if (!string.IsNullOrEmpty(model.icon_url))
     {
         divIcon.Visible  = true;
         imgIcon.ImageUrl = model.icon_url;
     }
 }
Beispiel #2
0
 private bool DoEdit(int _id)
 {
     BLL.plugin_images   bll   = new BLL.plugin_images();
     Model.plugin_images model = bll.GetModel(_id);
     model.title      = txtName.Text;
     model.link_url   = txtUrl.Text;
     model.img_url    = txtImgUrl.Text;
     model.target     = rblTarget.SelectedValue;
     model.is_lock    = int.Parse(rblHide.SelectedValue);
     model.sort_id    = Utils.StrToInt(txtSort.Text, 99);
     model.back_color = txtColor.Text;
     model.is_type    = Utils.StrToInt(ddlType.SelectedValue, 0);
     model.content    = txtContent.Value;
     model.class_id   = Utils.StrToInt(ddlClassId.SelectedValue, 0);
     model.img_url    = txtImgUrl.Text.Trim();
     model.icon_url   = txtIconUrl.Text.Trim();
     if (bll.Update(model))
     {
         AddAdminLog(DTEnums.ActionEnum.Edit.ToString(), "修改橱窗内容:" + model.title);
         return(true);
     }
     return(false);
 }