public void DisplayGrid(Int32 EstNum, String FromDate, String ToDate) { try { WhitfieldPayroll _dbClass = new WhitfieldPayroll(); DataSet dsSubMats = _dbClass.GetPayRollEmployeeHoursForProject(EstNum, FromDate, ToDate); PopulateDataGrid(dsSubMats, grdEmpl); } catch (Exception exp) { Response.Write(exp.Message.ToString()); } }
public void grdProj_Itemcommand(Object sender, DataGridCommandEventArgs e) { Int32 EstNum = 0; DataSet dsExpand = new DataSet(); WhitfieldPayroll _dbClass = new WhitfieldPayroll(); switch (e.CommandName) { case "Expand": { EstNum = Convert.ToInt32(grdProj.DataKeys[e.Item.ItemIndex]); dsExpand = _dbClass.GetPayRollEmployeeHoursForProject(EstNum, txtFromDate.Text.Trim(), txtToDate.Text.Trim()); PlaceHolder exp = new PlaceHolder(); exp = (System.Web.UI.WebControls.PlaceHolder)e.Item.Cells[7].FindControl("ExpandedContent"); ImageButton img = new ImageButton(); img = (System.Web.UI.WebControls.ImageButton)e.Item.Cells[0].FindControl("btnExpand"); if (dsExpand.Tables[0].Rows.Count > 0) { if (img.ImageUrl == "assets/img/Plus.gif") { img.ImageUrl = "assets/img/Minus.gif"; exp.Visible = true; ((Whitfield_Payroll_ByEmployee)(e.Item.FindControl("DynamicTable2"))).Visible = true; ((Whitfield_Payroll_ByEmployee)(e.Item.FindControl("DynamicTable2"))).DisplayGrid(EstNum, txtFromDate.Text.Trim(), txtToDate.Text.Trim()); } else { exp.Visible = false; ((Whitfield_Payroll_ByEmployee)(e.Item.FindControl("DynamicTable2"))).Visible = false; img.ImageUrl = "assets/img/Plus.gif"; } } else { if (img.ImageUrl == "assets/img/Plus.gif") { //((ViewDesignAdmin)(e.Item.FindControl("DynamicTable1"))).Visible = true; img.ImageUrl = "assets/img/Minus.gif"; exp.Visible = true; ((Whitfield_Payroll_ByEmployee)(e.Item.FindControl("DynamicTable2"))).Visible = true; ((Whitfield_Payroll_ByEmployee)(e.Item.FindControl("DynamicTable2"))).DisplayGrid(EstNum, txtFromDate.Text.Trim(), txtToDate.Text.Trim()); } else { exp.Visible = false; ((Whitfield_Payroll_ByEmployee)(e.Item.FindControl("DynamicTable2"))).Visible = false; img.ImageUrl = "assets/img/Plus.gif"; } } break; } default: { break; } } }