protected override void ShowData(int milestoneId) { base.ShowData(milestoneId); oDetailButtonPanel.SetId = SetId; Clear(); var data = new MilestoneDataModel(); data.MilestoneId = milestoneId; var items = MilestoneDataManager.GetEntityDetails(data, SessionVariables.RequestProfile); // should only have single match if (items.Count == 1) { var item = items[0]; SetData(item); lblProjectId.Text = item.Project.ToString(); oUpdateInfo.LoadText(item.UpdatedDate, item.UpdatedBy, item.LastAction); oHistoryList.Setup((int)SystemEntity.Milestone, milestoneId, "Milestone"); } }
public void LoadData(int milestoneId, bool showId) { Clear(); var data = new MilestoneDataModel(); //var projectData = TaskTimeTracker.Components.BusinessLayer.Project.GetList(SessionVariables.RequestProfile.AuditId); //var data = new MilestoneDataModel(); data.MilestoneId = milestoneId; var items = MilestoneDataManager.GetEntityDetails(data, SessionVariables.RequestProfile); if (items.Count != 1) { return; } var item = items[0]; SetData(item); if (!showId) { SystemKeyId = item.MilestoneId; ProjectId = item.ProjectId; oHistoryList.Setup(PrimaryEntity, milestoneId, PrimaryEntityKey); } else { CoreSystemKey.Text = String.Empty; } /*if (items.Rows.Count == 1) * { * var row = oMilestoneTable.Rows[0]; * * if (!showId) * { * txtMilestoneId.Text = Convert.ToString(row[TaskTimeTracker.MilestoneDataModel.DataColumns.MilestoneId]); * * // only show Audit History in case of Update page, not for Clone. * oHistoryList.Setup((int)Framework.Components.DataAccess.SystemEntity.Milestone, milestoneId, "Milestone"); * dynAuditHistory.Visible = PerferenceUtility.GetUserPreferenceByKeyAsBoolean(ApplicationCommon.HistoryGridVisibilityKey, "Milestone"); * * } * * else * { * txtMilestoneId.Text = String.Empty; * } * txtDescription.InnerText = Convert.ToString(row[TaskTimeTracker.MilestoneDataModel.DataColumns.Description]); * txtName.Text = Convert.ToString(row[TaskTimeTracker.MilestoneDataModel.DataColumns.Name]); * txtSortOrder.Text = Convert.ToString(row[TaskTimeTracker.MilestoneDataModel.DataColumns.SortOrder]); * drpProjectList.SelectedValue = Convert.ToString(row[TaskTimeTracker.MilestoneDataModel.DataColumns.ProjectId]); * txtProjectId.Text = Convert.ToString(row[TaskTimeTracker.MilestoneDataModel.DataColumns.ProjectId]); * * oUpdateInfo.LoadText(oMilestoneTable.Rows[0]); * } * else * { * txtMilestoneId.Text = String.Empty; * txtDescription.InnerText = String.Empty; * txtName.Text = String.Empty; * txtSortOrder.Text = String.Empty; * }*/ }