Embedded images

This commit is contained in:
2016-10-17 14:25:30 +00:00
parent 187dd5be25
commit e689dc2ba0
20 changed files with 2298 additions and 463 deletions

View File

@@ -1771,6 +1771,28 @@ namespace VEPROMS.CSLA.Library
public partial class ContentInfo
{
public static ContentInfo RestoreImage(ImageAuditInfo iai)
{
try
{
using (Content ctmp = Content.Get(iai.ContentID))
{
ctmp.MyImage.FileName = iai.FileName;
ctmp.MyImage.Data = iai.Data;
ctmp.MyImage.Config = iai.Config;
ctmp.MyImage.DTS = DateTime.Now;
ctmp.MyImage.UserID = Volian.Base.Library.VlnSettings.UserID;
ctmp.DTS = DateTime.Now;
ImageInfo.Refresh(ctmp.MyImage);
ctmp.Save();
return ContentInfo.Get(iai.ContentID);
}
}
catch (Exception ex)
{
throw new DbCslaException("Error on ContentInfo.RestoreImage", ex);
}
}
public static ContentInfo RestoreContent(ContentAuditInfo cai,ROFstInfo myRoFst)
{
try

View File

@@ -2219,6 +2219,11 @@ namespace VEPROMS.CSLA.Library
//string number = cont.Number;
string number = DisplayNumber;
//if (cont.Type >= 20000) number = Ordinal.ToString() + ".";
if ((cont.Type == 20036 || cont.Type == 20037 || cont.Type == 20038 || cont.Type == 20039))// && !RO
{
if (MyContent.ContentRoUsages == null || MyContent.ContentRoUsages.Count == 0)
return "Embedded Image";
}
if (cont.Type >= 20000) number = MyTab == null ? "" : MyTab.CleanText;
return string.Format("{0} {1}", number, DisplayText).Trim(); // Need TrimEnd(); for IP3
//return string.Format("{0} {1}", number, cont.Text).Trim();