protected void Page_Load(object sender, EventArgs e) { if (!IsPostBack) { #region 类别树 TNode tnode = new TNode(); NodeBLL nodebll = new NodeBLL(); DataTable dt = nodebll.GetAllNode(); L_CateTree.Text = "<select id='sel' name='sel'><option value='-1'>请选择类别...</option>"; if (dt.Rows.Count > 0) { L_CateTree.Text += tool.NodeTree.GetNodeTree(dt, 0, 0); } L_CateTree.Text += "</Select>"; #endregion Tbx_Addtime.Text = DateTime.Now.ToString("yyyy-MM-dd hh:mm:ss"); Tbx_Adder.Text = this.LoginUser.Admin_RealName; H_Adder.Value = LoginUser.Admin_ID.ToString(); InfoBLL infobll = new InfoBLL(); tbx_SortId.Text = infobll.GetInfoCountsByNode(0, null, null, 1).ToString(); } }
protected void Button2_Click(object sender, EventArgs e) { TInformation tinfo = InitInfo(true); InfoBLL infobll = new InfoBLL(); int lastid = infobll.UpdateInfo(tinfo, tinfo.InfoID); CommonLibrary.RunJs.PageReplace("Info_UpdateManage.aspx?LastID=" + tinfo.InfoID + "&cid=" + tinfo.InfoCateID); }
protected void Button1_Click(object sender, EventArgs e) { TInformation tinfo = InitInfo(false); tinfo.ModifyBy = this.LoginUser.Admin_ID; tinfo.ModifyTime = DateTime.Now; InfoBLL infobll = new InfoBLL(); int lastid = infobll.UpdateInfo(tinfo, tinfo.InfoID); CommonLibrary.RunJs.PageReplace("Info_UpdateManage.aspx?LastID=" + tinfo.InfoID + "&cid=" + tinfo.InfoCateID); }
protected void Page_Load(object sender, EventArgs e) { if (!IsPostBack) { int infoid = 0; Int32.TryParse(CommonLibrary.CommOperate.GetStrFromRequestQueryString("id"), out infoid); TInformation tinfo = new TInformation(); InfoBLL infobll = new InfoBLL(); AdminBLL adinbll = new AdminBLL(); tinfo = infobll.GetInfo(infoid); tbx_title.Text = tinfo.InfoTitle; Tbx_SubMemo.Text = tinfo.InfoSubMemo; ContentHolder.Value = tinfo.InfoMemo; #region 图片列表 L_selpic.Text = ImageOperate.GetImageSelect(tinfo.InfoMemo, tinfo.InfoPic); #endregion #region 信息类型 if (tinfo.InfoType == 1) { L_selinfotype.Text = "<select id='sel_SelInfoType' name='sel_SelInfoType' > <option value=\"1\" selected=selected> 新闻 </option> <option value=\"2\"> 产品 </option></select>"; } else if (tinfo.InfoType == 2) { L_selinfotype.Text = "<select id='sel_SelInfoType' name='sel_SelInfoType' > <option value=\"1\" > 新闻 </option> <option value=\"2\" selected=selected> 产品</option></select>"; //Page.ClientScript.RegisterClientScriptBlock(Page.GetType(), "InitInfoType", "$('.dazhe').hide();", true); L_js.Text = @"<script type='text/javascript'> $(document).ready( function() { $('.dazhe').hide();} ); </script>"; } #endregion #region 商家id int shopid = tinfo.ShopID; L_shopid.Text = "<input type=\"hidden\" id=\"h_shopid\" name=\"h_shopid\" value=\"" + shopid + "\"/>"; if (shopid == -1) { tbx_ShopID.Text = "暂无商家"; } else { ShopBLL shopbll = new ShopBLL(); tbx_ShopID.Text = shopbll.GetShop(shopid).ShopTitle; } #endregion #region 品牌信息 int brandid = tinfo.BrandID; L_brandid.Text = "<input type=\"hidden\" id=\"h_brandid\" name=\"h_brandid\" value=\"" + brandid + "\"/>"; if (brandid == -1) { tbx_brand.Text = "暂无品牌信息"; } else { BrandBLL brandbll = new BrandBLL(); tbx_brand.Text = brandbll.GetBrandByID(brandid).BrandName; } #endregion tbx_SortId.Text = tinfo.SortID.ToString(); tbx_Etitle.Text = tinfo.InfoETitle; Tbx_modifier.Text = this.LoginUser.Admin_RealName; H_Modifier.Value = LoginUser.Admin_ID.ToString(); Tbx_modifytime.Text = tinfo.ModifyTime.ToString("yyyy-MM-dd hh:mm:ss"); //Tbx_Adder.Text = this.LoginUser.Admin_RealName; //H_Adder.Value = LoginUser.Admin_ID.ToString(); int Adder = 0; Int32.TryParse(tinfo.InfoAdder, out Adder); Tbx_Adder.Text = adinbll.GetAdmin(Adder).Admin_RealName; H_Adder.Value = Adder.ToString(); Tbx_BeginTime.Text = tinfo.InfoStartTime; Tbx_EndTime.Text = tinfo.InfoEndTime; Tbx_from.Text = tinfo.InfoFrom; Tbx_Addtime.Text = tinfo.InfoAddTime.ToString("yyyy-MM-dd hh:mm:ss"); Tbx_clicknum.Text = tinfo.InfoClicks.ToString(); if (tinfo.IsRecom == true) { L_IsRecoom.Text = "<input type=\"checkbox\" id=\"Chk_tuijian\" name=\"Chk_tuijian\" Checked=Checked value=\"true\" />"; } else { L_IsRecoom.Text = "<input type=\"checkbox\" id=\"Chk_tuijian\" name=\"Chk_tuijian\" value=\"true\" />"; } if (tinfo.IsRemote == true) { L_isRemote.Text = "<input type=\"checkbox\" id=\"Chk_Remote\" name=\"Chk_Remote\" value=\"true\" Checked=Checked />"; } else { L_isRemote.Text = "<input type=\"checkbox\" id=\"Chk_Remote\" name=\"Chk_Remote\" value=\"true\" />"; } Tbx_tag.Text = tinfo.InfoTag; NodeBLL nodebll = new NodeBLL(); DataTable dt = nodebll.GetAllNode(); L_CateTree.Text = "<select id='sel' name='sel'><option value='-1'>请选择类别...</option>"; if (dt.Rows.Count > 0) { L_CateTree.Text += tool.NodeTree.GetNodeTree(dt, 0, 0, tinfo.InfoCateID); } L_CateTree.Text += "</Select>"; } }