From e90250076d4f0631cebdac766cf7cec8db233e1b Mon Sep 17 00:00:00 2001 From: Wesley Andrade Date: Tue, 13 Mar 2018 23:40:02 -0500 Subject: [PATCH] made Tasks page more complete --- Dashboard.aspx | 48 +++++++++---------- Projects/Project.aspx | 54 +++++++++------------ Projects/Tasks.aspx | 103 ++++++++++++++++------------------------- Projects/Tasks.aspx.cs | 42 ++++++++++++++--- Timesheet.aspx | 48 +++++++++---------- 5 files changed, 138 insertions(+), 157 deletions(-) diff --git a/Dashboard.aspx b/Dashboard.aspx index 59fbc07..67c9418 100644 --- a/Dashboard.aspx +++ b/Dashboard.aspx @@ -24,30 +24,35 @@ diff --git a/Projects/Project.aspx b/Projects/Project.aspx index d97ea09..34afc70 100644 --- a/Projects/Project.aspx +++ b/Projects/Project.aspx @@ -22,30 +22,35 @@ @@ -106,12 +100,6 @@

Collapsible Sidebar Using Bootstrap 3

Lorem ipsum dolor sit amet, consectetur adipisicing elit, sed do eiusmod tempor incididunt ut labore et dolore magna aliqua. Ut enim ad minim veniam, quis nostrud exercitation ullamco laboris nisi ut aliquip ex ea commodo consequat. Duis aute irure dolor in reprehenderit in voluptate velit esse cillum dolore eu fugiat nulla pariatur. Excepteur sint occaecat cupidatat non proident, sunt in culpa qui officia deserunt mollit anim id est laborum.

Lorem ipsum dolor sit amet, consectetur adipisicing elit, sed do eiusmod tempor incididunt ut labore et dolore magna aliqua. Ut enim ad minim veniam, quis nostrud exercitation ullamco laboris nisi ut aliquip ex ea commodo consequat. Duis aute irure dolor in reprehenderit in voluptate velit esse cillum dolore eu fugiat nulla pariatur. Excepteur sint occaecat cupidatat non proident, sunt in culpa qui officia deserunt mollit anim id est laborum.

-

Collapsible Sidebar Using Bootstrap 3

-

Lorem ipsum dolor sit amet, consectetur adipisicing elit, sed do eiusmod tempor incididunt ut labore et dolore magna aliqua. Ut enim ad minim veniam, quis nostrud exercitation ullamco laboris nisi ut aliquip ex ea commodo consequat. Duis aute irure dolor in reprehenderit in voluptate velit esse cillum dolore eu fugiat nulla pariatur. Excepteur sint occaecat cupidatat non proident, sunt in culpa qui officia deserunt mollit anim id est laborum.

-

Lorem ipsum dolor sit amet, consectetur adipisicing elit, sed do eiusmod tempor incididunt ut labore et dolore magna aliqua. Ut enim ad minim veniam, quis nostrud exercitation ullamco laboris nisi ut aliquip ex ea commodo consequat. Duis aute irure dolor in reprehenderit in voluptate velit esse cillum dolore eu fugiat nulla pariatur. Excepteur sint occaecat cupidatat non proident, sunt in culpa qui officia deserunt mollit anim id est laborum.

-

Collapsible Sidebar Using Bootstrap 3

-

Lorem ipsum dolor sit amet, consectetur adipisicing elit, sed do eiusmod tempor incididunt ut labore et dolore magna aliqua. Ut enim ad minim veniam, quis nostrud exercitation ullamco laboris nisi ut aliquip ex ea commodo consequat. Duis aute irure dolor in reprehenderit in voluptate velit esse cillum dolore eu fugiat nulla pariatur. Excepteur sint occaecat cupidatat non proident, sunt in culpa qui officia deserunt mollit anim id est laborum.

-

Lorem ipsum dolor sit amet, consectetur adipisicing elit, sed do eiusmod tempor incididunt ut labore et dolore magna aliqua. Ut enim ad minim veniam, quis nostrud exercitation ullamco laboris nisi ut aliquip ex ea commodo consequat. Duis aute irure dolor in reprehenderit in voluptate velit esse cillum dolore eu fugiat nulla pariatur. Excepteur sint occaecat cupidatat non proident, sunt in culpa qui officia deserunt mollit anim id est laborum.

diff --git a/Projects/Tasks.aspx b/Projects/Tasks.aspx index 8c5cd51..bb4c932 100644 --- a/Projects/Tasks.aspx +++ b/Projects/Tasks.aspx @@ -381,59 +381,44 @@ ol.kanban { cursor: move; } -
- + @@ -513,21 +487,22 @@ ol.kanban {

- + <%--MAIN REPEATER CODE VERY IMPORTANT--%> - +

    <%# Eval("GroupName")%>

    - - + +
  1. +

    <%# Eval("AssignmentNote")%> filter_none

    @@ -542,7 +517,7 @@ ol.kanban {
    - + <%--control_point--%>
@@ -550,8 +525,16 @@ ol.kanban {
- - + + + + + + + + + <%----%> + @@ -634,15 +617,7 @@ ol.kanban { --%>
- - - - - - - - - + diff --git a/Projects/Tasks.aspx.cs b/Projects/Tasks.aspx.cs index 6aad8ff..9d4e22d 100644 --- a/Projects/Tasks.aspx.cs +++ b/Projects/Tasks.aspx.cs @@ -10,6 +10,7 @@ public partial class lmaoooo : System.Web.UI.Page { + string b; protected void Page_Load(object sender, EventArgs e) { //make label invisble; makes value trasnfer easier @@ -21,13 +22,13 @@ protected void Page_Load(object sender, EventArgs e) LoadProjects(Label1.Text); } - + //load in values for Phases private void LoadProjects(string id) { if (!IsPostBack) - { + { SqlConnection con = new SqlConnection(ConfigurationManager.ConnectionStrings["connect"].ToString()); con.Open(); SqlCommand cmd = con.CreateCommand(); @@ -47,8 +48,11 @@ protected void ItemBound(object sender, RepeaterItemEventArgs args) { if (args.Item.ItemType == ListItemType.Item || args.Item.ItemType == ListItemType.AlternatingItem) { - Label lbl = args.Item.FindControl("lblName") as Label; + Label lbl = args.Item.FindControl("lblName") as Label; //Assignment.groupID var a = lbl.Text; + + + Repeater childRepeater = (Repeater)args.Item.FindControl("ChildRepeater"); @@ -56,7 +60,8 @@ protected void ItemBound(object sender, RepeaterItemEventArgs args) con.Open(); SqlCommand cmd = con.CreateCommand(); cmd.CommandType = CommandType.Text; - cmd.CommandText = "select distinct AssignmentNote, AssignmentEnd from Assignment, Group1 where Group1.ProjectId=Assignment.ProjectId and Assignment.GroupID=" + a + ";"; + //cmd.CommandText = "select AssignmentNote, AssignmentEnd, Position from Assignment, Group1 where Group1.ProjectId = Assignment.ProjectId and Assignment.GroupID =" + a + " group by AssignmentNote, AssignmentEnd, Position order by MAX(Assignment.Position) asc;"; + cmd.CommandText = "SELECT DISTINCT AssignmentId, AssignmentNote, AssignmentEnd, MAX(Assignment.Position) as Position FROM Assignment, Group1 where Group1.ProjectId = Assignment.ProjectId and Assignment.GroupID =" + a + " GROUP BY AssignmentId, AssignmentNote, AssignmentEnd ORDER BY Position DESC, AssignmentId"; cmd.ExecuteNonQuery(); DataTable dt = new DataTable(); SqlDataAdapter da = new SqlDataAdapter(cmd); @@ -70,7 +75,7 @@ protected void ItemBound(object sender, RepeaterItemEventArgs args) protected void btnUpdateSortOrder_Click(object sender, EventArgs e) { // stores id_ in array - string[] id_language = Request.Form.GetValues("languageId"); + string[] id_language = { "To-do", "In-Progress" }; int sortNumber = 1; // Loop over array, which contains id_ @@ -85,7 +90,7 @@ protected void btnUpdateSortOrder_Click(object sender, EventArgs e) public void updateRecord(string languageId, int sortOrder) { - string updateQuery = "UPDATE Group1 SET GroupId =" + languageId + " WHERE position=" + sortOrder + ";"; + string updateQuery = "UPDATE Assignment SET Position =" + sortOrder + " WHERE GroupName=" + languageId + ";"; using (SqlConnection conn = new SqlConnection(ConfigurationManager.ConnectionStrings["connect"].ToString())) { using (SqlCommand cmd = new SqlCommand()) @@ -102,7 +107,32 @@ public void updateRecord(string languageId, int sortOrder) } } + protected void ChildRepeater_ItemDataBound(object sender, RepeaterItemEventArgs args) + { + if (args.Item.ItemType == ListItemType.Item || args.Item.ItemType == ListItemType.AlternatingItem) + { + Label lbl = args.Item.FindControl("Label2") as Label; //Assignment.Position + b = lbl.Text.ToString(); + Response.Write(b); + + } + } + protected void RepeaterDetailsRow_ItemCommand(object source, RepeaterCommandEventArgs e) + { + if (e.CommandName == "addnew") + { + Repeater childRepeater = (Repeater)e.Item.FindControl("ChildRepeater"); + SqlConnection con = new SqlConnection(ConfigurationManager.ConnectionStrings["connect"].ToString()); + con.Open(); + SqlCommand cmd = con.CreateCommand(); + cmd.CommandType = CommandType.Text; + cmd.CommandText = "insert into Assignment(AssignmentNote, ProjectId, GroupID, position) values('ayy', 1, 1, 2)"; + cmd.ExecuteNonQuery(); + con.Close(); + } + Response.Redirect(Request.RawUrl); + } } diff --git a/Timesheet.aspx b/Timesheet.aspx index d102e6f..c459d6d 100644 --- a/Timesheet.aspx +++ b/Timesheet.aspx @@ -26,30 +26,35 @@