/// <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 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; }