private void Bind() { Mod_Information dto = new Mod_Information(); if (id != 0) { dto = BInformation.GetModel(string.Format("ID={0} AND WebSiteID={1}", id, AdminManage.WebSiteID)); if (dto != null) { txtTitle.Text = dto.Title; txtContent.Text = dto.Content1; txtImage.Text = dto.Image; txtVideo.Text = dto.FileURL; txtIntroduction.Text = dto.Introduction; //绑定图片集 rptPicList.DataSource = BPicList.GetList(0, string.Format("ProductID={0} AND WebSiteID={1} AND Model='XWXC' and State=1 ", id, AdminManage.WebSiteID), " OrderBy asc,ID asc "); rptPicList.DataBind(); } else { MessageBox.ShowRedirect(this, "信息已删除或不存在!", "Column/Default/Index.aspx"); } } }
private void Bind() { ddlBaseType.SelectedValue = ParentID.ToString(); Mod_BaseType dto = new Mod_BaseType(); if (id != 0) { dto = BBaseType.GetModel(string.Format("ID={0} AND WebSiteID={1}", id, AdminManage.WebSiteID)); if (dto != null) { ddlBaseType.SelectedValue = dto.ParentID.ToString(); txtModel.Text = dto.Model; txtTitle.Text = dto.Title; txtOrderBy.Text = dto.OrderBy.ToString(); rblState.SelectedValue = dto.State.ToString(); rblIsAdmin.SelectedValue = dto.IsAdmin.ToString(); rblDisplayMode.SelectedValue = dto.DisplayMode.ToString(); rblIsRecommend.SelectedValue = dto.IsRecommend.ToString(); rblIsUser.SelectedValue = dto.IsUser.ToString(); txtIncludeType.Text = dto.IncludeType; txtLink.Text = dto.Link; txtInfo.Text = dto.Info; txtContent.Text = dto.Content; txtImage.Text = dto.Image; txtFileURl.Text = dto.FileURl; rblIsAdmin.SelectedValue = dto.IsAdmin.ToString(); //绑定图片集 rptPicList.DataSource = BPicList.GetList(0, string.Format("ProductID={0} AND WebSiteID={1} AND Model='FLXC' and State=1 ", id, AdminManage.WebSiteID), " OrderBy asc,ID asc "); rptPicList.DataBind(); } else { MessageBox.ShowRedirect(this, "信息已删除或不存在!", "Column/BaseType/List.aspx?" + StringHelper.DelUrlParameter("ID")); } } else { txtModel.Text = Model; } }
private void Bind() { if (IsType == 1) { ddlBaseType.Attributes.Add("datatype", "no0"); } if (IsBrowseCount == 1) { txtBrowseCount.Attributes.Add("datatype", "n"); } if (IsAddDate == 1) { txtAddDate.Attributes.Add("datatype", "datetime"); } txtAddDate.Value = DateTime.Now.ToString("yyyy-MM-dd HH:mm:ss"); CommendDate.Value = DateTime.Now.ToString("yyyy-MM-dd"); Mod_Information dto = new Mod_Information(); if (id != 0) { dto = BInformation.GetModel(string.Format("ID={0} AND WebSiteID={1}", id, AdminManage.WebSiteID)); if (dto != null) { txtTitle.Text = dto.Title; txtSubTitle.Text = dto.SubTitle; ddlBaseType.SelectedValue = dto.TypeID.ToString(); txtImage.Text = dto.Image; txtVideo.Text = dto.FileURL; txtCitationTitle.Text = dto.CitationTitle; txtContent1.Text = dto.Content1; txtOrderBy.Text = dto.OrderBy.ToString(); foreach (ListItem item in cblShow.Items) { switch (item.Value) { case "1": item.Selected = (dto.State == 1); break; case "2": item.Selected = (dto.IsTop == 1); break; case "3": item.Selected = (dto.IsCommend == 1); break; } } txtOrderBy.Text = dto.OrderBy.ToString(); txtBrowseCount.Text = dto.BrowseCount.ToString(); txtAddDate.Value = DateTime.Parse(dto.AddDate.ToString()).ToString("yyyy-MM-dd HH:mm:ss"); CommendDate.Value = DateTime.Parse(dto.CommendDate.ToString()).ToString("yyyy-MM-dd"); txtSource.Text = dto.Source; txtAuthor.Text = dto.Author; lbIntroduction.SelectedValue = dto.Introduction.ToString(); lbLink.SelectedValue = dto.Link.ToString(); //foreach (ListItem item in lbIntroduction.Items) //{ // if (dto.Introduction.IndexOf(item.Value) > -1) // { // item.Selected = true; // } //} //foreach (ListItem item in lbLink.Items) //{ // if (dto.Link.IndexOf(item.Value) > -1) // { // item.Selected = true; // } //} //绑定图片集 rptPicList.DataSource = BPicList.GetList(0, string.Format("ProductID={0} AND WebSiteID={1} AND Model='XWXC' and State=1 ", id, AdminManage.WebSiteID), " OrderBy asc,ID asc "); rptPicList.DataBind(); //绑定文件集 rptFileList.DataSource = BPicList.GetList(0, string.Format("ProductID={0} AND WebSiteID={1} AND Model='XTWJ' and State=1 ", id, AdminManage.WebSiteID), " OrderBy asc,ID asc "); rptFileList.DataBind(); } else { MessageBox.ShowRedirect(this, "信息已删除或不存在!", "Column/Download/List.aspx?" + StringHelper.DelUrlParameter("ID")); } } else { int TypeID = DNTRequest.GetQueryInt("TypeID", 0); ddlBaseType.SelectedValue = TypeID.ToString(); } }