private void LoadDevs() { //get total amount of developers assigned to project List <MembershipUser> devs = ProjectsDB.GetProjectDevs(this_project); ltlDevCount.Text = devs.Count.ToString(); StringBuilder sb = new StringBuilder(); sb.Append("<table id='tblDevelopers' class='display project-users'>"); sb.Append("<thead>"); sb.Append("<th><strong>Name</strong></th>"); sb.Append("<th class='text-center'><strong>Total Tickets</strong></th>"); sb.Append("<th><strong>Remove</strong></th>"); sb.Append("</thead>"); sb.Append("<tbody>"); foreach (MembershipUser dev in devs) { sb.Append("<tr>"); sb.AppendFormat("<td>{0}</td>", dev.UserName); sb.AppendFormat("<td>{0}</td>", TicketsDB.GetDevProjectTicketCount(this_project, dev)); sb.AppendFormat("<td><input type='button' value='X' data-user='******' class='RemoveUserFromProject' onclick='RemoveUserFromProject(this);'/>", dev.ProviderUserKey); sb.Append("</tr>"); } sb.Append("</tbody>"); sb.Append("</table>"); ltlDevs.Text = sb.ToString(); }
public static object[] LoadProjectDevelopers() { StringBuilder sb = new StringBuilder(); Int16 devCount = 0; //get total amount of developers assigned to project List <MembershipUser> devs = ProjectsDB.GetProjectDevs(ProjectsDB.GetProject(project_id)); List <ProjectUser> all_devs = new List <ProjectUser>(); try { project this_project = ProjectsDB.GetProject(project_id); devCount = (Int16)devs.Count; foreach (MembershipUser dev in devs) { ProjectUser new_dev = new ProjectUser() { Username = dev.UserName, User_id = dev.ProviderUserKey.ToString(), Ticket_count = TicketsDB.GetDevProjectTicketCount(this_project, dev), Remove_button = String.Format("<input type='button' value='X' data-user='******' class='RemoveUserFromProject' onclick='RemoveUserFromProject(this);'/>", dev.ProviderUserKey) }; all_devs.Add(new_dev); } } catch (Exception ex) { LogsDB.AddLog("Error building project developers table", LogsDB.GetLogType("error").id, project_id, ex); } return(new object[] { all_devs, devCount }); }