protected void dgvInfo_RowDataBound(object sender, GridViewRowEventArgs e) { if (e.Row.RowType == DataControlRowType.Footer) { List <TPurchaseIndentQuery> sumList = QueryService.Instance.PurchaseIndentQuery(SqlWhere, -1, OurPager1.PageSize); if (sumList.Count > 0) { RM.ServerControl.GridView grid = sender as RM.ServerControl.GridView; //取当前操作的GridView TPurchaseIndentQuery sum = sumList[0]; } } }
protected void dgvInfo_RowCommand(object sender, GridViewCommandEventArgs e) { if (!string.IsNullOrEmpty(e.CommandName)) //判断命令名是否为空 { if (e.CommandName == "Edi") //如果触发的是详细信息按钮事件 { int index = Convert.ToInt32(e.CommandArgument); //取GridView行索引 RM.ServerControl.GridView grid = (RM.ServerControl.GridView)e.CommandSource; //取当前操作的GridView int id = Convert.ToInt32(grid.DataKeys[index].Value); //取GridView主键值 Response.Redirect(@"~/MMS/MMS_Requisition/Requisition_Form.aspx?Query=True&&ID=" + id.ToString()); LoadData(SqlWhere, OurPager1.CurrentPageIndex); } } }
protected void dgvInfo_RowDataBound(object sender, GridViewRowEventArgs e) { if (e.Row.RowType == DataControlRowType.Footer) { List <TPurchasePlanQuery> sumList = QueryService.Instance.PurchasePlanQuery(SqlWhere, -1, OurPager1.PageSize); if (sumList.Count > 0) { RM.ServerControl.GridView grid = sender as RM.ServerControl.GridView; //取当前操作的GridView TPurchasePlanQuery sum = sumList[0]; } } if (e.Row.RowType == DataControlRowType.DataRow) { switch (e.Row.Cells[5].Text.ToString().Trim()) { case "1": e.Row.Cells[5].Text = "未审核"; break; case "2": e.Row.Cells[5].Text = "已审核"; break; case "3": e.Row.Cells[5].Text = "库房审核退回"; break; case "4": e.Row.Cells[5].Text = "院长审核退回"; break; default: e.Row.Cells[5].Text = "未审核"; break; } if (e.Row.Cells[5].Text.ToString() == "1") { e.Row.Cells[5].Text = "未审核"; } } }