B2020-003: Cannot add New groups in roeditor when using sql

This commit is contained in:
Kathy Ruffing 2020-01-15 15:57:19 +00:00
parent 0a52d39a6a
commit c81c98ab80

View File

@ -167,6 +167,7 @@ namespace RODBInterface
using (SqlConnection cn = ROAPP_SqlConnection) using (SqlConnection cn = ROAPP_SqlConnection)
{ {
SqlCommand command = new SqlCommand(); SqlCommand command = new SqlCommand();
command.Connection = cn; // B2020-003: missing command connection.
command.CommandType = CommandType.StoredProcedure; command.CommandType = CommandType.StoredProcedure;
command.CommandText = "getInfobyRecidRectype"; command.CommandText = "getInfobyRecidRectype";
command.Parameters.AddWithValue("@ROTable", "ROMASTER"); command.Parameters.AddWithValue("@ROTable", "ROMASTER");
@ -761,7 +762,7 @@ namespace RODBInterface
command.Parameters.AddWithValue("@RecID", group.GetAttribute("RecID")); command.Parameters.AddWithValue("@RecID", group.GetAttribute("RecID"));
command.Parameters.AddWithValue("@RecType", (int)RecordType.Group); command.Parameters.AddWithValue("@RecType", (int)RecordType.Group);
command.Parameters.AddWithValue("@ParentID", group.GetAttribute("ParentID")); command.Parameters.AddWithValue("@ParentID", group.GetAttribute("ParentID"));
command.Parameters.AddWithValue("@AccPageID", null); command.Parameters.AddWithValue("@AccPageID", ""); // B2020-003: make null empty string.
command.Parameters.AddWithValue("@Info", xmlstr); command.Parameters.AddWithValue("@Info", xmlstr);
command.Parameters.AddWithValue("@ModDateTime", dt); command.Parameters.AddWithValue("@ModDateTime", dt);
@ -798,7 +799,7 @@ namespace RODBInterface
command.Parameters.AddWithValue("@RecID", "00000000"); command.Parameters.AddWithValue("@RecID", "00000000");
command.Parameters.AddWithValue("@RecType", 0); command.Parameters.AddWithValue("@RecType", 0);
command.Parameters.AddWithValue("@ParentID", "00000000"); command.Parameters.AddWithValue("@ParentID", "00000000");
command.Parameters.AddWithValue("@AccPageID", null); command.Parameters.AddWithValue("@AccPageID", ""); // B2020-003: make null empty string.
command.Parameters.AddWithValue("@Info", "00000001"); command.Parameters.AddWithValue("@Info", "00000001");
command.Parameters.AddWithValue("@ModDateTime", dt); command.Parameters.AddWithValue("@ModDateTime", dt);
@ -833,7 +834,7 @@ namespace RODBInterface
command.Parameters.AddWithValue("@RecID", recid); command.Parameters.AddWithValue("@RecID", recid);
command.Parameters.AddWithValue("@RecType", 1); command.Parameters.AddWithValue("@RecType", 1);
command.Parameters.AddWithValue("@ParentID", "00000001"); command.Parameters.AddWithValue("@ParentID", "00000001");
command.Parameters.AddWithValue("@AccPageID", null); command.Parameters.AddWithValue("@AccPageID", ""); // B2020-003: make null empty string.
command.Parameters.AddWithValue("@Info", info); command.Parameters.AddWithValue("@Info", info);
command.Parameters.AddWithValue("@ModDateTime", dt); command.Parameters.AddWithValue("@ModDateTime", dt);
@ -1586,7 +1587,7 @@ namespace RODBInterface
command.Parameters.AddWithValue("@ROTable", ro.GetAttribute("Table")); command.Parameters.AddWithValue("@ROTable", ro.GetAttribute("Table"));
command.Parameters.AddWithValue("@Info", xmlstr); command.Parameters.AddWithValue("@Info", xmlstr);
command.Parameters.AddWithValue("@ModDateTime", dt); command.Parameters.AddWithValue("@ModDateTime", dt);
command.Parameters.AddWithValue("@AccPageID", dt); command.Parameters.AddWithValue("@AccPageID", wraccid); // B2020-003: set accpageid to correct value
command.Parameters.AddWithValue("@RecID", ro.GetAttribute("RecID")); command.Parameters.AddWithValue("@RecID", ro.GetAttribute("RecID"));
using (SqlDataReader reader = command.ExecuteReader()) using (SqlDataReader reader = command.ExecuteReader())
{ {
@ -1649,7 +1650,7 @@ namespace RODBInterface
else else
{ {
command.Parameters.AddWithValue("@RecType", (int)RecordType.Group); command.Parameters.AddWithValue("@RecType", (int)RecordType.Group);
command.Parameters.AddWithValue("@AccPageID", null); command.Parameters.AddWithValue("@AccPageID", ""); // B2020-003: set accpageid to correct value
} }
} }
else else
@ -1938,7 +1939,7 @@ namespace RODBInterface
command.Parameters.AddWithValue("@RecID", recid); command.Parameters.AddWithValue("@RecID", recid);
command.Parameters.AddWithValue("@RecType", 2); command.Parameters.AddWithValue("@RecType", 2);
command.Parameters.AddWithValue("@ParentID", parentid); command.Parameters.AddWithValue("@ParentID", parentid);
command.Parameters.AddWithValue("@AccPageID", null); command.Parameters.AddWithValue("@AccPageID", ""); // B2020-003: set accpageid to correct value
command.Parameters.AddWithValue("@Info", schpiece.Replace("\'", "'")); command.Parameters.AddWithValue("@Info", schpiece.Replace("\'", "'"));
command.Parameters.AddWithValue("@ModDateTime", dt); command.Parameters.AddWithValue("@ModDateTime", dt);