C2019-026 Compare the library document we are importing with one of same name in current database to see if we can use the exiting instead of creating a new one.

C2019-026 Move a byte array comparer function to the Volian.Base.Libary and made it static
C2019-026 Took a byte array comparer function from ROFSTExt.cs and made it static
This commit is contained in:
2019-06-14 16:31:10 +00:00
parent fa61b9c2a4
commit a0dadf2f9a
3 changed files with 40 additions and 14 deletions

View File

@@ -982,9 +982,9 @@ namespace VEPROMS.CSLA.Library
int size = Convert.ToInt32(roicfg.Image_Size);
byte[] tmpb = ROImageInfo.Decompress(roii.Content, size);
if (ByteArrayCompare(roii.Content, cmpFileContents))
if (ByteArrayCompare.DoCompare(roii.Content, cmpFileContents))
return imgId;
if (ByteArrayCompare(tmpb, fileContents))
if (ByteArrayCompare.DoCompare(tmpb, fileContents))
return imgId;
}
}
@@ -993,14 +993,6 @@ namespace VEPROMS.CSLA.Library
return 0;
}
private bool ByteArrayCompare(byte[] ba1, byte[] ba2)
{
// we wrote our own byte array comparinson because the system's 'equals' did not work!
if (ba1.Length != ba2.Length) return false;
for (int i = 0; i < ba1.Length; i++)
if (ba1[i] != ba2[i]) return false;
return true;
}
private ROImageInfo GetMyImage(Dictionary<string, ROImageInfo> myImages, string imgname, DateTime dts)
{