private void FillDominoServerTasksGrid() { try { //DSTaskSettingsDataSet = new DataSet(); DSTasksDataTable = new DataTable(); DSTasksDataTable = VSWebBL.ConfiguratorBL.DominoServerTasksBL.Ins.GetAllData(); //DataTable dtcopy = DSTasksDataTable.Copy(); //dtcopy.Columns.Add("SendLoadCommand"); //dtcopy.Columns.Add("SendRestartCommand"); //dtcopy.Columns.Add("RestartOffHours"); //dtcopy.Columns.Add("SendExitCommand"); //DSTaskSettingsDataSet.Tables.Add(dtcopy); if (DSTasksDataTable.Rows.Count > 0) { Session["DominoTasks"] = DSTasksDataTable; // DSTaskSettingsDataSet.Tables[0]; DominoTasksGridView.DataSource = DSTasksDataTable; //DSTaskSettingsDataSet.Tables[0]; DominoTasksGridView.DataBind(); } } catch (Exception ex) { throw ex; } finally { } }
private void FillDominoServerTasksGridfromSession() { try { DSTasksDataTable = new DataTable(); if (Session["DominoTasks"] != "" && Session["DominoTasks"] != null) { DSTasksDataTable = (DataTable)Session["DominoTasks"]; } if (DSTasksDataTable.Rows.Count > 0) { int startIndex = DominoTasksGridView.PageIndex * DominoTasksGridView.SettingsPager.PageSize; int endIndex = Math.Min(DominoTasksGridView.VisibleRowCount, startIndex + DominoTasksGridView.SettingsPager.PageSize); for (int i = startIndex; i < endIndex; i++) { if (DominoTasksGridView.Selection.IsRowSelected(i)) { //object o = DominoTasksGridView.GetRowValues(i, "SendLoadCommand"); DSTasksDataTable.Rows[i]["isSelected"] = "true"; ASPxCheckBox SendLoadCommand = DominoTasksGridView.FindRowCellTemplateControl(i, DominoTasksGridView.Columns[4] as GridViewDataColumn, "SendLoadCommand") as ASPxCheckBox; ASPxCheckBox SendRestartCommand = DominoTasksGridView.FindRowCellTemplateControl(i, DominoTasksGridView.Columns[5] as GridViewDataColumn, "SendRestartCommand") as ASPxCheckBox; ASPxCheckBox RestartOffHours = DominoTasksGridView.FindRowCellTemplateControl(i, DominoTasksGridView.Columns[6] as GridViewDataColumn, "RestartOffHours") as ASPxCheckBox; ASPxCheckBox SendExitCommand = DominoTasksGridView.FindRowCellTemplateControl(i, DominoTasksGridView.Columns[7] as GridViewDataColumn, "SendExitCommand") as ASPxCheckBox; if (SendLoadCommand != null && SendLoadCommand.Checked == true) { DSTasksDataTable.Rows[i]["SendLoadCommand"] = "true"; } else { DSTasksDataTable.Rows[i]["SendLoadCommand"] = "false"; } if (SendRestartCommand != null && SendRestartCommand.Checked == true) { DSTasksDataTable.Rows[i]["SendRestartCommand"] = "true"; } else { DSTasksDataTable.Rows[i]["SendRestartCommand"] = "false"; } if (RestartOffHours != null && RestartOffHours.Checked == true) { DSTasksDataTable.Rows[i]["RestartOffHours"] = "true"; } else { DSTasksDataTable.Rows[i]["RestartOffHours"] = "false"; } if (SendExitCommand != null && SendExitCommand.Checked == true) { DSTasksDataTable.Rows[i]["SendExitCommand"] = "true"; } else { DSTasksDataTable.Rows[i]["SendExitCommand"] = "false"; } } else { DSTasksDataTable.Rows[i]["isSelected"] = "false"; } } DominoTasksGridView.DataSource = DSTasksDataTable; DominoTasksGridView.DataBind(); } } catch (Exception ex) { throw ex; } finally { } }