/// <summary> /// Set the properties of this object. /// This method is used by the DataAccess layer (DAL) /// to create new object instances from the underlying /// data persistence layer (DataProvider) /// </summary> /// <param name="item"></param> public void SetProperties(KPListItem item, string listName) { this.ID = (item.ContainsKey("ID")) ?KPUtilities.ParseInt(item["ID"].Value) : -1; this.KPID = (item.ContainsKey("KPID")) ? KPUtilities.ParseInt(item["KPID"].Value) : -1; this.KPGUID = (item.ContainsKey("KPGUID")) ? item["KPGUID"].Value : string.Empty; this.Title = (item.ContainsKey("Title")) ? item["Title"].Value : string.Empty; this.ViewOwner = (item.ContainsKey("ViewOwner")) ? item["ViewOwner"].Value : string.Empty; this.KPFilters = KPUtilities.StripHTML((item.ContainsKey("KPFilters")) ? item["KPFilters"].Value : string.Empty, false); this.KPDescription = KPUtilities.StripHTML((item.ContainsKey("KPDescription")) ? item["KPDescription"].Value : string.Empty, false); this.GridStates = KPUtilities.StripHTML((item.ContainsKey("GridStates")) ? item["GridStates"].Value : string.Empty, false); this.StrikethroughOverride = (item.ContainsKey("StrikethroughOverride")) ? item["StrikethroughOverride"].Value : string.Empty; this.RelatedCheckpoints = (item.ContainsKey("RelatedCheckpoints")) ? item["RelatedCheckpoints"].Value : string.Empty; this.SharedWith = (item.ContainsKey("SharedWith")) ? item["SharedWith"].Value : string.Empty; this.KPItemState = item["KPItemState"].Value; this.EntityTypes = (item.ContainsKey("EntityTypes")) ? item["EntityTypes"].Value : string.Empty; this.SPCreatedDate = KPUtilities.ParseDateTime(item["Created"].Value); this.SPModifiedDate = KPUtilities.ParseDateTime(item["Modified"].Value); this.SPCreatedBy = item["CreatedBy"].Value; this.SPModifiedBy = item["ModifiedBy"].Value; this.KPTeamId = null; this.Type = listName; }
/// <summary> /// Set the properties of this object. /// This method is used by the DataAccess layer (DAL) /// to create new object instances from the underlying /// data persistence layer (DataProvider) /// </summary> /// <param name="item"></param> public override void SetProperties(KPListItem item, string listName) { this.GoalSetId = CheckNullInt("GoalSet", item); this.CategoryL1Id = CheckNullInt("CategoryL1", item); this.CategoryL2Id = CheckNullInt("CategoryL2", item); this.Country = item["Country"].Value; this.Year = CheckNullInt("Year", item); this.KPGoalContributor = item["KPGoalContributor"].Value; this.MetricValue = KPUtilities.StripHTML((item.ContainsKey("MetricValue")) ? item["MetricValue"].Value : string.Empty, false); base.SetProperties(item, listName); }
/// <summary> /// Implements IKPEntity interface /// </summary> /// <param name="item"></param> /// <returns></returns> public void SetProperties(KPListItem item, string listName) { // set item properties to serialize object this.itemProperties = item; this.Nick = item["Nick"].Value; this.ParentId = CheckNullInt("Parent", item); this.SubUrl = item["SubUrl"].Value; this.TeamVision = KPUtilities.StripHTML(item["TeamVision"].Value, false); this.TeamIntro = KPUtilities.StripHTML(item["TeamIntro"].Value, false); this.siteUrl = GetTeamUrl(); base.SetBaseProperties(item, listName); }
/// <summary> /// Setting properties /// The object 'rehydrated' here is an entity /// for consumption by external code /// </summary> /// <param name="item"></param> public virtual void SetProperties(KPListItem item, string listName) { try { this.KPExternalId = item.ContainsKey("KPExternalID") ? ParseInt(item["KPExternalID"].Value) : -1; this.KPDate = ParseDateTime(item["KPDate"].Value); // these values do not exist for all entity types this.KPCreatedDate = item.ContainsKey("KPCreatedDate") ? ParseDateTime(item["KPCreatedDate"].Value) : null; this.KPOriginalDate = item.ContainsKey("KPOriginalDate") ? ParseDateTime(item["KPOriginalDate"].Value) : null; this.KPCompletionDate = item.ContainsKey("KPCompletionDate") ? ParseDateTime(item["KPCompletionDate"].Value) : null; this.KPCustomerIDs = item.ContainsKey("KPCustomers") ? item["KPCustomers"].Value : string.Empty; this.KPCustomers = null; this.KPItemState = item["KPItemState"].Value; this.KPTeamId = item.ContainsKey("KPTeam") ? ParseInt(item["KPTeam"].Value) : -1; this.KPMovedFromValue = item.ContainsKey("KPMovedFrom") ? item["KPMovedFrom"].Value : string.Empty; this.KPMovedFrom = null; this.KPMovedToValue = item.ContainsKey("KPMovedTo") ? item["KPMovedTo"].Value : string.Empty; this.KPMovedTo = null; this.KPExecSummary = KPUtilities.StripHTML(item.ContainsKey("KPExecSummary") ? item["KPExecSummary"].Value : string.Empty, false); this.KPStatus = item["KPStatus"].Value; this.KPComments = KPUtilities.StripHTML(item.ContainsKey("KPComments") ? item["KPComments"].Value : string.Empty, false); this.KPSoWhat = KPUtilities.StripHTML(item.ContainsKey("KPSoWhat") ? item["KPSoWhat"].Value : string.Empty, false); this.KPPathToGreen = KPUtilities.StripHTML(item.ContainsKey("KPPathToGreen") ? item["KPPathToGreen"].Value : string.Empty, false); this.KPBusinessOwner = item.ContainsKey("KPBusinessOwner") ? item["KPBusinessOwner"].Value : string.Empty; this.KPFinanceOwner = item.ContainsKey("KPFinanceOwner") ? item["KPFinanceOwner"].Value : string.Empty; this.KPDescription = KPUtilities.StripHTML((item.ContainsKey("KPDescription")) ? item["KPDescription"].Value : string.Empty, false); this.KPPrimaryVPId = item.ContainsKey("KPPrimaryVP") ? ParseInt(item["KPPrimaryVP"].Value) : -1; this.KPSecondaryVPIDs = item.ContainsKey("KPSecondaryVPs") ? item["KPSecondaryVPs"].Value : string.Empty; this.KPAttachment = item.ContainsKey("KPAttachment") ? item["KPAttachment"].Value : string.Empty; // Attached Documents this.DraftMode = ParseBool(item["DraftMode"].Value); } catch (Exception ex) { string errMsg = string.Format("Error setting BaseEntity properties on {0}: {1}", listName, ex.Message); throw new Exception(errMsg); } // set additional core item properties base.SetBaseProperties(item, listName); }
/// <summary> /// Set the properties of this object. /// This method is used by the DataAccess layer (DAL) /// to create new object instances from the underlying /// data persistence layer (DataProvider) /// </summary> /// <param name="item"></param> public override void SetProperties(KPListItem item, string listName) { this.TotalEffort = ParseInt(item["TotalEffort"].Value); this.AvoidableEffort = ParseInt(item["AvoidableEffort"].Value); this.TimesPerYear = ParseInt(item["TimesPerYear"].Value); this.InvestmentToReduceAE = ParseInt(item["InvestmentToReduceAE"].Value); this.KeyAssumptions = KPUtilities.StripHTML(item["KeyAssumptions"].Value, false); this.WorkloadDescription = KPUtilities.StripHTML(item["WorkloadDescription"].Value, false); this.WorkloadsPerYear = ParseInt(item["WorkloadsPerYear"].Value); this.TaskRole = item["TaskRole"].Value; this.ReductionType = item["ReductionType"].Value; this.UnavoidableEffort = ParseInt(item["UnavoidableEffort"].Value); this.KPType = item["KPType"].Value; this.ProjectedAvoidableEffortReduction = ParseInt(item["ProjectedAvoidableEffortReduction"].Value); this.ProjectedTimesPerYearReduction = ParseInt(item["ProjectedTimesPerYearReduction"].Value); this.RelatedEffortInstances = item["RelatedEffortInstances"].Value; this.RelatedProject = item["RelatedProject"].Value; this.ConfidenceLevel = item["ConfidenceLevel"].Value; base.SetProperties(item, listName); }
/// <summary> /// Set the properties of this object. /// This method is used by the DataAccess layer (DAL) /// to create new object instances from the underlying /// data persistence layer (DataProvider) /// </summary> /// <param name="item"></param> public void SetProperties(KPListItem item, string listName) { this.ID = (item.ContainsKey("ID")) ? KPUtilities.ParseInt(item["ID"].Value) : -1; this.KPID = (item.ContainsKey("KPID")) ? KPUtilities.ParseInt(item["KPID"].Value) : -1; this.KPGUID = (item.ContainsKey("KPGUID")) ? item["KPGUID"].Value : string.Empty; this.Title = (item.ContainsKey("Title")) ? item["Title"].Value : string.Empty; this.KPDescription = KPUtilities.StripHTML((item.ContainsKey("KPDescription")) ? item["KPDescription"].Value : string.Empty, false); this.KPComments = KPUtilities.StripHTML((item.ContainsKey("KPComments")) ? item["KPComments"].Value : string.Empty, false); this.TargetDate = KPUtilities.ParseDateTime(item["TargetDate"].Value); this.KPItemState = item["KPItemState"].Value; this.SPCreatedDate = KPUtilities.ParseDateTime(item["Created"].Value); this.SPModifiedDate = KPUtilities.ParseDateTime(item["Modified"].Value); this.SPCreatedBy = item["CreatedBy"].Value; this.SPModifiedBy = item["ModifiedBy"].Value; this.KPTeamId = null; this.Type = listName; }
//List<Project> Versions; public override void SetProperties(KPListItem item, string listName) { this.AEReduction = CheckNullInt("AEReduction", item); this.AssociatedProject = item["AssociatedProject"].Value; this.AvoidableEffort = CheckNullInt("AvoidableEffort", item); this.EffortPerWorkload = CheckNullInt("EffortPerWorkload", item); this.ParentProgramInitiative = item["ParentProgramInitiative"].Value; this.ProjectType = item["ProjectType"].Value; this.TotalEffort = CheckNullInt("TotalEffort", item); this.TTMImpact = item["TTMImpact"].Value; this.Dependency = KPUtilities.StripHTML(item["Dependency"].Value, false); this.Risks = KPUtilities.StripHTML(item["Risks"].Value, false); this.RelatedGoals = item["RelatedGoals"].Value; this.RelatedMilestones = item["RelatedMilestones"].Value; this.RelatedEffortInstances = (item.ContainsKey("RelatedEffortInstances")) ? item["RelatedEffortInstances"].Value : null; this.ProjectVP = item["ProjectVP"].Value; this.ProjectOwner = item["ProjectOwner"].Value; this.ProjectDirectorVP = item["ProjectDirectorVP"].Value; this.RelatedIssues = (item.ContainsKey("RelatedIssues")) ? item["RelatedIssues"].Value : null; this.Theme = CheckNullInt("Theme", item); this.Year = CheckNullInt("Year", item); base.SetProperties(item, listName); }
/// <summary> /// Implements IKPEntity interface /// </summary> /// <param name="item"></param> /// <returns></returns> public void SetProperties(KPListItem item, string listName) { this.KPDescription = KPUtilities.StripHTML((item.ContainsKey("KPDescription")) ? item["KPDescription"].Value : string.Empty, false); base.SetBaseProperties(item, listName); }