public Starbase118HistoryEntry(Starbase118HistoryEntry c) { charFirstN = c.charFirstN; charLastN = c.charLastN; charPosition = c.charPosition; charRank = c.charRank; charJoinDate = new Stardate(c.charJoinDate); charLeaveDate = new Stardate(c.charLeaveDate); charImgStr = c.charImgStr; charNotes = c.charNotes; charOnShip = c.charOnShip; hasNoLink = c.hasNoLink; }
public Starbase118HistoryEntry(string first, string last, Starbase118Positions post, Starbase118Ranks rank, Stardate joinD, Stardate leaveD, string image, string notes, bool currMember, bool hasProfile) { charFirstN = first; charLastN = last; charPosition = post; charRank = rank; charJoinDate = joinD; charLeaveDate = leaveD; charImgStr = image; charNotes = notes; charOnShip = currMember; hasNoLink = hasProfile; }
protected string DisplayPosts(Starbase118Positions post, string pipStyle) { string outStr = ""; if (unsortedList.Count(item => item.charPosition == post) > 0) { //now to find any on ship and treat them as current, unless they have a listed end date foreach (Starbase118HistoryEntry hist in unsortedList) { if (hist.charOnShip && hist.charLeaveDate != null) { hist.charLeaveDate = Stardate.Today(); } } var selection = unsortedList.Where(item => item.charPosition == post) .OrderByDescending(o => o.charLeaveDate); outStr += "{{Post|"; outStr += positionColor[postDivision[post]] + "|"; outStr += postTitle[post] + "}}" + Environment.NewLine; foreach (Starbase118HistoryEntry ent in selection) { if (!ent.hasNoLink) { if (ent.charOnShip) { outStr += "{{New|"; } else { outStr += "{{Old|"; } } else { if (ent.charOnShip) { outStr += "{{No Link New|"; } else { outStr += "{{No Link Old|"; } } outStr += rankTitle[ent.charRank] + "|"; outStr += ent.charFirstN + "|" + ent.charLastN + "|"; if (marineRanks.Contains(ent.charRank.ToString())) { outStr += positionColor["Marine"] + "|"; } else { outStr += positionColor[postDivision[ent.charPosition]] + "|"; } outStr += ent.charJoinDate.ToString() + " - "; /* if (ent.charOnShip == true) * outStr += "Present"; * else */if (ent.charLeaveDate == null) { outStr += "??????"; } else { outStr += ent.charLeaveDate.ToString(); } outStr += "|" + ent.charImgStr; outStr += "|STYLE=" + pipStyle; if (ent.charNotes != null) { outStr += "|NOTES=" + ent.charNotes; } outStr += "}}" + Environment.NewLine; } } return(outStr); }