protected void sbEdit_ServerClick(object sender, EventArgs e) { if (Request["id"] != null) { try { AdvInfo ob = AdvInfoService.GetAdvInfoById(int.Parse(Request["id"])); if (ob != null) { ob.title = tbtitle.Text; ob.imgurl = tbimgUrl.Text; ob.imglink = tbimgLink.Text; ob.flyimagewidth = int.Parse(tbFlyImageWidth.Text); ob.flyimageheight = int.Parse(tbFlyImageHeight.Text); ob.addtime = Convert.ToDateTime(tbAddTime.Text); ob.flag = this.rbFlag.SelectedValue == "1" ? true : false; AdvInfoService.UpdateAdvInfo(ob); } } catch { ShowJs.ShowAndRedirect("修改失败!", hdUrl.Value, this.Page); } } ShowJs.ShowAndRedirect("修改成功!", hdUrl.Value, this.Page); }