protected void Page_Load(object sender, EventArgs e) { int id = 0; if (!Page.IsPostBack) { string str = Request.QueryString["index"]; if (str != "" && str != null) { try { id = Convert.ToInt32(str); } catch { id = -1; } } TBInfoService infoService = new TBInfoService(); int ok = infoService.deleteInfo(id); if (ok > 0) Response.Redirect("首页关键字检索.aspx"); else Response.Write("删除失败"); } }
protected void btnOk_Click(object sender, EventArgs e) { string typeId = ddlTbType.SelectedValue; string title = txtTitle.Text; string infoConntent = txtContent.Text; string phone = txtPhone.Text; string contact = txtContact.Text; string email = txtEmail.Text; TbInfo info = new TbInfo(); info.InfoType = Convert.ToInt32(typeId); info.InfoTitle = title; info.InfoContact = contact; info.InfoContent = infoConntent; info.InfoPhone = phone; info.InfoEmail = email; info.InfoDate = string.Format("{0:yyyy-MM-dd HH:mm:ss}", DateTime.Now); info.InfoState = 1; info.InfoPayFor = 0; TBInfoService infoService = new TBInfoService(); int ok = infoService.AddTbInfo(info); if (ok > 0) lblMessage.Text = "<script> alert('发布成功'); </script>"; else lblMessage.Text = "<script> alert('发布失败'); </script>"; }
protected void btnOk_Click(object sender, EventArgs e) { string typeId = ddlTbType.SelectedValue; string title = txtTitle.Text; string infoContent = txtContent.Text; string phone = txtPhone.Text; string contact = txtContact.Text; string email = txtEmail.Text; TbInfo info = new TbInfo(); info.InfoType = Convert.ToInt32(typeId); info.InfoTitle = title; info.InfoContact = contact; info.InfoContent = infoContent; info.InfoPhone = phone; info.InfoEmail = email; info.Id = Convert.ToInt32(hfId.Value); TBInfoService infoService = new TBInfoService(); int ok = infoService.updateInfo(info); if (ok > 0) lblMessage.Text = "<script> alert('修改成功');location.href = '首页关键字检索.aspx'; </script>"; else lblMessage.Text = "<script> alert('修改失败'); </script>"; }
private void showData() { string key = txtKey.Text.Trim(); int typeId = Convert.ToInt32(ddlType.SelectedValue); TBInfoService infoService = new TBInfoService(); ArrayList list = infoService.getSearchInfo(typeId, key); gdvInfo.DataSource = list; gdvInfo.DataBind(); }
private void showUserData() { TBInfoService infoService = new TBInfoService(); TbInfo tb = infoService.getInfoById(id); ddlTbType.SelectedValue = tb.Id.ToString(); txtTitle.Text = tb.InfoTitle; txtContent.Text = tb.InfoContent; txtContact.Text = tb.InfoContact; txtPhone.Text = tb.InfoPhone; txtEmail.Text = tb.InfoEmail; }
private void showData() { TBInfoService infoService = new TBInfoService(); ArrayList list1 = infoService.getFreeInfo(2); ArrayList list2 = infoService.getFreeInfo(7); rptLeft.DataSource = list1; rptLeft.DataBind(); rptRight.DataSource = list2; rptRight.DataBind(); }
private void showData() { TBInfoService infoService = new TBInfoService(); TbInfo tb = infoService.getInfoById(id); lblType.Text = tb.Tbtype.TypeIntro; lblTitle.Text = tb.InfoTitle; //lblContent.Text = tb.InfoContent; lblContact.Text = tb.InfoContact; lblDate.Text = tb.InfoDate; lblEmail.Text = tb.InfoEmail; lblPhone.Text = tb.InfoPhone; aa.Text = tb.InfoContent; }
protected void btnSearch_Click(object sender, EventArgs e) { TBInfoService infoService = new TBInfoService(); string key = txtKey.Text; string typeId = ddlType.SelectedValue; ArrayList list = new ArrayList(); if (rdoType0.Checked == true) list = infoService.SearchInfo(key, typeId, 0); else list = infoService.SearchInfo(key, typeId, 1); Session["data"] = list; Response.Write("<script language='javascript'>window.open(\"首页关键字检索.aspx?index=1\", \"main\");</script>"); }
private void showInfo() { TBInfoService infoService = new TBInfoService(); ArrayList list = infoService.getPayforInfo(); ArrayList list1 = new ArrayList(); ArrayList list2 = new ArrayList(); for (int i = 0; i < list.Count && i < 4; i++) list1.Add(list[i]); for (int j = 4; j < list.Count && j < 8; j++) list2.Add(list[j]); rptInfoLeft.DataSource = list1; rptInfoLeft.DataBind(); rptInfoRight.DataSource = list2; rptInfoRight.DataBind(); }
/// <summary> /// 显示信息 /// </summary> /// <param name="typeId"></param> private void showData(int typeId) { TBInfoService infoService = new TBInfoService(); TbInfo info = infoService.getLatestInfo(1, typeId); if (info != null) { lblTitle1.Text = info.InfoTitle; lblDate1.Text = string.Format("{0:yyyy-MM-dd HH:mm:ss}", Convert.ToDateTime(info.InfoDate)); lblContent1.Text = info.InfoContent; lblContact1.Text = info.InfoContact; lblPhone1.Text = info.InfoPhone.Substring(0, 7) + "****"; lblEmail1.Text = info.InfoEmail; lblTop1.Text = "推荐" + info.Tbtype.TypeIntro + "『缴费专区』"; } else { lblContent1.Text = "暂无信息"; lblPhone1.Text = "00000000000"; } info = infoService.getLatestInfo(0, typeId); if (info != null) { lblTitle0.Text = info.InfoTitle; lblDate0.Text = string.Format("{0:yyyy-MM-dd HH:mm:ss}", Convert.ToDateTime(info.InfoDate)); lblContent0.Text = info.InfoContent; lblContact0.Text = info.InfoContact; lblPhone0.Text = info.InfoPhone.Substring(0, 7) + "****"; lblEmail0.Text = info.InfoEmail; lblTop0.Text = "最新" + info.Tbtype.TypeIntro + "『免费专区』"; } else { lblContent0.Text = "暂无信息"; lblPhone0.Text = "00000000000"; } }