protected void Page_Load(object sender, EventArgs e) { if (!Page.IsPostBack) { int typeId = 0; string id = Request.QueryString["id"]; if (id != null && id != "") { try { typeId = Convert.ToInt32(id); } catch (Exception) { typeId = -1; } } TbInfoService infoService = new TbInfoService(); int num = infoService.deleInfo(typeId); if (num == 1) { Response.Write("<script>alert('删除成功'); window.location.href = '../show/searchshow.aspx'; </script>"); } else Response.Write("<script>alert('删除失败')</script>"); } }
private void showDataTop() { TbInfoService infoService = new TbInfoService(); ArrayList list = new ArrayList(); list = infoService.GetNewInfoPayfor(); Repeater1.DataSource = list; Repeater1.DataBind(); }
private void showDataMiddle() { int typeId = 0; TbInfoService infoService = new TbInfoService(); ArrayList list1 = new ArrayList(); typeId = 2; list1 = infoService.GetNewInfoNoPay(typeId); Repeater2.DataSource = list1; Repeater2.DataBind(); ArrayList list2 = new ArrayList(); typeId = 7; list2 = infoService.GetNewInfoNoPay(typeId); Repeater3.DataSource = list2; Repeater3.DataBind(); }
private void showData() { ArrayList list = null; TbInfoService infoService = new TbInfoService(); // Search search = (Search)Session["search"]; //if(search != null) // list = infoService.searchInfo(search.InfoType, search.Keys, search.Type, search.All); string keys = title.Text; //Response.Write(DropDownList1.SelectedValue); int type = Convert.ToInt32(DropDownList1.SelectedValue); string typeId = ""; list = infoService.searchInfo(type, keys, typeId, 0); gdvInfo.DataSource = list; gdvInfo.DataBind(); }
protected void Ok_Click(object sender, EventArgs e) { TbInfoService infoService = new TbInfoService(); string date = string.Format("{0:yyyy-MM-dd hh:mm:ss}", DateTime.Now); Info info = new Info(); info.Info_type = Convert.ToInt32(TbTypeList.SelectedValue); info.Info_content = txtContent.Text; info.Info_email = email.Text; info.Info_linkman = linkman.Text; info.Info_phone = phone.Text; info.Info_title = infoTitle.Text; info.Info_date = date; int num = infoService.AddInfo(info); if (num == 1) { Response.Write("<script>alert('发布成功'); window.location.href = '../show/listshow.aspx?id=" + info.Id + "'; </script>"); } else Response.Write("<script>alert('发布失败')</script>"); }
private void GetInfoContent(int id) { TbInfoService infoService = new TbInfoService(); Info info = null; info = infoService.CheckContent(id); if (info != null) { infoTitle1.Text = info.Info_title; time1.Text = info.Info_date; content1.Text = info.Info_content; phone1.Text = info.Info_phone; linkman1.Text = info.Info_linkman; email1.Text = info.Info_email; infoType.Text = info.TbType.TypeIntro; infoContent.Text = info.Info_content; addTime.Text = info.Info_date; infoTitle.Text = info.Info_title; phone.Text = info.Info_phone; email.Text = info.Info_email; linkman.Text = info.Info_linkman; } }
private void showData(int typeId) { Info info = new Info(); string content = null; TbInfoService infoservice = new TbInfoService(); info = infoservice.CheckNewInfoByPay(1, typeId); // Labe_Message.Text = DBHelper.Message; if (info != null) { title1.Text = info.Info_title; time1.Text = string.Format("{0:yyyy-MM-dd HH:mm:ss}", info.Info_date); if (info.Info_content == null || info.Info_content == string.Empty) { info.Info_content = "无内容"; } if (info.Info_content.Length > 20) { content = info.Info_content.Substring(0, 19) + "..."; } else content = info.Info_content; content1.Text = content; try { if (info.Info_phone.Length == 11) phone1.Text = info.Info_phone.Substring(0, 7) + "****"; linkman1.Text = info.Info_linkman; email1.Text = "***" + info.Info_email.Substring(3); } catch (Exception e) { Console.WriteLine(e.Message); } } else content1.Text = "暂时没有此类消息"; info = infoservice.CheckNewInfoByPay(0, typeId); // Labe_Message.Text = DBHelper.Message; if (info != null) { title0.Text = info.Info_title; time0.Text = info.Info_date; if (info.Info_content == null || info.Info_content == string.Empty) { info.Info_content = "无内容"; } if (info.Info_content.Length > 20) { content = info.Info_content.Substring(0, 19) + "..."; } else content = info.Info_content; content0.Text = content; phone0.Text = info.Info_phone.Substring(0, 7) + "****"; linkman0.Text = info.Info_linkman; email0.Text = "***" + info.Info_email.Substring(3); } else content0.Text = "暂时没有此类消息"; }
private void showData(int typeId) { Info info = null; TbInfoService infoService = new TbInfoService(); info = infoService.CheckId(typeId); if (info != null) { TbTypeList.SelectedValue = info.Info_type.ToString(); infoTitle.Text = info.Info_title; txtContent.Text = info.Info_content; phone.Text = info.Info_phone; email.Text = info.Info_email; linkman.Text = info.Info_linkman; } else { } }