protected void uwgProjects_UpdateGrid(object sender, Infragistics.WebUI.UltraWebGrid.UpdateEventArgs e) { UltraGridRow uwgRow = default(UltraGridRow); UltraGridRowsEnumerator updatedRows = default(UltraGridRowsEnumerator); int intProjectID = 0; int empID = Session["EmployeeID"].GetValueOrDefault<int>(); Project Project = new Project(); // Get Updated rows for Employee Schedule rows updatedRows = e.Grid.Bands[0].GetBatchUpdates(); // while (updatedRows.MoveNext()) { uwgRow = updatedRows.Current; // intProjectID = uwgRow.Cells[0].GetValueOrDefault<int>(); if (intProjectID > 0) { Project.UnArchiveProject(empID, intProjectID); } } }
public void ArchiveProjects(int empId) { foreach (GridViewRow row in gridHours.Rows) { int projectID = gridHours.DataKeys[row.RowIndex].Values[0].GetValueOrDefault<int>(); int ID = gridHours.DataKeys[row.RowIndex].Values[0].GetValueOrDefault<int>(); Project Project = new Project(); CheckBox chkProj = default(CheckBox); chkProj = (CheckBox)row.FindControl("selectProj"); if (((chkProj != null) & chkProj.Checked)) { if (Session["ActiveProj"].GetValueOrDefault<int>() == 1) { Project.ArchiveProject(empId, projectID); } else { Project.UnArchiveProject(empId, projectID); } } } }