public void ShowData() { if (Request["ID"] + "" == "") { Response.Redirect("RightsWarn.aspx"); } else { try { WebProject.BLL.BaseData.ZT_COM_WebInfo bll_WebInfo = new WebProject.BLL.BaseData.ZT_COM_WebInfo(); WebProject.Model.BaseData.ZT_COM_WebInfo model_WebInfo = bll_WebInfo.GetModel(Int32.Parse(Request["ID"].ToString())); this.lblID.Text = model_WebInfo.ID.ToString(); this.lblTitle.Text = model_WebInfo.Title.ToString(); this.lblFilePath.Text = model_WebInfo.FilePath.ToString(); this.lblWebURL.Text = model_WebInfo.WebURL.ToString(); this.lblKeyWords.Text = model_WebInfo.KeyWords.ToString(); this.lblDescription.Text = model_WebInfo.KeyWords.ToString(); } catch { Response.Redirect("RightsWarn.aspx"); } } }
protected void btnDeleteSelect_Click(object sender, EventArgs e) { if (Session["ZT_ADMIN"] == null) { Response.Redirect("Login.aspx"); } else { if (!Communal.CheckQx("LianJieDelete.aspx")) { Response.Redirect("RightsWarn.aspx"); } else { string DeleteTitle = ""; foreach (GridViewRow gr in this.GridView1.Rows) { CheckBox cb = (CheckBox)gr.Cells[1].FindControl("Select"); if (cb.Checked) { //删除数据库信息 Label ll = (Label)gr.Cells[1].FindControl("lblID"); int ID = Convert.ToInt32(ll.Text); WebProject.BLL.BaseData.ZT_COM_WebInfo bll_WebInfo = new WebProject.BLL.BaseData.ZT_COM_WebInfo(); DeleteTitle += bll_WebInfo.GetModel(ID).Title + ","; bll_WebInfo.Delete(ID); } } LogManage.WriteLog(Request.UserHostAddress, "关键字管理", "删除关键字", "成功", "网页标题:" + DeleteTitle.TrimEnd(',') + ", 操作人:" + SessionUtil.GetAdminSession().AdminNo); ShowData(); } } }
public void ShowWebInfo() { WebProject.BLL.BaseData.ZT_COM_WebInfo bll_WebInfo = new WebProject.BLL.BaseData.ZT_COM_WebInfo(); DataSet ds1 = bll_WebInfo.GetList("FilePath='Index.aspx'"); if (ds1.Tables[0].Rows.Count > 0) { Title = ds1.Tables[0].Rows[0]["Title"].ToString(); KeyWords = ds1.Tables[0].Rows[0]["KeyWords"].ToString(); Description = ds1.Tables[0].Rows[0]["Description"].ToString(); this.lblLeftTelephone.Text = ds1.Tables[0].Rows[0]["Telephone"].ToString(); this.lblLeftKeepPerson.Text = ds1.Tables[0].Rows[0]["KeepPerson"].ToString(); this.lblLeftMobile.Text = ds1.Tables[0].Rows[0]["Mobile"].ToString(); this.lblLeftFax.Text = ds1.Tables[0].Rows[0]["Fax"].ToString(); this.lblLeftAddress.Text = ds1.Tables[0].Rows[0]["Address"].ToString(); this.lblLeftMailNum.Text = ds1.Tables[0].Rows[0]["MailNum"].ToString(); this.lblLeftEmail.Text = ds1.Tables[0].Rows[0]["Email"].ToString(); this.lblEndCompanyName.Text = ds1.Tables[0].Rows[0]["CompanyName"].ToString(); this.lblEndTelephone.Text = ds1.Tables[0].Rows[0]["Telephone"].ToString(); this.lblEndFax.Text = ds1.Tables[0].Rows[0]["Fax"].ToString(); this.lblEndAddress.Text = ds1.Tables[0].Rows[0]["Address"].ToString(); this.lblEndICP.Text = ds1.Tables[0].Rows[0]["ICP"].ToString(); this.lblEndEmail.Text = ds1.Tables[0].Rows[0]["Email"].ToString(); } else { WebProject.BLL.BaseData.ZT_COM_WebMainInfo bll_WebMainInfo = new WebProject.BLL.BaseData.ZT_COM_WebMainInfo(); DataSet ds2 = bll_WebMainInfo.GetList(" 1=1 "); if (ds2.Tables[0].Rows.Count > 0) { Title = ds2.Tables[0].Rows[0]["Title"].ToString(); KeyWords = ds2.Tables[0].Rows[0]["KeyWords"].ToString(); Description = ds2.Tables[0].Rows[0]["Description"].ToString(); PageUrl = ds2.Tables[0].Rows[0]["WebURL"].ToString(); CompanyInfo = ds2.Tables[0].Rows[0]["Title"].ToString(); this.lblLeftTelephone.Text = ds2.Tables[0].Rows[0]["Telephone"].ToString(); this.lblLeftKeepPerson.Text = ds2.Tables[0].Rows[0]["KeepPerson"].ToString(); this.lblLeftMobile.Text = ds2.Tables[0].Rows[0]["Mobile"].ToString(); this.lblLeftFax.Text = ds2.Tables[0].Rows[0]["Fax"].ToString(); this.lblLeftAddress.Text = ds2.Tables[0].Rows[0]["Address"].ToString(); this.lblLeftMailNum.Text = ds2.Tables[0].Rows[0]["MailNum"].ToString(); this.lblLeftEmail.Text = ds2.Tables[0].Rows[0]["Email"].ToString(); this.lblEndCompanyName.Text = ds2.Tables[0].Rows[0]["CompanyName"].ToString(); this.lblEndTelephone.Text = ds2.Tables[0].Rows[0]["Telephone"].ToString(); this.lblEndFax.Text = ds2.Tables[0].Rows[0]["Fax"].ToString(); this.lblEndAddress.Text = ds2.Tables[0].Rows[0]["Address"].ToString(); this.lblEndICP.Text = ds2.Tables[0].Rows[0]["ICP"].ToString(); this.lblEndEmail.Text = ds2.Tables[0].Rows[0]["Email"].ToString(); } } }
public void ShowWebInfo() { if (Request["NewsID"] + "" == "") { Response.Redirect("ErrorPage.aspx"); } else { try { int NewsID = Convert.ToInt32(Request.QueryString["NewsID"].ToString()); WebProject.BLL.BaseData.ZT_COM_WebInfo bll_WebInfo = new WebProject.BLL.BaseData.ZT_COM_WebInfo(); DataSet ds = bll_WebInfo.GetList("FilePath='NewsView.aspx?NewsID="+NewsID.ToString()+"'"); if (ds.Tables[0].Rows.Count > 0) { Title = ds.Tables[0].Rows[0]["Title"].ToString(); KeyWords = ds.Tables[0].Rows[0]["KeyWords"].ToString(); Description = ds.Tables[0].Rows[0]["Description"].ToString(); } else { DataSet ds1 = bll_WebInfo.GetList("FilePath='NewsView.aspx'"); if (ds1.Tables[0].Rows.Count > 0) { Title = ds1.Tables[0].Rows[0]["Title"].ToString(); KeyWords = ds1.Tables[0].Rows[0]["KeyWords"].ToString(); Description = ds1.Tables[0].Rows[0]["Description"].ToString(); } else { WebProject.BLL.BaseData.ZT_COM_WebMainInfo bll_WebMainInfo = new WebProject.BLL.BaseData.ZT_COM_WebMainInfo(); DataSet ds2 = bll_WebMainInfo.GetList(" 1=1 "); if (ds2.Tables[0].Rows.Count > 0) { Title = ds2.Tables[0].Rows[0]["Title"].ToString(); KeyWords = ds2.Tables[0].Rows[0]["KeyWords"].ToString(); Description = ds2.Tables[0].Rows[0]["Description"].ToString(); } } } } catch { Response.Redirect("ErrorPage.aspx"); } } }
protected void btnSubmit_Click(object sender, EventArgs e) { if (Session["ZT_ADMIN"] == null) { Response.Redirect("Login.aspx"); } else { if (this.txtTitle.Text.Trim() == "") { MessageBox.Show(this, "请输入网页标题!"); return; } if (this.txtWebUrl.Text.Trim() == "") { MessageBox.Show(this, "请输入链接地址!"); return; } if (this.txtKeyWords.Text.Trim() == "") { MessageBox.Show(this, "请输入关键字!"); return; } if (this.txtFilePath.Text.Trim() == "") { MessageBox.Show(this, "请输入文件路径!"); return; } if (this.txtDescription.Text.Trim() == "") { MessageBox.Show(this, "请输入网页描述!"); return; } WebProject.Model.BaseData.ZT_COM_WebInfo model_WebInfo = new WebProject.Model.BaseData.ZT_COM_WebInfo(); model_WebInfo.Title = this.txtTitle.Text.Trim(); model_WebInfo.WebURL = this.txtWebUrl.Text.Trim(); model_WebInfo.KeyWords = this.txtKeyWords.Text.Trim(); model_WebInfo.FilePath = this.txtFilePath.Text.Trim(); model_WebInfo.Description = this.txtDescription.Text.Trim(); WebProject.BLL.BaseData.ZT_COM_WebInfo bll_WebInfo = new WebProject.BLL.BaseData.ZT_COM_WebInfo(); bll_WebInfo.Add(model_WebInfo); LogManage.WriteLog(Request.UserHostAddress, "关键字管理", "添加关键字", "成功", "网页标题:" + model_WebInfo.Title + ", 操作人:" + SessionUtil.GetAdminSession().AdminNo); MessageBox.ShowAndRedirect(this, "添加关键字成功!", "WebInfoList.aspx"); } }
public void ShowData() { WebProject.BLL.BaseData.ZT_COM_WebInfo bll_WebInfo = new WebProject.BLL.BaseData.ZT_COM_WebInfo(); DataSet ds = bll_WebInfo.GetList(""); if (ds.Tables[0].Rows.Count > 0) { this.lblMessage.Visible = false; this.btnDeleteSelect.Visible = true; this.GridView1.Visible = true; this.GridView1.DataSource = ds; this.GridView1.DataBind(); } else { this.lblMessage.Visible = true; this.btnDeleteSelect.Visible = false; this.GridView1.Visible = false; } }
public void ShowWebInfo() { WebProject.BLL.BaseData.ZT_COM_WebInfo bll_WebInfo = new WebProject.BLL.BaseData.ZT_COM_WebInfo(); DataSet ds1 = bll_WebInfo.GetList("FilePath='ZhaoPin.aspx'"); if (ds1.Tables[0].Rows.Count > 0) { Title = ds1.Tables[0].Rows[0]["Title"].ToString(); KeyWords = ds1.Tables[0].Rows[0]["KeyWords"].ToString(); Description = ds1.Tables[0].Rows[0]["Description"].ToString(); } else { WebProject.BLL.BaseData.ZT_COM_WebMainInfo bll_WebMainInfo = new WebProject.BLL.BaseData.ZT_COM_WebMainInfo(); DataSet ds2 = bll_WebMainInfo.GetList(" 1=1 "); if (ds2.Tables[0].Rows.Count > 0) { Title = ds2.Tables[0].Rows[0]["Title"].ToString(); KeyWords = ds2.Tables[0].Rows[0]["KeyWords"].ToString(); Description = ds2.Tables[0].Rows[0]["Description"].ToString(); } } }
protected void GridView1_RowDeleting(object sender, GridViewDeleteEventArgs e) { if (Session["ZT_ADMIN"] == null) { Response.Redirect("Login.aspx"); } else { if (!Communal.CheckQx("WebInfoDelete.aspx")) { Response.Redirect("RightsWarn.aspx"); } else { //删除数据库的信息 Label ll = (Label)this.GridView1.Rows[e.RowIndex].Cells[1].FindControl("lblID"); int ID = Convert.ToInt32(ll.Text); WebProject.BLL.BaseData.ZT_COM_WebInfo bll_WebInfo = new WebProject.BLL.BaseData.ZT_COM_WebInfo(); LogManage.WriteLog(Request.UserHostAddress, "关键字管理", "删除关键字", "成功", "网页标题:" + bll_WebInfo.GetModel(ID).Title + ", 操作人:" + SessionUtil.GetAdminSession().AdminNo); bll_WebInfo.Delete(ID); //重新加载信息 ShowData(); } } }