//重新查询资产 protected void butSearch_Click(object sender, EventArgs e) { this.SearchTable.Visible = true; this.SearchInfo.Visible = false; //ShowNav() Common_Master_Main master1 = this.Master as Common_Master_Main; if (master1 != null) { master1.ShowNav(); } }
//查询数据 void SearchControl1_SearchEvent(object sender, EventArgs e) { bool AllZc = false; AllZc = this.SearchControl1.AllZC; List <SearchField> condition = this.SearchControl1.SearchConditionList; ZcBu bu1 = new ZcBu(); DataSet ds1 = null; double benjin = 0, lixi = 0; if (this.SearchControl1.SearchType == SearchDataType.单条资产) { ds1 = bu1.GetZcList(condition, AllZc); if (ds1 != null && ds1.Tables[0].Rows.Count > 0) { foreach (DataRow dr1 in ds1.Tables[0].Rows) { benjin = benjin + double.Parse(dr1["bj"].ToString()); lixi = lixi + double.Parse(dr1["lx"].ToString()); } //增加合计行 DataRow dr = ds1.Tables[0].NewRow(); dr["danwei"] = "<b>合 计</b>"; dr["bj"] = benjin; dr["lx"] = lixi; ds1.Tables[0].Rows.Add(dr); } } else { ds1 = bu1.GetZcBaoList(condition); } this.GridView1.DataSource = ds1; this.GridView1.DataBind(); this.SearchTable.Visible = false; this.SearchInfo.Visible = true; Common_Master_Main master1 = this.Master as Common_Master_Main; if (master1 != null) { master1.HideNav(); } }