Create ListString property used in DisplayHistory

TabTitle for unnumbered procedures
This commit is contained in:
Rich 2012-03-22 20:29:49 +00:00
parent 8dd3d6481a
commit c21f8adf32
2 changed files with 18 additions and 4 deletions

View File

@ -6,6 +6,7 @@ using Csla.Data;
using Csla.Validation; using Csla.Validation;
using System.Data.SqlClient; using System.Data.SqlClient;
using System.Data; using System.Data;
using System.Text.RegularExpressions;
namespace VEPROMS.CSLA.Library namespace VEPROMS.CSLA.Library
{ {
@ -33,7 +34,7 @@ namespace VEPROMS.CSLA.Library
{ {
get {return ItemInfo.Get(this.ItemID);} get {return ItemInfo.Get(this.ItemID);}
} }
public override string ToString() public string ListString()
{ {
string who = string.Empty; string who = string.Empty;
string when = string.Empty; string when = string.Empty;
@ -44,6 +45,12 @@ namespace VEPROMS.CSLA.Library
//return string.Format("{0}{1}{2}", this.ActionWhat, who, when); //return string.Format("{0}{1}{2}", this.ActionWhat, who, when);
return string.Format("{0}{1}{2}", this.DeleteStatus == 0 ? "Changed" : "Deleted", who, when); return string.Format("{0}{1}{2}", this.DeleteStatus == 0 ? "Changed" : "Deleted", who, when);
} }
public override string ToString()
{
string itemTitle = Regex.Replace(this.MyItemInfo.SearchPath, "^..+?\\u0007", "");
itemTitle = itemTitle.Replace("\x11", itemTitle[0] == '\x11' ? "" : " - ").Replace("\\u8209?", "-");
return string.Format("{0} Annotation {1}", itemTitle, this.ListString());
}
} }
public partial class ContentAuditInfo public partial class ContentAuditInfo
@ -79,6 +86,14 @@ namespace VEPROMS.CSLA.Library
set { _Typename = value; } set { _Typename = value; }
} }
public override string ToString() public override string ToString()
{
string itemTitle = Regex.Replace(this.Path, "^..+?\\u0007", "");
itemTitle = itemTitle.Replace("\x11", itemTitle[0] == '\x11' ? "" : " - ").Replace("\\u8209?", "-");
return string.Format("{4} item {0} by {1} on {2} @ {3}", this.ActionWhat, this.UserID, this.ActionWhen == DateTime.MinValue ? this.DTS.ToShortDateString() : this.ActionWhen.ToShortDateString(), this.ActionWhen == DateTime.MinValue ? this.DTS.ToShortTimeString() : this.ActionWhen.ToShortTimeString(), itemTitle);
//return string.Format("{0} by {1} on {2}", this.DeleteStatus == 0 ? "Changed" : "Deleted", this.UserID, this.DTS.ToString("MM/dd/yyyy @ HH:mm:ss"));
//return string.Format("{0} - {1} {2}", this.UserID, this.DTS, this.DeleteStatus == 0 ? "" : "Deleted");
}
public string ListString()
{ {
string who = string.Empty; string who = string.Empty;
string when = string.Empty; string when = string.Empty;
@ -87,10 +102,7 @@ namespace VEPROMS.CSLA.Library
if (this.DTS != DateTime.Parse("1/1/1980")) if (this.DTS != DateTime.Parse("1/1/1980"))
when = string.Format(" on {0}", this.DTS.ToString("MM/dd/yyyy @ HH:mm:ss")); when = string.Format(" on {0}", this.DTS.ToString("MM/dd/yyyy @ HH:mm:ss"));
return string.Format("{0}{1}{2}", this.ActionWhat, who, when); return string.Format("{0}{1}{2}", this.ActionWhat, who, when);
//return string.Format("{0} by {1} on {2}", this.DeleteStatus == 0 ? "Changed" : "Deleted", this.UserID, this.DTS.ToString("MM/dd/yyyy @ HH:mm:ss"));
//return string.Format("{0} - {1} {2}", this.UserID, this.DTS, this.DeleteStatus == 0 ? "" : "Deleted");
} }
} }
public partial class DocumentAuditInfo public partial class DocumentAuditInfo

View File

@ -1666,6 +1666,8 @@ namespace VEPROMS.CSLA.Library
get get
{ {
if (MyContent.MyEntry == null) if (MyContent.MyEntry == null)
if(DisplayNumber == string.Empty)
return DisplayText.Replace("\u2011", "-").Split(" ,.;:-_".ToCharArray())[0] + "...";
return DisplayNumber.Replace("\u2011","-"); return DisplayNumber.Replace("\u2011","-");
if (MyContent.Number != "") if (MyContent.Number != "")
return ((MyContent.MyEntry.MyDocument.LibTitle ?? "") == "" ? "" : "\u1D38\u1D35\u1D2E ") + DisplayNumber; return ((MyContent.MyEntry.MyDocument.LibTitle ?? "") == "" ? "" : "\u1D38\u1D35\u1D2E ") + DisplayNumber;