C2020-036 Added list of duplicate procedure numbers to warning message box when doing approvals
This commit is contained in:
parent
d8f41f3dcb
commit
7ca3f6ae0a
@ -25,8 +25,8 @@ namespace VEPROMS
|
|||||||
}
|
}
|
||||||
private bool CanApprove
|
private bool CanApprove
|
||||||
{
|
{
|
||||||
get { return btnApprove2.Enabled;}
|
get { return btnApprove2.Enabled; }
|
||||||
set
|
set
|
||||||
{
|
{
|
||||||
btnApprove2.Enabled = value;
|
btnApprove2.Enabled = value;
|
||||||
tsslStatus.ForeColor = Color.Red;
|
tsslStatus.ForeColor = Color.Red;
|
||||||
@ -44,8 +44,8 @@ namespace VEPROMS
|
|||||||
public SessionInfo MySessionInfo
|
public SessionInfo MySessionInfo
|
||||||
{
|
{
|
||||||
get { return _MySessionInfo; }
|
get { return _MySessionInfo; }
|
||||||
set
|
set
|
||||||
{
|
{
|
||||||
_MySessionInfo = value;
|
_MySessionInfo = value;
|
||||||
_MyApproval.MySessionInfo = _MySessionInfo;
|
_MyApproval.MySessionInfo = _MySessionInfo;
|
||||||
}
|
}
|
||||||
@ -103,19 +103,19 @@ namespace VEPROMS
|
|||||||
void fgProcs_MouseUp(object sender, MouseEventArgs e)
|
void fgProcs_MouseUp(object sender, MouseEventArgs e)
|
||||||
{
|
{
|
||||||
C1.Win.C1FlexGrid.HitTestInfo hti = fgProcs.HitTest(e.X, e.Y);
|
C1.Win.C1FlexGrid.HitTestInfo hti = fgProcs.HitTest(e.X, e.Y);
|
||||||
Console.WriteLine("fgProcs_MouseUp X={0},Y={1},Row={2},Col={3}", e.X, e.Y, hti.Row, hti.Column);
|
//Console.WriteLine("fgProcs_MouseUp X={0},Y={1},Row={2},Col={3}", e.X, e.Y, hti.Row, hti.Column);
|
||||||
}
|
}
|
||||||
|
|
||||||
void fgProcs_MouseDown(object sender, MouseEventArgs e)
|
void fgProcs_MouseDown(object sender, MouseEventArgs e)
|
||||||
{
|
{
|
||||||
C1.Win.C1FlexGrid.HitTestInfo hti = fgProcs.HitTest(e.X, e.Y);
|
C1.Win.C1FlexGrid.HitTestInfo hti = fgProcs.HitTest(e.X, e.Y);
|
||||||
Console.WriteLine("fgProcs_MouseDown X={0},Y={1},Row={2},Col={3}", e.X, e.Y,hti.Row,hti.Column);
|
//Console.WriteLine("fgProcs_MouseDown X={0},Y={1},Row={2},Col={3}", e.X, e.Y, hti.Row, hti.Column);
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
void fgProcs_ComboCloseUp(object sender, C1.Win.C1FlexGrid.RowColEventArgs e)
|
void fgProcs_ComboCloseUp(object sender, C1.Win.C1FlexGrid.RowColEventArgs e)
|
||||||
{
|
{
|
||||||
Console.WriteLine("fgProcs_ComboCloseUp e.row={0}, fgprocs.mouserow={1}", e.Row, fgProcs.MouseRow);
|
//Console.WriteLine("fgProcs_ComboCloseUp e.row={0}, fgprocs.mouserow={1}", e.Row, fgProcs.MouseRow);
|
||||||
if (e.Row == fgProcs.MouseRow)
|
if (e.Row == fgProcs.MouseRow)
|
||||||
return;
|
return;
|
||||||
fgProcs_AfterEdit(sender, e);
|
fgProcs_AfterEdit(sender, e);
|
||||||
@ -124,7 +124,7 @@ namespace VEPROMS
|
|||||||
|
|
||||||
void fgProcs_ValidateEdit(object sender, C1.Win.C1FlexGrid.ValidateEditEventArgs e)
|
void fgProcs_ValidateEdit(object sender, C1.Win.C1FlexGrid.ValidateEditEventArgs e)
|
||||||
{
|
{
|
||||||
Console.WriteLine("fgProcs_ValidateEdit");
|
//Console.WriteLine("fgProcs_ValidateEdit");
|
||||||
}
|
}
|
||||||
|
|
||||||
void fgProcs_StartEdit(object sender, C1.Win.C1FlexGrid.RowColEventArgs e)
|
void fgProcs_StartEdit(object sender, C1.Win.C1FlexGrid.RowColEventArgs e)
|
||||||
@ -135,12 +135,12 @@ namespace VEPROMS
|
|||||||
if (dt != null)
|
if (dt != null)
|
||||||
dt = dt.AddHours(1);
|
dt = dt.AddHours(1);
|
||||||
fgProcs[e.Row, e.Col] = dt;
|
fgProcs[e.Row, e.Col] = dt;
|
||||||
Console.WriteLine("fgProcs_StartEdit val: {0}, dt: {1}",val,dt);
|
//Console.WriteLine("fgProcs_StartEdit val: {0}, dt: {1}", val, dt);
|
||||||
}
|
}
|
||||||
|
|
||||||
void fgProcs_SetupEditor(object sender, C1.Win.C1FlexGrid.RowColEventArgs e)
|
void fgProcs_SetupEditor(object sender, C1.Win.C1FlexGrid.RowColEventArgs e)
|
||||||
{
|
{
|
||||||
Console.WriteLine("fgProcs_SetupEditor");
|
//Console.WriteLine("fgProcs_SetupEditor");
|
||||||
}
|
}
|
||||||
|
|
||||||
void fgProcs_LeaveEdit(object sender, C1.Win.C1FlexGrid.RowColEventArgs e)
|
void fgProcs_LeaveEdit(object sender, C1.Win.C1FlexGrid.RowColEventArgs e)
|
||||||
@ -150,28 +150,49 @@ namespace VEPROMS
|
|||||||
if (dt != null && dt.Hour != 0)
|
if (dt != null && dt.Hour != 0)
|
||||||
dt = dt.AddHours(-1);
|
dt = dt.AddHours(-1);
|
||||||
fgProcs[e.Row, e.Col] = dt;
|
fgProcs[e.Row, e.Col] = dt;
|
||||||
Console.WriteLine("fgProcs_LeaveEdit val: {0}, dt: {1}, mouserow={2}, mousecol={3}", val, dt,fgProcs.MouseRow,fgProcs.MouseCol);
|
//Console.WriteLine("fgProcs_LeaveEdit val: {0}, dt: {1}, mouserow={2}, mousecol={3}", val, dt, fgProcs.MouseRow, fgProcs.MouseCol);
|
||||||
}
|
}
|
||||||
|
|
||||||
void fgProcs_ImeModeChanged(object sender, EventArgs e)
|
void fgProcs_ImeModeChanged(object sender, EventArgs e)
|
||||||
{
|
{
|
||||||
Console.WriteLine("fgProcs_ImeModeChanged");
|
//Console.WriteLine("fgProcs_ImeModeChanged");
|
||||||
}
|
}
|
||||||
|
|
||||||
void fgProcs_ChangeEdit(object sender, EventArgs e)
|
void fgProcs_ChangeEdit(object sender, EventArgs e)
|
||||||
{
|
{
|
||||||
Console.WriteLine("fgProcs_ChangeEdit");
|
//Console.WriteLine("fgProcs_ChangeEdit");
|
||||||
}
|
}
|
||||||
|
//C2020-036 returns a string of duplicate procedure numbers separated by newlines for use in FlexibleMessageBox
|
||||||
|
private string dupProcList
|
||||||
|
{
|
||||||
|
get
|
||||||
|
{
|
||||||
|
string rtn = "";
|
||||||
|
if (dpl.Count > 0)
|
||||||
|
{
|
||||||
|
foreach (string pn in dpl)
|
||||||
|
rtn += pn + "\n";
|
||||||
|
rtn = rtn.TrimEnd('\n');
|
||||||
|
}
|
||||||
|
return rtn;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
private List<string> dpl = new List<string>(); //C2020-036 used to create list duplicate procedure numbers
|
||||||
|
|
||||||
private bool InitializePanelSelect()
|
private bool InitializePanelSelect()
|
||||||
{
|
{
|
||||||
if (clbMore.Items.Count == 0)
|
if (clbMore.Items.Count == 0)
|
||||||
{
|
{
|
||||||
|
dpl.Clear();
|
||||||
foreach (ProcedureInfo pi in _MyDocVersion.Procedures)
|
foreach (ProcedureInfo pi in _MyDocVersion.Procedures)
|
||||||
{
|
{
|
||||||
OwnerInfo oi = OwnerInfo.GetByItemID(pi.ItemID, CheckOutType.Procedure);
|
OwnerInfo oi = OwnerInfo.GetByItemID(pi.ItemID, CheckOutType.Procedure);
|
||||||
pi.MyDocVersion.DocVersionConfig.SelectedSlave = _MyDocVersion.DocVersionConfig.SelectedSlave;
|
pi.MyDocVersion.DocVersionConfig.SelectedSlave = _MyDocVersion.DocVersionConfig.SelectedSlave;
|
||||||
if (clbMore.Items.Contains(pi.DisplayNumber)) return false; // C2018-025 cannot load list of procedure - duplicate proc numbers
|
if (clbMore.Items.Contains(pi.DisplayNumber))
|
||||||
|
{
|
||||||
|
if (!dpl.Contains(pi.DisplayNumber)) dpl.Add(pi.DisplayNumber); //C2020-036 add to duplicate proc number list
|
||||||
|
continue;
|
||||||
|
}
|
||||||
// B2018-083: check for null MySessionInfo.
|
// B2018-083: check for null MySessionInfo.
|
||||||
if (oi != null && MySessionInfo != null && oi.SessionID != MySessionInfo.SessionID)
|
if (oi != null && MySessionInfo != null && oi.SessionID != MySessionInfo.SessionID)
|
||||||
{
|
{
|
||||||
@ -183,9 +204,10 @@ namespace VEPROMS
|
|||||||
tmpProcedures.Add(pi.DisplayNumber, pi);
|
tmpProcedures.Add(pi.DisplayNumber, pi);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
if (dpl.Count > 0) return false; // C2018-025 cannot load list of procedure - duplicate proc numbers
|
||||||
for (int i = 0; i < clbMore.Items.Count; i++)
|
for (int i = 0; i < clbMore.Items.Count; i++)
|
||||||
{
|
{
|
||||||
ProcedureInfo pi = GetProcedureInfoByKey(clbMore.Items[i].ToString());
|
ProcedureInfo pi = GetProcedureInfoByKey(clbMore.Items[i].ToString());
|
||||||
clbMore.SetItemChecked(i, _MyApproval.ProcedureExists(pi));
|
clbMore.SetItemChecked(i, _MyApproval.ProcedureExists(pi));
|
||||||
}
|
}
|
||||||
lblMore.Text = string.Format("{0} Procedures, {1} Selected", clbMore.Items.Count, clbMore.CheckedItems.Count);
|
lblMore.Text = string.Format("{0} Procedures, {1} Selected", clbMore.Items.Count, clbMore.CheckedItems.Count);
|
||||||
@ -262,9 +284,11 @@ namespace VEPROMS
|
|||||||
if (!InitializePanelSelect()) //C2018-025 if there are duplicate proc numbers disable the Procedure List panel and display an message - this only needed with approving an indivial procedure from the tree
|
if (!InitializePanelSelect()) //C2018-025 if there are duplicate proc numbers disable the Procedure List panel and display an message - this only needed with approving an indivial procedure from the tree
|
||||||
{
|
{
|
||||||
expAddProcConChk.Enabled = false;
|
expAddProcConChk.Enabled = false;
|
||||||
MessageBox.Show("This procedure set has two or more procedures with the same procedure number.\n\n" +
|
//C2020-036 display a list of the duplicate procedure numbers along with the warning message
|
||||||
|
FlexibleMessageBox.Show("This procedure set has two or more procedures with the same procedure number.\n\n" +
|
||||||
"The Procedure List panel has been disabled.\n\n" +
|
"The Procedure List panel has been disabled.\n\n" +
|
||||||
"A Consistency Check cannot be done and the list of procedures in the set cannot be displayed.", "Approve Procedure",MessageBoxButtons.OK,MessageBoxIcon.Warning);
|
"A Consistency Check cannot be done and the list of procedures in the set cannot be displayed.\n\n" +
|
||||||
|
"Below is a list of the dupicate procedure numbers:\n\n" + dupProcList, "Approve Procedure", MessageBoxButtons.OK, MessageBoxIcon.Warning);
|
||||||
}
|
}
|
||||||
_initializing = false;
|
_initializing = false;
|
||||||
}
|
}
|
||||||
|
@ -19,6 +19,7 @@ using Volian.Controls.Library;
|
|||||||
using DescriptiveEnum;
|
using DescriptiveEnum;
|
||||||
using Volian.Base.Library;
|
using Volian.Base.Library;
|
||||||
using Volian.Print.Library;
|
using Volian.Print.Library;
|
||||||
|
using JR.Utils.GUI.Forms;
|
||||||
|
|
||||||
[assembly: log4net.Config.XmlConfigurator(Watch = true)]
|
[assembly: log4net.Config.XmlConfigurator(Watch = true)]
|
||||||
|
|
||||||
@ -728,10 +729,30 @@ namespace VEPROMS
|
|||||||
rpt.BuildAllReport(dvi);
|
rpt.BuildAllReport(dvi);
|
||||||
this.Cursor = Cursors.Default;
|
this.Cursor = Cursors.Default;
|
||||||
}
|
}
|
||||||
|
//C2020-036 returns a string of duplicate procedure numbers separated by newlines for use in FlexibleMessageBox
|
||||||
|
private string dupProcList
|
||||||
|
{
|
||||||
|
get
|
||||||
|
{
|
||||||
|
string rtn = "";
|
||||||
|
if (dpl.Count > 0)
|
||||||
|
{
|
||||||
|
foreach (string pn in dpl)
|
||||||
|
rtn += pn + "\n";
|
||||||
|
rtn = rtn.TrimEnd('\n');
|
||||||
|
}
|
||||||
|
return rtn;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
private List<string> dpl = new List<string>(); //C2020-036 used to create list duplicate procedure numbers
|
||||||
|
|
||||||
// B2017-242 added check for duplicate procedure numbers in a procedure set
|
// B2017-242 added check for duplicate procedure numbers in a procedure set
|
||||||
// This is called before doing any of the approval
|
// This is called before doing any of the approval
|
||||||
|
// C2020-036 return a string containing a list of duplicate procedure numbers
|
||||||
|
// this will be used in a FlexibleMessageBox when trying to run Approval
|
||||||
private bool DuplicateProcedureNumbers(DocVersionInfo dvi, ProcedureInfo pinfo)
|
private bool DuplicateProcedureNumbers(DocVersionInfo dvi, ProcedureInfo pinfo)
|
||||||
{
|
{
|
||||||
|
dpl.Clear();
|
||||||
List<string> pnList = new List<string>();
|
List<string> pnList = new List<string>();
|
||||||
foreach (ProcedureInfo pi in dvi.Procedures)
|
foreach (ProcedureInfo pi in dvi.Procedures)
|
||||||
{
|
{
|
||||||
@ -740,12 +761,22 @@ namespace VEPROMS
|
|||||||
else if (pinfo != null)
|
else if (pinfo != null)
|
||||||
{
|
{
|
||||||
if (pinfo.DisplayNumber == pi.DisplayNumber)
|
if (pinfo.DisplayNumber == pi.DisplayNumber)
|
||||||
return true;
|
{
|
||||||
|
// In this case, we selected to approve a specific procedure from the tree view.
|
||||||
|
// Clear the list of found duplicate proc numbers thus far and add just this one - for use in messagebox
|
||||||
|
dpl.Clear();
|
||||||
|
dpl.Add(pi.DisplayNumber);
|
||||||
|
break; // C2020-036 break out of loop and return just the specific duplicate procedure number
|
||||||
|
}
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
return true;
|
{
|
||||||
|
// C2020-036 Append to the list of duplicate procedure numbers
|
||||||
|
// In this case we are approving All or Some procedures from tree view
|
||||||
|
if (!dpl.Contains(pi.DisplayNumber)) dpl.Add(pi.DisplayNumber);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
return false;
|
return dpl.Count > 0;
|
||||||
}
|
}
|
||||||
void tv_ApproveSomeProcedures(object sender, vlnTreeEventArgs args)
|
void tv_ApproveSomeProcedures(object sender, vlnTreeEventArgs args)
|
||||||
{
|
{
|
||||||
@ -754,8 +785,10 @@ namespace VEPROMS
|
|||||||
// B2017-242 added check for duplicate procedure numbers in a procedure set
|
// B2017-242 added check for duplicate procedure numbers in a procedure set
|
||||||
if (DuplicateProcedureNumbers(dvi, null))
|
if (DuplicateProcedureNumbers(dvi, null))
|
||||||
{
|
{
|
||||||
MessageBox.Show("This procedure set has two or more procedures with the same procedure number.\n\n" +
|
// C2020-036 display list of duplicate procedure numbers
|
||||||
"Please make each procedure number unique before approving.", "Approve Some Procedures");
|
FlexibleMessageBox.Show("This procedure set has two or more procedures with the same procedure number.\n\n" +
|
||||||
|
"Please make each procedure number unique before approving.\n\n"+
|
||||||
|
"Below is a list of the dupicate procedure numbers:\n\n" +dupProcList, "Approve Some Procedures", MessageBoxButtons.OK, MessageBoxIcon.Warning);
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
tc.SaveCurrentEditItem();
|
tc.SaveCurrentEditItem();
|
||||||
@ -782,8 +815,10 @@ namespace VEPROMS
|
|||||||
// B2017-242 added check for duplicate procedure numbers in a procedure set
|
// B2017-242 added check for duplicate procedure numbers in a procedure set
|
||||||
if (DuplicateProcedureNumbers(dvi, null))
|
if (DuplicateProcedureNumbers(dvi, null))
|
||||||
{
|
{
|
||||||
MessageBox.Show("This procedure set has two or more procedures with the same procedure number.\n\n" +
|
// C2020-036 display list of duplicate procedure numbers
|
||||||
"Please make each procedure number unique before approving.", "Approve All Procedures");
|
FlexibleMessageBox.Show("This procedure set has two or more procedures with the same procedure number.\n\n" +
|
||||||
|
"Please make each procedure number unique before approving.\n\n"+
|
||||||
|
"Below is a list of the dupicate procedure numbers:\n\n" + dupProcList, "Approve All Procedures", MessageBoxButtons.OK, MessageBoxIcon.Warning);
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
tc.SaveCurrentEditItem();
|
tc.SaveCurrentEditItem();
|
||||||
@ -866,8 +901,9 @@ namespace VEPROMS
|
|||||||
// B2017-242 added check for duplicate procedure numbers in a procedure set
|
// B2017-242 added check for duplicate procedure numbers in a procedure set
|
||||||
if (DuplicateProcedureNumbers(pi.MyDocVersion, pi))
|
if (DuplicateProcedureNumbers(pi.MyDocVersion, pi))
|
||||||
{
|
{
|
||||||
MessageBox.Show("There is another procedure in this set with the same procedure number.\n\n" +
|
// C2020-036 display list of duplicate procedure numbers
|
||||||
"Please make each procedure number unique before approving.", "Approve Procedure");
|
FlexibleMessageBox.Show("Procedure number " + dupProcList + " is used by two or more procedures within this procedure set.\n\n" +
|
||||||
|
"Please make each procedure number unique before approving.", "Approve Procedure", MessageBoxButtons.OK, MessageBoxIcon.Warning);
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
tc.SaveCurrentEditItem(pi);
|
tc.SaveCurrentEditItem(pi);
|
||||||
@ -2212,7 +2248,7 @@ namespace VEPROMS
|
|||||||
- Harrys PC- Harry-7100
|
- Harrys PC- Harry-7100
|
||||||
- Caitlin- Caitlin-PC
|
- Caitlin- Caitlin-PC
|
||||||
*/
|
*/
|
||||||
if ("|VOLIAN0|JCB2-HP|BODINE-64|WINDOWS7-RHM|PAUL-PC|MICHELLE-PC|WIN-O4QLPEH7JKH|HARRY-7100|CAITLIN-PC|".Contains("|" + Environment.UserDomainName.ToUpper() + "|"))
|
if ("|VLN|VOLIAN0|JCB2-HP|BODINE-64|WINDOWS7-RHM|PAUL-PC|MICHELLE-PC|WIN-O4QLPEH7JKH|HARRY-7100|CAITLIN-PC|".Contains("|" + Environment.UserDomainName.ToUpper() + "|"))
|
||||||
{
|
{
|
||||||
Random rnd = new Random(DateTime.Now.Year + DateTime.Now.DayOfYear * 1000);
|
Random rnd = new Random(DateTime.Now.Year + DateTime.Now.DayOfYear * 1000);
|
||||||
MessageBox.Show(this, GetSecurityKey(), "Today's Security Key");
|
MessageBox.Show(this, GetSecurityKey(), "Today's Security Key");
|
||||||
|
Loading…
x
Reference in New Issue
Block a user