private void Page_Load(object sender, System.EventArgs e) { DBDriver myDB = new DBDriver(); // Put user code to initialize the page here string role = Request.Cookies["user"]["role"]; string userID = Request.Cookies["user"]["id"]; // fill the contact list if (!this.IsPostBack) { if (role.Equals(PMT.User.Security.CLIENT)) { myDB.Query = "select u.userName as userName, u.id as ID\n" + "from users u, clients c\n" + "where u.id = c.managerID\n" + "and c.clientID = @clientID;"; myDB.addParam("@clientID", userID); } else { myDB.Query = "select userName, id from users;"; } DataSet ds2 = new DataSet(); myDB.createAdapter().Fill(ds2); //create a datatable to fill the dropdown list from DataTable dt = ds2.Tables[0]; //fill the Contacts list box ContactsListBox.DataSource = dt.DefaultView; ContactsListBox.DataTextField = "userName"; ContactsListBox.DataValueField = "id"; ContactsListBox.DataBind(); // fill the inbox myDB.Query = "select m.ID messID, u.userName sender, m.subject subject, m.timestamp date, m.ID id from users u, messages m, recipients r" + " where r.recipientID=@me and m.ID=r.messageID and u.ID=m.senderID;"; myDB.addParam("@me", Request.Cookies["user"]["id"]); DataSet ds = new DataSet(); //initialize the data adapter //fill the dataset myDB.createAdapter().Fill(ds); //fill the display grid this.MessagesDataGrid.DataSource = ds; this.MessagesDataGrid.DataBind(); } }
private void Page_Load(object sender, System.EventArgs e) { //initialize the DB object DBDriver myDB = new DBDriver(); //set the appropriate SQL query myDB.Query = "select t.ID as taskID, t.name as name, m.name as moduleName, p.name as projectName,\n" + "t.actEndDate as actEndDate, t.complete as complete, a.dateAss as dateAss, a.devID, a.taskID\n" + "from tasks t, assignments a, modules m, projects p\n" + "where t.ID = a.taskID and a.devID = @devID\n" + "and t.moduleID = m.ID\n" + "and m.projectID = p.ID\n" + "order by p.name, m.name, t.name;"; myDB.addParam("@devID", Request.Cookies["user"]["id"]); //initialize the dataset DataSet ds = new DataSet(); //initialize the data adapter //fill the dataset;this is updated myDB.createAdapter().Fill(ds); //fill the display grid DataGrid1.DataSource = ds; if (!Page.IsPostBack) { DataGrid1.DataBind(); } }
private void Page_Load(object sender, System.EventArgs e) { // Put user code to initialize the page here if(!this.IsPostBack) { DBDriver myDB=new DBDriver(); myDB.Query="select * from compMatrix;"; DataSet ds=new DataSet(); myDB.createAdapter().Fill(ds); this.compMatrixGrid.DataSource=ds; this.compMatrixGrid.DataBind(); } }
private void Page_Load(object sender, System.EventArgs e) { // Put user code to initialize the page here if (!this.IsPostBack) { DBDriver myDB = new DBDriver(); myDB.Query = "select * from compMatrix;"; DataSet ds = new DataSet(); myDB.createAdapter().Fill(ds); this.compMatrixGrid.DataSource = ds; this.compMatrixGrid.DataBind(); } }
private void Page_Load(object sender, System.EventArgs e) { // Put user code to initialize the page here if (!Page.IsPostBack) { //fill the datagrid with wannabe users DBDriver myDB = new DBDriver(); myDB.Query = "select u.id id, u.username username, u.security security, p.firstname first, p.lastname last from users u, person p where p.id=u.id;"; //initialize the dataset DataSet ds = new DataSet(); //initialize the data adapter //fill the dataset myDB.createAdapter().Fill(ds); //fill the display grid UserDataGrid.DataSource = ds; UserDataGrid.DataBind(); } }
private void Page_Load(object sender, System.EventArgs e) { // Put user code to initialize the page here if(!Page.IsPostBack) { //fill the datagrid with wannabe users DBDriver myDB=new DBDriver(); myDB.Query="select u.id id, u.username username, u.security security, p.firstname first, p.lastname last from users u, person p where p.id=u.id;"; //initialize the dataset DataSet ds=new DataSet(); //initialize the data adapter //fill the dataset myDB.createAdapter().Fill(ds); //fill the display grid UserDataGrid.DataSource=ds; UserDataGrid.DataBind(); } }
private void Page_Load(object sender, System.EventArgs e) { clientID = Request.Cookies["user"]["id"]; if (!Page.IsPostBack) { // show the projects datagrid DBDriver db = new DBDriver(); db.Query = "select p.ID as projectID, p.Name as projectName, u.ID as managerID, u.userName as managerName\n" + "from projects p, users u, clients c\n" + "where p.ID = c.projectID\n" + "and u.ID = c.managerID\n" + "and c.clientID = @clientID;"; db.addParam("@clientID", clientID); DataSet ds = new DataSet(); db.createAdapter().Fill(ds); DataGrid1.DataSource = ds; DataGrid1.DataBind(); } }
private void Page_Load(object sender, System.EventArgs e) { //initialize the DB object DBDriver myDB=new DBDriver(); //set the appropriate SQL query myDB.Query = "select t.ID as taskID, t.name as name, m.name as moduleName, p.name as projectName,\n" + "t.actEndDate as actEndDate, t.complete as complete, a.dateAss as dateAss, a.devID, a.taskID\n" + "from tasks t, assignments a, modules m, projects p\n" + "where t.ID = a.taskID and a.devID = @devID\n" + "and t.moduleID = m.ID\n" + "and m.projectID = p.ID\n" + "order by p.name, m.name, t.name;"; myDB.addParam("@devID", Request.Cookies["user"]["id"]); //initialize the dataset DataSet ds=new DataSet(); //initialize the data adapter //fill the dataset;this is updated myDB.createAdapter().Fill(ds); //fill the display grid DataGrid1.DataSource=ds; if (!Page.IsPostBack) DataGrid1.DataBind(); }
private void Page_Load(object sender, System.EventArgs e) { DBDriver myDB=new DBDriver(); // Put user code to initialize the page here string role = Request.Cookies["user"]["role"]; string userID = Request.Cookies["user"]["id"]; // fill the contact list if (!this.IsPostBack) { if (role.Equals(PMT.User.Security.CLIENT)) { myDB.Query= "select u.userName as userName, u.id as ID\n" + "from users u, clients c\n" + "where u.id = c.managerID\n" + "and c.clientID = @clientID;"; myDB.addParam("@clientID", userID); } else { myDB.Query="select userName, id from users;"; } DataSet ds2=new DataSet(); myDB.createAdapter().Fill(ds2); //create a datatable to fill the dropdown list from DataTable dt=ds2.Tables[0]; //fill the Contacts list box ContactsListBox.DataSource=dt.DefaultView; ContactsListBox.DataTextField="userName"; ContactsListBox.DataValueField="id"; ContactsListBox.DataBind(); // fill the inbox myDB.Query="select m.ID messID, u.userName sender, m.subject subject, m.timestamp date, m.ID id from users u, messages m, recipients r" +" where r.recipientID=@me and m.ID=r.messageID and u.ID=m.senderID;"; myDB.addParam("@me", Request.Cookies["user"]["id"]); DataSet ds=new DataSet(); //initialize the data adapter //fill the dataset myDB.createAdapter().Fill(ds); //fill the display grid this.MessagesDataGrid.DataSource=ds; this.MessagesDataGrid.DataBind(); } }
private void Page_Load(object sender, System.EventArgs e) { // Put user code to initialize the page here string taskID = Request["taskID"]; string error = Request["error"]; if (error != null) { //Response.Write("<script type=\"text/javascript\">alert(\""+ error +"\");</script>"); ErrorLabel.Text = error; } if (taskID != null) { AvailDevLabel.Text = "Choose Developer to be assigned to Task " + taskID; } // fill available developers data grid //TODO: FINISH THIS // int Threshold = Convert.ToInt32(ThresholdTextBox.Text); DBDriver myDB = new DBDriver(); string s = "select p.ID as ID, p.lastName as lastName, p.firstName as firstName,\n" + "u.username as username, c.competence as competence, count(a.devID) as taskCount\n" + "from person p, compLevels c, assignments a, users u\n" + "where p.ID = u.ID\n" + "and u.security = 'Developer'\n" + "and p.ID = a.devID\n" + "and p.ID = c.ID\n" + "group by p.ID, p.lastName, p.firstName, u.userName, c.competence\n" + "having count(a.devID) < 10" // set to 10 for testing + "order by p.lastName;"; // if(Threshold != -1 ) // s +="having count(a.devID) < @Threshold"; // // s += "order by p.lastName;"; myDB.Query = s; // if( Threshold != -1 ) // myDB.addParam( "@Threshold", Threshold ); DataSet ds = new DataSet(); myDB.createAdapter().Fill(ds); DataGrid1.DataSource = ds; DataGrid1.DataBind(); // fill assignments data grid DBDriver myDB2 = new DBDriver(); s = "select assignments.taskID as taskID, users.ID as devID, users.username as username, tasks.name as taskName, \n" + "modules.name as moduleName, projects.name as projectName, assignments.dateAss as date, tasks.complete as complete\n" + "from assignments, users, tasks, modules, projects\n" + "where users.ID = assignments.devID\n" + "and users.security = 'Developer'\n" + "and assignments.taskID = tasks.ID\n" + "and tasks.moduleID = modules.ID\n" + "and modules.projectID = projects.ID\n" + "and projects.managerID = @mgrID \n" + "order by projects.name, modules.name, tasks.name, users.username;"; myDB2.Query = s; myDB2.addParam("@mgrID", Request.Cookies["user"]["id"]); DataSet ads = new DataSet(); myDB2.createAdapter().Fill(ads); DataGrid2.DataSource = ads; if (!Page.IsPostBack) { DataGrid2.DataBind(); } }
private void Page_Load(object sender, System.EventArgs e) { // Put user code to initialize the page here if (!this.IsPostBack) { role = Request.Cookies["user"]["role"]; userID = Request.Cookies["user"]["id"]; if (role.Equals(PMT.User.Security.PROJECT_MANAGER)) { // get all projectes assigned to a project manager DataSet ds = Project.getProjectsDataSet(userID); //create a datatable to fill the dropdown list from DataTable dt = new DataTable(); dt = ds.Tables[0]; //fill the dropdown list ProjectDropDownList.DataSource = dt.DefaultView; ProjectDropDownList.DataTextField = "name"; ProjectDropDownList.DataValueField = "ID"; ProjectDropDownList.DataBind(); ProjectDropDownList.Items.Insert(0, ""); enableModuleControls(false); enableTaskControls(false); } else if (role.Equals(PMT.User.Security.DEVELOPER)) { // get all tasks assigned to a developer DBDriver db = new DBDriver(); db.Query = "select t.id, t.name from assignments a, tasks t \n" + "where a.devID = @devID and t.id = a.taskID"; db.addParam("@devID", userID); DataSet ds = new DataSet(); db.createAdapter().Fill(ds); DataTable dt = new DataTable(); dt = ds.Tables[0]; // display tasks in the drop down list TaskDropDownList.DataSource = dt.DefaultView; TaskDropDownList.DataTextField = "name"; TaskDropDownList.DataValueField = "id"; TaskDropDownList.DataBind(); TaskDropDownList.Items.Insert(0, ""); enableModuleControls(false); enableProjectControls(false); } else if (role.Equals(PMT.User.Security.CLIENT)) { // get all projectes assigned to a client DBDriver db = new DBDriver(); db.Query = "select * from projects p, clients c\n" + "where p.id = c.projectID\n" + "and c.clientID = @id;"; db.addParam("@id", userID); DataSet ds = new DataSet(); db.createAdapter().Fill(ds); //create a datatable to fill the dropdown list from DataTable dt = new DataTable(); dt = ds.Tables[0]; //fill the dropdown list ProjectDropDownList.DataSource = dt.DefaultView; ProjectDropDownList.DataTextField = "name"; ProjectDropDownList.DataValueField = "ID"; ProjectDropDownList.DataBind(); ProjectDropDownList.Items.Insert(0, ""); enableModuleControls(false); enableTaskControls(false); } } ReportPanel.Visible = false; }
private void Page_Load(object sender, System.EventArgs e) { // Put user code to initialize the page here if (!this.IsPostBack) { role = Request.Cookies["user"]["role"]; userID = Request.Cookies["user"]["id"]; if (role.Equals(PMT.User.Security.PROJECT_MANAGER)) { // get all projectes assigned to a project manager DataSet ds = Project.getProjectsDataSet(userID); //create a datatable to fill the dropdown list from DataTable dt=new DataTable(); dt=ds.Tables[0]; //fill the dropdown list ProjectDropDownList.DataSource=dt.DefaultView; ProjectDropDownList.DataTextField="name"; ProjectDropDownList.DataValueField="ID"; ProjectDropDownList.DataBind(); ProjectDropDownList.Items.Insert(0,""); enableModuleControls(false); enableTaskControls(false); } else if (role.Equals(PMT.User.Security.DEVELOPER)) { // get all tasks assigned to a developer DBDriver db = new DBDriver(); db.Query = "select t.id, t.name from assignments a, tasks t \n" +"where a.devID = @devID and t.id = a.taskID"; db.addParam("@devID", userID); DataSet ds = new DataSet(); db.createAdapter().Fill(ds); DataTable dt = new DataTable(); dt = ds.Tables[0]; // display tasks in the drop down list TaskDropDownList.DataSource=dt.DefaultView; TaskDropDownList.DataTextField="name"; TaskDropDownList.DataValueField="id"; TaskDropDownList.DataBind(); TaskDropDownList.Items.Insert(0,""); enableModuleControls(false); enableProjectControls(false); } else if (role.Equals(PMT.User.Security.CLIENT)) { // get all projectes assigned to a client DBDriver db = new DBDriver(); db.Query = "select * from projects p, clients c\n" + "where p.id = c.projectID\n" + "and c.clientID = @id;"; db.addParam("@id", userID); DataSet ds = new DataSet(); db.createAdapter().Fill(ds); //create a datatable to fill the dropdown list from DataTable dt=new DataTable(); dt=ds.Tables[0]; //fill the dropdown list ProjectDropDownList.DataSource=dt.DefaultView; ProjectDropDownList.DataTextField="name"; ProjectDropDownList.DataValueField="ID"; ProjectDropDownList.DataBind(); ProjectDropDownList.Items.Insert(0,""); enableModuleControls(false); enableTaskControls(false); } } ReportPanel.Visible = false; }
private void Page_Load(object sender, System.EventArgs e) { // Put user code to initialize the page here string taskID = Request["taskID"]; string error = Request["error"]; if (error != null) { //Response.Write("<script type=\"text/javascript\">alert(\""+ error +"\");</script>"); ErrorLabel.Text = error; } if (taskID != null) AvailDevLabel.Text = "Choose Developer to be assigned to Task " + taskID; // fill available developers data grid //TODO: FINISH THIS // int Threshold = Convert.ToInt32(ThresholdTextBox.Text); DBDriver myDB = new DBDriver(); string s = "select p.ID as ID, p.lastName as lastName, p.firstName as firstName,\n" + "u.username as username, c.competence as competence, count(a.devID) as taskCount\n" + "from person p, compLevels c, assignments a, users u\n" + "where p.ID = u.ID\n" + "and u.security = 'Developer'\n" + "and p.ID = a.devID\n" + "and p.ID = c.ID\n" + "group by p.ID, p.lastName, p.firstName, u.userName, c.competence\n" + "having count(a.devID) < 10" // set to 10 for testing + "order by p.lastName;"; // if(Threshold != -1 ) // s +="having count(a.devID) < @Threshold"; // // s += "order by p.lastName;"; myDB.Query = s; // if( Threshold != -1 ) // myDB.addParam( "@Threshold", Threshold ); DataSet ds = new DataSet(); myDB.createAdapter().Fill(ds); DataGrid1.DataSource = ds; DataGrid1.DataBind(); // fill assignments data grid DBDriver myDB2 = new DBDriver(); s = "select assignments.taskID as taskID, users.ID as devID, users.username as username, tasks.name as taskName, \n" + "modules.name as moduleName, projects.name as projectName, assignments.dateAss as date, tasks.complete as complete\n" + "from assignments, users, tasks, modules, projects\n" + "where users.ID = assignments.devID\n" + "and users.security = 'Developer'\n" + "and assignments.taskID = tasks.ID\n" + "and tasks.moduleID = modules.ID\n" + "and modules.projectID = projects.ID\n" + "and projects.managerID = @mgrID \n" + "order by projects.name, modules.name, tasks.name, users.username;"; myDB2.Query = s; myDB2.addParam("@mgrID", Request.Cookies["user"]["id"]); DataSet ads = new DataSet(); myDB2.createAdapter().Fill(ads); DataGrid2.DataSource = ads; if( !Page.IsPostBack ) DataGrid2.DataBind(); }