Compare commits

...

7 Commits

4 changed files with 67 additions and 33 deletions

View File

@@ -145,6 +145,9 @@ namespace VEPROMS
} }
LoadRefreshGroupUsers(); LoadRefreshGroupUsers();
// C2026-004 - messagebox when create group
MessageBox.Show($"{txt} group successfully created.", "Create group", MessageBoxButtons.OK, MessageBoxIcon.Information);
} }
private void tvFolders_NodeMouseClick(object sender, TreeNodeMouseClickEventArgs e) private void tvFolders_NodeMouseClick(object sender, TreeNodeMouseClickEventArgs e)
{ {
@@ -186,6 +189,9 @@ namespace VEPROMS
//Add a Member to a Group //Add a Member to a Group
private void addMember_Click(object sender, EventArgs e) private void addMember_Click(object sender, EventArgs e)
{
// B2026-007 PROMS Security - don't error when add a user to a group but no group selected
if (lstNonMembers.SelectedValue != null)
{ {
int groupIndex = cbGroupSelection.SelectedIndex; int groupIndex = cbGroupSelection.SelectedIndex;
string selectedUserID = lstNonMembers.SelectedValue.ToString(); string selectedUserID = lstNonMembers.SelectedValue.ToString();
@@ -200,6 +206,7 @@ namespace VEPROMS
int index = lstMembers.FindString(selectedUserID); int index = lstMembers.FindString(selectedUserID);
lstMembers.SetSelected(index, true); lstMembers.SetSelected(index, true);
} }
}
//Remove a Member From a Group //Remove a Member From a Group
private void removeMember_Click(object sender, EventArgs e) private void removeMember_Click(object sender, EventArgs e)
@@ -326,6 +333,7 @@ namespace VEPROMS
User u = User.MakeUser("[Enter New UserID]", "", "", "", "", "", "", "", "", "", "", DateTime.Now, ""); User u = User.MakeUser("[Enter New UserID]", "", "", "", "", "", "", "", "", "", "", DateTime.Now, "");
frmManageUser frm = new frmManageUser("add"); frmManageUser frm = new frmManageUser("add");
frm.MyUser = u; frm.MyUser = u;
frm.Text = "Enter New UserID"; //C2026-002 Change Title bar on Add/Edit User
if (frm.ShowDialog(this) == DialogResult.OK) if (frm.ShowDialog(this) == DialogResult.OK)
{ {
u = frm.MyUser; u = frm.MyUser;

View File

@@ -20,7 +20,27 @@ namespace VEPROMS
_MyUser = value; _MyUser = value;
SimpleUser su = new SimpleUser(_MyUser); SimpleUser su = new SimpleUser(_MyUser);
pgUser.SelectedObject = su; pgUser.SelectedObject = su;
this.Text = string.Format("{0} ({1} {2}) Information",su.UserID,su.FirstName,su.LastName);
//C2026-002 Change Title bar on Add/Edit User
string tmp;
if (!string.IsNullOrEmpty(su.FirstName) && !string.IsNullOrEmpty(su.LastName))
{
tmp = $"{su.UserID} ({su.FirstName} {su.LastName}) Information";
}
else if (!string.IsNullOrEmpty(su.LastName))
{
tmp = $"{su.UserID} ({su.LastName}) Information";
}
else if (!string.IsNullOrEmpty(su.FirstName))
{
tmp = $"{su.UserID} ({su.FirstName}) Information";
}
else
{
tmp = $"{su.UserID} Information";
}
this.Text = tmp;
} }
} }
private string _Mode; private string _Mode;

View File

@@ -537,6 +537,10 @@ namespace Volian.Controls.Library
// if it is a modify and there will be no usages if it is new (the usage gets created on the save) // if it is a modify and there will be no usages if it is new (the usage gets created on the save)
if (!MyFlexGrid.IsRoTable) if (!MyFlexGrid.IsRoTable)
{ {
// B2026-003 we where using a string.format on this inside the while loop - allocating memory each time
// so I move it outside the while loop and did a simple assigment of text
string lookForLinks = @"<START\](\\[^v \\]+)*\\v0(\\[^v '?{{}}~\\]+)*( |\\u[0-9]{{1,4}}?|\\'[0-9a-fA-F]{{2}}|\\[{{}}~])(.*?)(\\[^v '?{{}}~\\]+)*\\v(\\[^v \\]+)* #Link:(ReferencedObject|Transition[^:]*?):.*?\[END>";
while (r < h) while (r < h)
{ {
CellRange cr = MyFlexGrid.GetMergedRange(r, c); CellRange cr = MyFlexGrid.GetMergedRange(r, c);
@@ -546,8 +550,7 @@ namespace Volian.Controls.Library
{ {
// see if there are any links and save these so that any deleted ROs or transitions in the // see if there are any links and save these so that any deleted ROs or transitions in the
// steprtb can have associated usages/transitions records removed from the database. // steprtb can have associated usages/transitions records removed from the database.
string lookFor = string.Format(@"<START\](\\[^v \\]+)*\\v0(\\[^v '?{{}}~\\]+)*( |\\u[0-9]{{1,4}}?|\\'[0-9a-fA-F]{{2}}|\\[{{}}~])(.*?)(\\[^v '?{{}}~\\]+)*\\v(\\[^v \\]+)* #Link:(ReferencedObject|Transition[^:]*?):.*?\[END>"); MatchCollection matches = Regex.Matches((string)MyFlexGrid[r, c], lookForLinks);
MatchCollection matches = Regex.Matches((string)MyFlexGrid[r, c], lookFor);
for (int i = matches.Count - 1; i >= 0; i--) for (int i = matches.Count - 1; i >= 0; i--)
{ {
Match m = matches[i]; Match m = matches[i];

View File

@@ -272,10 +272,12 @@ namespace Volian.Controls.Library
for (int i = 0; i < rows * cols; i++) for (int i = 0; i < rows * cols; i++)
datum.Add("|"); datum.Add("|");
XmlNodeList nl = xd.SelectNodes("C1FlexGrid/Cells/Cell/Data"); XmlNodeList nl = xd.SelectNodes("C1FlexGrid/Cells/Cell/Data");
string data = string.Empty; // B2026-003 use StringBuilder a "using" statement around the RichTextBox for better mememory management
StringBuilder data = new StringBuilder();
foreach (XmlNode xn in nl) foreach (XmlNode xn in nl)
{ {
RichTextBox rtb = new RichTextBox(); using (RichTextBox rtb = new RichTextBox())
{
rtb.Rtf = xn.InnerText; rtb.Rtf = xn.InnerText;
XmlAttribute xa = xn.ParentNode.Attributes.GetNamedItem("index") as XmlAttribute; XmlAttribute xa = xn.ParentNode.Attributes.GetNamedItem("index") as XmlAttribute;
string[] rc = xa.InnerText.Split(','); string[] rc = xa.InnerText.Split(',');
@@ -284,9 +286,10 @@ namespace Volian.Controls.Library
int index = r * cols + c; int index = r * cols + c;
datum[index] = "|" + (rtb.Text == "" ? "" : rtb.Text); datum[index] = "|" + (rtb.Text == "" ? "" : rtb.Text);
} }
}
foreach (string s in datum) foreach (string s in datum)
data += s; data.Append(s);
return data; return data.ToString();
} }
private string GetCellFormatString(XmlDocument xd) private string GetCellFormatString(XmlDocument xd)
{ {