public List <TaskClass> Get(int eventTabID) { List <TaskClass> tasks = new List <TaskClass>(); SqlCommand cmd = new SqlCommand("select * from Task where eventTabID=@eventTabID ORDER BY taskTableAddDate ASC", connection); cmd.Parameters.AddWithValue("@eventTabID", eventTabID); connection.Open(); SqlDataReader sdr = cmd.ExecuteReader(); while (sdr.Read()) { TaskClass task = new TaskClass(); task.ID = (int)sdr["taskID"]; task.EventTabID = (int)sdr["eventTabID"]; task.Title = (string)sdr["taskTitle"]; task.Date = (DateTime)sdr["taskDate"]; task.GuessTime = (int)sdr["taskGuessTime"]; task.RealTime = (int)sdr["taskRealTime"]; task.TechnicalPersonID = (int)sdr["taskTechnicalPerson"]; task.WorkComment = (string)sdr["taskWorkComment"]; task.Note = (string)sdr["taskNotes"]; task.TaskButton.Text = task.Title; task.taskFinish = (Boolean)sdr["taskFinish"]; WorkFollow workFollow = new WorkFollow(); task.workFollows = workFollow.Get(task.ID); tasks.Add(task); } connection.Close(); return(tasks); }
void workFollowTableRowAdd(WorkFollow workFollow) { tableWorkFollow.Rows.Add(new TablePanelRow(TablePanelEntityStyle.AutoSize, 0)); tableWorkFollow.Controls.Add(workFollow.ID); tableWorkFollow.Controls.Add(workFollow.Date); tableWorkFollow.Controls.Add(workFollow.Status); tableWorkFollow.Controls.Add(workFollow.Work); tableWorkFollow.Controls.Add(workFollow.Comment); tableWorkFollow.Controls.Add(workFollow.WorkFollowDeleteButton); }
private void AddWorkFollow_Click(object sender, EventArgs e) { if (task.workFollows.Count <= 10) { workFollow = new WorkFollow(); workFollow.Create(task.ID); task.workFollows.Add(workFollow); workFollowTableRowAdd(workFollow); workFollowTableRowSort(); } }
public List <WorkFollow> Get(int taskID) { List <WorkFollow> workFollows = new List <WorkFollow>(); SqlCommand cmd = new SqlCommand("select * from workFollow where taskID=@taskID", connection); cmd.Parameters.AddWithValue("@taskID", taskID); connection.Open(); SqlDataReader sdr = cmd.ExecuteReader(); while (sdr.Read()) { WorkFollow workFollow = new WorkFollow(); workFollow.ID.Text = sdr["workFollowID"].ToString(); workFollow.Date.Text = (string)sdr["Date"]; workFollow.Status.Text = (string)sdr["Status"]; workFollow.Work.Text = (string)sdr["Work"]; workFollow.Comment.Text = (string)sdr["Comment"]; workFollows.Add(workFollow); } connection.Close(); return(workFollows); }