private void ShowInfo(int _id) { BLL.wx_shop_category bll = new BLL.wx_shop_category(); Model.wx_shop_category model = bll.GetModel(_id); ddlParentId.SelectedValue = model.parent_id.ToString(); txtTitle.Text = model.title; txtSortId.Text = model.sort_id.ToString(); txtSeoTitle.Text = model.seo_title; txtSeoKeywords.Text = model.seo_keywords; txtSeoDescription.Text = model.seo_description; txtLinkUrl.Text = model.link_url; txtImgUrl.Text = model.img_url; if (model.img_url != null && model.img_url.Trim() != "") { // imgUrl.ImageUrl = model.img_url; } txtContent.Text = model.class_content; txtImgICO.Text = model.ico_url; if (model.ico_url != null && model.ico_url.Trim() != "") { if (model.ico_url.Contains("/")) { imgIco.ImageUrl = model.ico_url; } else { imgIco.Style.Add("display", "none"); litImgIco.Text = "<span class=\"" + model.ico_url + "\"></span>"; } } }
private bool DoEdit(int _id) { try { BLL.wx_shop_category bll = new BLL.wx_shop_category(); Model.wx_shop_category model = bll.GetModel(_id); int parentId = int.Parse(ddlParentId.SelectedValue); model.title = txtTitle.Text.Trim(); //如果选择的父ID不是自己,则更改 if (parentId != model.id) { model.parent_id = parentId; } model.sort_id = int.Parse(txtSortId.Text.Trim()); model.seo_title = txtSeoTitle.Text; model.seo_keywords = txtSeoKeywords.Text; model.seo_description = txtSeoDescription.Text; model.link_url = txtLinkUrl.Text.Trim(); model.img_url = txtImgUrl.Text.Trim(); model.class_content = txtContent.Text.Trim(); model.ico_url = Request.Form["txtImgICO"].Trim();// txtImgICO.Text; if (bll.Update(model)) { AddAdminLog(MXEnums.ActionEnum.Edit.ToString(), "修改商品目分类:" + model.title); //记录日志 return(true); } } catch { return(false); } return(false); }
private void ShowInfo(int _id) { BLL.wx_shop_category bll = new BLL.wx_shop_category(); Model.wx_shop_category model = bll.GetModel(_id); ddlParentId.SelectedValue = model.parent_id.ToString(); txtTitle.Text = model.title; txtSortId.Text = model.sort_id.ToString(); txtSeoTitle.Text = model.seo_title; txtSeoKeywords.Text = model.seo_keywords; txtSeoDescription.Text = model.seo_description; txtLinkUrl.Text = model.link_url; txtImgUrl.Text = model.img_url; if (model.img_url != null && model.img_url.Trim() != "") { imgUrl.ImageUrl = model.img_url; } txtContent.Text = model.class_content; txtImgICO.Text = model.ico_url; if (model.ico_url != null && model.ico_url.Trim() != "") { if (model.ico_url.Contains("/")) { imgIco.ImageUrl = model.ico_url; } else { imgIco.Style.Add("display", "none"); litImgIco.Text = "<span class=\"" + model.ico_url + "\"></span>"; } } }
private bool DoEdit(int _id) { try { BLL.wx_shop_category bll = new BLL.wx_shop_category(); Model.wx_shop_category model = bll.GetModel(_id); int parentId = int.Parse(ddlParentId.SelectedValue); model.title = txtTitle.Text.Trim(); //如果选择的父ID不是自己,则更改 if (parentId != model.id) { model.parent_id = parentId; } model.sort_id = int.Parse(txtSortId.Text.Trim()); model.seo_title = txtSeoTitle.Text; model.seo_keywords = txtSeoKeywords.Text; model.seo_description = txtSeoDescription.Text; model.link_url = txtLinkUrl.Text.Trim(); model.img_url = txtImgUrl.Text.Trim(); model.class_content = txtContent.Text.Trim(); model.ico_url = Request.Form["txtImgICO"].Trim();// txtImgICO.Text; if (bll.Update(model)) { AddAdminLog(MXEnums.ActionEnum.Edit.ToString(), "修改商品目分类:" + model.title); //记录日志 return true; } } catch { return false; } return false; }