private void InitData() { string Guid = Request.QueryString["Guid"].ToString(); Detail_CAW_YEARASSESS DCYA = new CawYearAssess().GetDetail(Guid); this.ddlCorp.SelectedIndex = this.ddlCorp.Items.IndexOf(this.ddlCorp.Items.FindByValue(DCYA.COMPANYGUID)); this.ntbYear.Text = DCYA.YEARNUM.ToString(); this.ddlGrade.SelectedIndex = this.ddlGrade.Items.IndexOf(this.ddlGrade.Items.FindByText(DCYA.GRADE)); this.txtRemark.Text = DCYA.REMARK; this.ddlCorp.Enabled = false; this.ntbYear.Enabled = false; }
/// <summary> /// 选择数据 /// </summary> protected void refresh() { int TotalNum = 0; string CompanyGuid = this.ddlCorp.SelectedIndex == 0 ? "" : this.ddlCorp.SelectedItem.Value; int Year = this.ddlYear.SelectedIndex == 0 ? 0 : Convert.ToInt16(this.ddlYear.SelectedItem.Text.Trim()); DataView dv = new CawYearAssess().Select(CompanyGuid, Year, AspNetPager1.PageSize, AspNetPager1.CurrentPageIndex, out TotalNum); GridView1.DataSource = dv; GridView1.DataBind(); FrameCommon FC = new FrameCommon(); FC.SetPagerInfo(AspNetPager1, TotalNum, AspNetPager1.PageSize, AspNetPager1.CurrentPageIndex, ""); //调用一个js函数,用于强制执行datagrid的颜色变换。如不用,因updatapanel中数据更新后将无法引起datagridcolor.js的执行 CallJsFun("ChangeColor();"); }