private void ShowInfo(int _id) { BLL.cityinfo bll = new BLL.cityinfo(); Model.cityinfo model = bll.GetModel(_id); ddlParentId.SelectedValue = model.parent_id.ToString(); txtCallIndex.Text = model.call_index; 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; txtContent.Value = model.content; }
private bool DoEdit(int _id) { try { BLL.cityinfo bll = new BLL.cityinfo(); Model.cityinfo model = bll.GetModel(_id); int parentId = int.Parse(ddlParentId.SelectedValue); model.channel_id = this.channel_id; model.call_index = txtCallIndex.Text.Trim(); 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.content = txtContent.Value; if (!bll.Update(model)) { return false; } } catch { return false; } return true; }