/// <summary> /// Gets a DataSet with all Projects /// </summary> /// <returns></returns> public static DataSet getProjectsDataSet() { DBDriver myDB = new DBDriver(); myDB.Query = "select * from projects;"; DataSet ds = new DataSet(); myDB.createAdapter().Fill(ds); return(ds); }
/// <summary> /// Gets a DataSet of Tasks in the specified Module /// </summary> /// <param name="id">Module id</param> /// <returns>Tasks DataSet</returns> public static DataSet getTasksDataSet(string id) { DBDriver myDB = new DBDriver(); myDB.Query = "select * from tasks\n" + "where moduleID = @ID;"; myDB.addParam("@ID", id); DataSet ds = new DataSet(); myDB.createAdapter().Fill(ds); return(ds); }
/// <summary> /// Gets a DataSet with Projects assigned to a PM /// </summary> /// <param name="mgrID">Project Manager</param> /// <returns></returns> public static DataSet getProjectsDataSet(string mgrID) { DBDriver myDB = new DBDriver(); myDB.Query = "select * from projects \n" + "where managerID=@mgrID;"; myDB.addParam("@mgrID", mgrID); DataSet ds = new DataSet(); myDB.createAdapter().Fill(ds); return(ds); }
/// <summary> /// Gets a DataSet filled with a projects fields /// </summary> public DataSet getDataSet() { DBDriver myDB = new DBDriver(); myDB.Query = "select * from projects \n" + "where ID = @ID;"; myDB.addParam("@ID", id); DataSet ds = new DataSet(); myDB.createAdapter().Fill(ds); return(ds); }
public Task(string name, string moduleID, string description, string startDate, string compexity) : base(name, description, startDate) { DBDriver db = new DBDriver(); // Create Adapter db.Query = "select * from Tasks"; SqlDataAdapter da = db.createAdapter(); // We need this to get an ID back from the database da.MissingSchemaAction = MissingSchemaAction.AddWithKey; // Create and initialize CommandBuilder SqlCommandBuilder dbCB = new SqlCommandBuilder(da); // New DataSet DataSet ds = new DataSet(); // Populate DataSet with data da.Fill(ds, "Tasks"); // Get reference to our table DataTable table = ds.Tables["Tasks"]; // Create new row DataRow row = table.NewRow(); // Store data in the row row["Name"] = this.name = name; row["moduleID"] = this.modID = moduleID; row["description"] = this.description = description; row["startDate"] = this.startDate = startDate; row["complete"] = this.status = TaskStatus.UNASSIGNED; row["complexity"] = this.complexity = compexity; // Add row back to table table.Rows.Add(row); // Update data source da.Update(ds, "Tasks"); // Get newFileID if (!row.IsNull("ID")) { id = row["ID"].ToString(); } }
/// <summary> /// Create a project object from the database /// </summary> /// <param name="id">a project id</param> public Project(string id) : base(id) { myDB = new DBDriver(); myDB.Query = "select * from projects \n" + "where ID = @ID;"; myDB.addParam("@ID", id); DataSet ds = new DataSet(); myDB.createAdapter().Fill(ds); DataTable table = ds.Tables[0]; DataRow row = table.Rows[0]; this.name = row["Name"].ToString(); this.id = row["id"].ToString(); this.mgrID = row["managerID"].ToString(); this.description = row["description"].ToString(); this.startDate = row["startDate"].ToString(); this.expEndDate = row["expEndDate"].ToString(); this.actEndDate = row["actEndDate"].ToString(); }
public Module(string name, string projectID, string description, string startDate) : base(name, description, startDate) { DBDriver db = new DBDriver(); // Create Adapter db.Query = "select * from Modules"; SqlDataAdapter da = db.createAdapter(); // We need this to get an ID back from the database da.MissingSchemaAction = MissingSchemaAction.AddWithKey; // Create and initialize CommandBuilder SqlCommandBuilder dbCB = new SqlCommandBuilder(da); // New DataSet DataSet ds = new DataSet(); // Populate DataSet with data da.Fill(ds, "Modules"); // Get reference to our table DataTable table = ds.Tables["Modules"]; // Create new row DataRow row = table.NewRow(); // Store data in the row row["Name"] = this.name = name; row["projectID"] = this.projID = projectID; row["description"] = this.description = description; row["startDate"] = this.startDate = startDate; // Add row back to table table.Rows.Add(row); // Update data source da.Update(ds, "Modules"); // Get newFileID if( !row.IsNull("ID") ) id = row["ID"].ToString(); }
/// <summary> /// Gets a DataSet of Tasks in the specified Module /// </summary> /// <param name="id">Module id</param> /// <returns>Tasks DataSet</returns> public static DataSet getTasksDataSet(string id) { DBDriver myDB = new DBDriver(); myDB.Query = "select * from tasks\n" + "where moduleID = @ID;"; myDB.addParam("@ID", id); DataSet ds = new DataSet(); myDB.createAdapter().Fill(ds); return ds; }
/// <summary> /// Gets a DataSet filled with a projects fields /// </summary> public DataSet getDataSet() { DBDriver myDB = new DBDriver(); myDB.Query = "select * from projects \n" + "where ID = @ID;"; myDB.addParam("@ID", id); DataSet ds = new DataSet(); myDB.createAdapter().Fill(ds); return ds; }
/// <summary> /// Gets a DataSet with Projects assigned to a PM /// </summary> /// <param name="mgrID">Project Manager</param> /// <returns></returns> public static DataSet getProjectsDataSet(string mgrID) { DBDriver myDB = new DBDriver(); myDB.Query = "select * from projects \n" +"where managerID=@mgrID;"; myDB.addParam("@mgrID", mgrID); DataSet ds = new DataSet(); myDB.createAdapter().Fill(ds); return ds; }
/// <summary> /// Gets a DataSet with all Projects /// </summary> /// <returns></returns> public static DataSet getProjectsDataSet() { DBDriver myDB = new DBDriver(); myDB.Query = "select * from projects;"; DataSet ds = new DataSet(); myDB.createAdapter().Fill(ds); return ds; }