private void getRMList() { DataTable dt = rmBLL.getAllRepairMen(); ViewState["GridRMData"] = dt; GridRM.DataSource = dt; GridRM.DataBind(); }
protected void btnQuery_Click(object sender, EventArgs e) { DataTable dt = rmBLL.getRMListByName(tbName.Text.Trim()); ViewState["GridData"] = dt; GridRM.DataSource = dt; GridRM.DataBind(); }
private void getGridData() { DataTable dt = rmBLL.getAllRepairMen(true); if (dt.Rows.Count > 0) { ViewState["GridData"] = dt; GridRM.DataSource = dt; GridRM.DataBind(); } }
protected void GridRM_ItemCommand(object sender, GridCommandEventArgs e) { if (e.CommandName == "switchStatus") { GridDataItem gridItem = e.Item as GridDataItem; int rmID = Convert.ToInt32(gridItem["repairmanID"].Text); int deleteStatus = Convert.ToInt32(gridItem["deleteStatus"].Text); if (rmBLL.switchDeleteStatus(rmID, deleteStatus)) { int rowIndex = e.Item.ItemIndex + GridRM.CurrentPageIndex * GridRM.PageSize; DataTable dt = ViewState["GridData"] as DataTable; dt.Rows[rowIndex]["deleteStatus"] = deleteStatus == 1 ? "0" : "1"; ViewState["GridData"] = dt; } } GridRM.Rebind(); }