case 3759

This commit is contained in:
2020-05-08 20:40:49 +00:00
parent 85b0379175
commit 4f6f383cef

View File

@@ -162,8 +162,18 @@ namespace GZTW.AyaNova.BLL
//bugbug - not removing old filters before adding new filter case 770 //bugbug - not removing old filters before adding new filter case 770
set set
{ {
if (!value.Contains("<WHEREITEMGROUP") || !value.Contains("</WHEREITEMGROUP")) //wait, this could be an issue, below it seems to anticipate this would be a normal condition
new System.ApplicationException("UIUserGridLastView->SubstituteCriteria: Error value must contain open and closing WHEREITEMGROUP tags"); //I'm going to leave this out for now, prior attempt didn't actually "throw" it so it would have been benign
//if (!value.Contains("<WHEREITEMGROUP") || !value.Contains("</WHEREITEMGROUP"))
// throw new System.ApplicationException(
// "UIUserGridLastView->SubstituteCriteria: Error unexpected view xml (missing WHEREITEMGROUP tags)\r\n" +
// "ViewXML:\r\n"+
// mViewXML+
// "Substitute XML:\r\n"+
// value +
// "\r\nGridKey:"+this.GridKey + ", UserId: " + this.UserID +
// "\r\n---------eot-----"
// );//case 3759
int nStart = -1; int nStart = -1;
int nEnd = -1; int nEnd = -1;
@@ -180,8 +190,17 @@ namespace GZTW.AyaNova.BLL
nEnd = nEnd + 17;//length of </WHEREITEMGROUP> nEnd = nEnd + 17;//length of </WHEREITEMGROUP>
} }
//case 3759
if (nStart == -1 || nEnd == -1) if (nStart == -1 || nEnd == -1)
new System.ApplicationException("UIUserGridLastView->SubstituteCriteria: Error could not determine placement of inserted WHEREITEMGROUP tag in view xml:\r\n" + mViewXML); // throw new System.ApplicationException("UIUserGridLastView->SubstituteCriteria: Error could not determine placement of inserted WHEREITEMGROUP tag in view xml:\r\n" + mViewXML);
throw new System.ApplicationException("UIUserGridLastView->SubstituteCriteria: Error unexpected view xml\r\n" +
"ViewXML:\r\n" +
mViewXML +
"Substitute XML:\r\n" +
value +
"\r\nGridKey:" + this.GridKey + ", UserId: " + this.UserID +
"\r\n---------eot-----"
);
//BUGBUG: this line is throwing an exception for some users (adam tecnica uk) //BUGBUG: this line is throwing an exception for some users (adam tecnica uk)
//It needs to be wrapped in a try catch block or tested for sanity //It needs to be wrapped in a try catch block or tested for sanity
@@ -246,8 +265,27 @@ Parameter name: length
at System.Windows.Forms.Control.WndProc(Message& m) at System.Windows.Forms.Control.WndProc(Message& m)
at System.Windows.Forms.NativeWindow.Callback(IntPtr hWnd, Int32 msg, IntPtr wparam, IntPtr lparam) at System.Windows.Forms.NativeWindow.Callback(IntPtr hWnd, Int32 msg, IntPtr wparam, IntPtr lparam)
*/ */
mViewXML = mViewXML.Substring(0, nStart) + value + mViewXML.Substring(nEnd, mViewXML.Length-nEnd);
//case 3759 for above
int StartViewXMLLength = nStart;
int EndViewXMLLength = mViewXML.Length - nEnd;
if (StartViewXMLLength < 0 || EndViewXMLLength < 0)
throw new System.ApplicationException("UIUserGridLastView->SubstituteCriteria: Error bad view xml\r\n" +
"ViewXML:\r\n" +
mViewXML +
"Substitute XML:\r\n" +
value +
"\r\n=-=-=-=-=-+\r\nStartViewXMLLength:" + StartViewXMLLength.ToString() +
", EndViewXMLLength:" + EndViewXMLLength.ToString() +
"\r\nGridKey:" + this.GridKey + ", UserId: " + this.UserID +
"\r\n---------eot-----"
);
//originally before this case
//mViewXML = mViewXML.Substring(0, nStart) + value + mViewXML.Substring(nEnd, mViewXML.Length-nEnd);
mViewXML = mViewXML.Substring(0, StartViewXMLLength) + value + mViewXML.Substring(nEnd, EndViewXMLLength);
//reset //reset
MarkDirty(); MarkDirty();