protected void LinkButton1_Click(object sender, EventArgs e) { string strqu = Request.Form["seldq"]; string strtxt = Request.Form["txthzs"]; //MessageBox.Show(this, strqu+"<br>"+strtxt); DataTable dt = new DataTable(); string strwhere = " 1=1 and zuobiaox!='' "; if (!string.IsNullOrEmpty(strtxt)) { strwhere += " and mingcheng like '%" + strtxt + "%'"; } if (!string.IsNullOrEmpty(strqu)) { if (strqu != "威海市") { strwhere += " and quyu='" + strqu + "'"; } } if (!string.IsNullOrEmpty(this.sellb.SelectedValue)) { if (this.sellb.SelectedValue == "合作社") { NCPEP.Bll.T_hzs bll = new NCPEP.Bll.T_hzs(); dt = bll.GetList(strwhere).Tables[0]; } else { NCPEP.Bll.T_jtnc bll = new NCPEP.Bll.T_jtnc(); dt = bll.GetList(strwhere).Tables[0]; } } jieguo = dt.Rows.Count.ToString(); this.repjg.DataSource = dt; this.repjg.DataBind(); string strzuobiao = ""; string strneirong = ""; foreach (DataRow dr in dt.Rows) { if (!string.IsNullOrEmpty(dr["zuobiaox"].ToString())) { strzuobiao += dr["zuobiaox"] + "," + dr["zuobiaoy"] + "|"; strneirong += dr["mingcheng"] + "," + dr["dizhi"] + "," + dr["lishizhang"] + "," + dr["lianxidianhua"] + "|"; } } hdzuobiao.Value = strzuobiao.TrimEnd('|'); hdneirong.Value = strneirong.TrimEnd('|'); }
protected void Page_Load(object sender, EventArgs e) { if (!IsPostBack) { if (Request.QueryString["st"] != null) { string strid = Request.QueryString["st"]; NCPEP.Model.T_hzs model = new NCPEP.Model.T_hzs(); NCPEP.Bll.T_hzs bll = new NCPEP.Bll.T_hzs(); model = bll.GetModel(int.Parse(strid)); this.hdzb.Value = model.dizhi; strname = model.mingcheng; txtx.Text = model.zuobiaox; txty.Text = model.zuobiaoy; } } }
protected void Button1_Click(object sender, EventArgs e) { if (Request.QueryString["st"] != null) { string strid = Request.QueryString["st"]; NCPEP.Model.T_hzs model = new NCPEP.Model.T_hzs(); NCPEP.Bll.T_hzs bll = new NCPEP.Bll.T_hzs(); model = bll.GetModel(int.Parse(strid)); if (!string.IsNullOrEmpty(txtx.Text)) { model.zuobiaox = txtx.Text; } if (!string.IsNullOrEmpty(txty.Text)) { model.zuobiaoy = txty.Text; } bll.Update(model); MessageBox.ShowAndRedirect(this, "设置成功!", "list.aspx?pg=" + Request.QueryString["pg"] + ""); } }
/// <summary> /// 初始绑定数据 /// </summary> private void BindDate() { StringBuilder sb = new StringBuilder(); sb.Append(" 1=1"); //if (this.ddlxwlx.SelectedValue != "请选择") //{ // sb.Append(" and NewsTypeId='" + this.ddlxwlx.SelectedValue + "'"); //} //if (!string.IsNullOrEmpty(this.TextBox1.Text)) //{ // sb.Append(" and NewsTitle like '%" + this.TextBox1.Text + "%'"); //} //if (this.DropDownList2.SelectedValue != "全部") //{ // sb.Append(" and IsCheck='" + this.DropDownList2.SelectedValue + "'"); //} NCPEP.Bll.T_hzs bll = new NCPEP.Bll.T_hzs(); this.pg.RecordCount = bll.GetRecordCount(sb.ToString()); this.pg.PageSize = 10; this.pg.UrlPageIndexName = "pg"; if (!string.IsNullOrEmpty(hdpage.Value) && hdpage.Value == "1") { if (Request.QueryString["pg"] != null) { pg.CurrentPageIndex = int.Parse(Request.QueryString["pg"]); } } int sindex = (this.pg.CurrentPageIndex - 1) * this.pg.PageSize + 1; int eindex = this.pg.CurrentPageIndex * this.pg.PageSize; DataSet ds = bll.GetListByPage(sb.ToString(), "id asc", sindex, eindex); //DataSet ds = bll.GetList(this.AspNetPager1.PageSize, this.AspNetPager1.CurrentPageIndex, sb.ToString()); this.rep.DataSource = ds; this.rep.DataBind(); }