public GenericModule(TamsProject theProject, TabPage controlPage, ToolStripMenuItem[] boundButtons, string mn = "miscellaneous") : base(theProject, controlPage, boundButtons, itemSelectionSql) { ModuleName = mn; boundButtons[1].Click += SidewalkReport; boundButtons[2].Click += RoadReport; boundButtons[3].Click += RampReport; boundButtons[4].Click += DrainageReport; boundButtons[5].Click += AccidentReport; boundButtons[6].Click += OtherReport; boundButtons[7].Click += RoadsWithSidewalks; setControlPanel(); ModuleSettings.Add(new ProjectSetting(name: ModuleName + "_file", module: ModuleName)); ModuleSettings.Add(new ProjectSetting(name: ModuleName + "_relative", module: ModuleName)); FieldSettingToDbColumn = new Dictionary <string, string>() { { ModuleName + "_f_TAMSID", "TAMSID" } }; icons = new Dictionary <string, string>() { { "Severe Road Distress", "road" }, { "Other", "other" }, { "ADA Ramp", "ramp" }, { "Sidewalk", "sidewalk" }, { "Drainage", "drainage" }, { "Accident Hotspot", "accident" } }; Project.map.ResetBuffer(); Project.map.Update(); }
public CustomReport(TamsProject theProject, ModuleRoads roads, ModuleSigns signs, GenericModule other, MainWindow mainWindow) { Project = theProject; moduleRoads = roads; roadReports = new RoadReports(Project, roads); moduleSigns = signs; signReports = new SignReports(Project, signs); moduleOther = other; otherReports = new OtherReports(Project, other); window = mainWindow; }
public void prePopField(TamsProject project) { try { DataTable data = Database.GetDataByQuery(project.conn, "SELECT * FROM road_sidewalks WHERE road_ID=" + RoadID.ToString() + ";"); sidewalks.Text = data.Rows[0]["installed"].ToString(); textBoxComment.Text = data.Rows[0]["comments"].ToString(); } catch (Exception) { } }
public void setSidewalkData(TamsProject project) { if (dialogBox.ShowDialog() == DialogResult.OK) { Database.ReplaceRow(project.conn, new Dictionary <string, string>() { { "road_ID", RoadID.ToString() }, { "installed", sidewalks.Text }, { "comments", textBoxComment.Text } }, "road_sidewalks"); } }
protected readonly String SelectionSql; // TODO: This should only be set at construction. Readonly doesn't work for inherited classes. // http://stackoverflow.com/questions/6037546/assigning-a-value-to-an-inherited-readonly-field public ProjectModule(TamsProject theProject, TabPage controlsPage, ToolStripMenuItem[] lcs, String selectionSql = "") { Project = theProject; setControls(controlsPage); // attempt to select the page appropriate to the current module ModuleName = "general"; UnsavedChanges = false; ModuleSettings = new List <ProjectSetting>(); linkedComponents = lcs; // selectionSql can only be set here! if (selectionSql == "") { // Default value for inherited members // [[IDLIST]] will be replaced with TAMSIDs from selection at query time SelectionSql = "SELECT * FROM [" + ModuleName + "] WHERE TAMSID IN ([[IDLIST]])"; } else { SelectionSql = selectionSql; } }
public ProjectSettings(SQLiteConnection tamsconn, TamsProject theProject) { Settings = new Dictionary <String, ProjectSetting>(); Conn = tamsconn; Project = theProject; }