C2023-002: When using RO Update Values feature, display message when other users are in Proms and don’t do update
This commit is contained in:
parent
7be346b6c8
commit
3661876626
@ -201,6 +201,7 @@ namespace VEPROMS
|
||||
private void UpdateROValues()
|
||||
{
|
||||
this.Cursor = Cursors.WaitCursor;
|
||||
List<ProcedureInfo> pil = new List<ProcedureInfo>(); // C2023-002: list of checked out procedures, used in frmBatchRefreshCheckedOut dialog
|
||||
List<DocVersionInfo> dvil = new List<DocVersionInfo>();
|
||||
foreach (TreeNode tn in myDocVersions.Keys)
|
||||
if (tn.Checked)
|
||||
@ -214,7 +215,8 @@ namespace VEPROMS
|
||||
pbProcess.Minimum = 0;
|
||||
pbProcess.Maximum = dvil.Count;
|
||||
pbProcess.Step = 1;
|
||||
while (dvil.Count > 0)
|
||||
bool cancelledOut = false; // C2023-002: flags cancel out of frmBatchRefreshCheckedOut so that looping can end
|
||||
while (dvil.Count > 0 && !cancelledOut)
|
||||
{
|
||||
StringBuilder sbDocVersions = new StringBuilder();
|
||||
Queue<DocVersionInfo> dviq = new Queue<DocVersionInfo>();
|
||||
@ -231,6 +233,13 @@ namespace VEPROMS
|
||||
if (!MySessionInfo.CanCheckOutItem(dq.VersionID, CheckOutType.DocVersion, ref msg))
|
||||
{
|
||||
dvil.Add(dq);
|
||||
// C2023-002: Loop through the docversion's procedures to determine which cannot be open and add to
|
||||
// list. The frmBatchRefreshCheckedOut dialog operates on procedures, not docversions.
|
||||
string msgp = string.Empty;
|
||||
foreach (ProcedureInfo pi in dq.Procedures)
|
||||
{
|
||||
if (!MySessionInfo.CanCheckOutItem(pi.ItemID, CheckOutType.Procedure, ref msgp)) pil.Add(pi);
|
||||
}
|
||||
sbDocVersions.AppendLine(msg);
|
||||
}
|
||||
else
|
||||
@ -242,8 +251,7 @@ namespace VEPROMS
|
||||
Application.DoEvents();
|
||||
}
|
||||
}
|
||||
DateTime pEnd = DateTime.Now;
|
||||
txtProcess.AppendText(string.Format("Completed: {0} {1} Seconds Elapsed", pEnd.ToString("MM/dd/yyyy @ HH:mm"), TimeSpan.FromTicks(pEnd.Ticks - pStart.Ticks).TotalSeconds));
|
||||
|
||||
Application.DoEvents();
|
||||
// when processing more than one procedure set, display only one completed message after all are processed
|
||||
if (ROFstInfo.MessageList != null)
|
||||
@ -263,15 +271,29 @@ namespace VEPROMS
|
||||
sb.AppendLine("Once this is complete you can continue the process otherwise you may terminate the process immediately.");
|
||||
sb.AppendLine();
|
||||
sb.AppendLine("Have you requested the users to close the procedures and do you want to continue the process?");
|
||||
frmBatchRefreshCheckedOut frmCO = new frmBatchRefreshCheckedOut();
|
||||
frmBatchRefreshCheckedOut frmCO = new frmBatchRefreshCheckedOut(1);
|
||||
frmCO.MySessionInfo = MySessionInfo;
|
||||
//frmCO.CheckedOutProcedures = dvil;
|
||||
frmCO.CheckedOutProcedures = pil; // C2023-002: set list of checked out procedures
|
||||
frmCO.Location = new Point(Screen.PrimaryScreen.WorkingArea.Width - frmCO.Width, Screen.PrimaryScreen.WorkingArea.Height - frmCO.Height);
|
||||
frmCO.Show(this);
|
||||
while (!this.Visible)
|
||||
Application.DoEvents();
|
||||
// C2023-002: Allow close of dialog that has list of procedures that are checked out
|
||||
if (frmCO.ShowDialog(this) != DialogResult.Cancel)
|
||||
{
|
||||
while (!this.Visible)
|
||||
Application.DoEvents();
|
||||
}
|
||||
else
|
||||
cancelledOut = true;
|
||||
}
|
||||
}
|
||||
DateTime pEnd = DateTime.Now;
|
||||
// C2023-002: Message depending on whether ro.fst update is completed.
|
||||
if (!cancelledOut)
|
||||
txtProcess.AppendText(string.Format("Completed: {0} {1} Seconds Elapsed", pEnd.ToString("MM/dd/yyyy @ HH:mm"), TimeSpan.FromTicks(pEnd.Ticks - pStart.Ticks).TotalSeconds));
|
||||
else
|
||||
{
|
||||
txtProcess.AppendText(string.Format("Could Not Complete: {0} {1} Seconds Elapsed", pEnd.ToString("MM/dd/yyyy @ HH:mm"), TimeSpan.FromTicks(pEnd.Ticks - pStart.Ticks).TotalSeconds));
|
||||
pbProcess.Value = pbProcess.Maximum;
|
||||
}
|
||||
this.Cursor = Cursors.Default;
|
||||
}
|
||||
//C2022-028 check for Bad RO Links - we will check all of the RO links found in procedure step text
|
||||
@ -332,7 +354,7 @@ namespace VEPROMS
|
||||
|
||||
if (dvil.Count > 0)
|
||||
{
|
||||
frmBatchRefreshCheckedOut frmCO = new frmBatchRefreshCheckedOut();
|
||||
frmBatchRefreshCheckedOut frmCO = new frmBatchRefreshCheckedOut(0);
|
||||
frmCO.MySessionInfo = MySessionInfo;
|
||||
frmCO.Location = new Point(Screen.PrimaryScreen.WorkingArea.Width - frmCO.Width, Screen.PrimaryScreen.WorkingArea.Height - frmCO.Height);
|
||||
frmCO.Show(this);
|
||||
@ -516,7 +538,7 @@ namespace VEPROMS
|
||||
sb.AppendLine("Once this is complete you can continue the process otherwise you may terminate the process immediately.");
|
||||
sb.AppendLine();
|
||||
sb.AppendLine("Have you requested the users to close the procedures and do you want to continue the process?");
|
||||
frmBatchRefreshCheckedOut frmCO = new frmBatchRefreshCheckedOut();
|
||||
frmBatchRefreshCheckedOut frmCO = new frmBatchRefreshCheckedOut(0);
|
||||
frmCO.MySessionInfo = MySessionInfo;
|
||||
frmCO.CheckedOutProcedures = pil;
|
||||
frmCO.Location = new Point(Screen.PrimaryScreen.WorkingArea.Width - frmCO.Width, Screen.PrimaryScreen.WorkingArea.Height - frmCO.Height);
|
||||
|
@ -89,8 +89,8 @@ namespace VEPROMS
|
||||
this.StartPosition = System.Windows.Forms.FormStartPosition.Manual;
|
||||
this.Text = "Procedures Currently Checked Out";
|
||||
this.TopMost = true;
|
||||
this.Load += new System.EventHandler(this.frmBatchRefreshCheckedOut_Load);
|
||||
this.FormClosing += new System.Windows.Forms.FormClosingEventHandler(this.frmBatchRefreshCheckedOut_FormClosing);
|
||||
this.Load += new System.EventHandler(this.frmBatchRefreshCheckedOut_Load);
|
||||
this.ResumeLayout(false);
|
||||
|
||||
}
|
||||
|
@ -29,13 +29,16 @@ namespace VEPROMS
|
||||
get { return _CheckedOutProcedures; }
|
||||
set { _CheckedOutProcedures = value; }
|
||||
}
|
||||
public frmBatchRefreshCheckedOut()
|
||||
private int RType = -1; // C2023-002: Flag type of checkout, docversion -1 or procedures 0
|
||||
public frmBatchRefreshCheckedOut(int type)
|
||||
{
|
||||
RType = type;
|
||||
InitializeComponent();
|
||||
}
|
||||
private void frmBatchRefreshCheckedOut_FormClosing(object sender, FormClosingEventArgs e)
|
||||
{
|
||||
Owner.Show();
|
||||
DialogResult = DialogResult.Cancel;
|
||||
}
|
||||
private void frmBatchRefreshCheckedOut_Load(object sender, EventArgs e)
|
||||
{
|
||||
@ -50,20 +53,23 @@ namespace VEPROMS
|
||||
p.BorderStyle = BorderStyle.FixedSingle;
|
||||
p.Dock = DockStyle.Top;
|
||||
p.Height = 28;
|
||||
Button b = new Button();
|
||||
//b.FlatStyle = FlatStyle.Popup;
|
||||
b.Dock = DockStyle.Right;
|
||||
b.Text = "Force Check In";
|
||||
b.Tag = pi;
|
||||
b.Click += new EventHandler(ForceCheckIn_Click);
|
||||
p.Controls.Add(b);
|
||||
b = new Button();
|
||||
//b.FlatStyle = FlatStyle.Popup;
|
||||
b.Dock = DockStyle.Right;
|
||||
b.Text = "Send Email";
|
||||
b.Tag = pi;
|
||||
b.Click += new EventHandler(SendEmail_Click);
|
||||
p.Controls.Add(b);
|
||||
if (RType != 1) // C2023-002: only put out ForceCheckin & sendemail buttons if on procedures (can't check in a docversion)
|
||||
{
|
||||
Button b = new Button();
|
||||
//b.FlatStyle = FlatStyle.Popup;
|
||||
b.Dock = DockStyle.Right;
|
||||
b.Text = "Force Check In";
|
||||
b.Tag = pi;
|
||||
b.Click += new EventHandler(ForceCheckIn_Click);
|
||||
p.Controls.Add(b);
|
||||
b = new Button();
|
||||
//b.FlatStyle = FlatStyle.Popup;
|
||||
b.Dock = DockStyle.Right;
|
||||
b.Text = "Send Email";
|
||||
b.Tag = pi;
|
||||
b.Click += new EventHandler(SendEmail_Click);
|
||||
p.Controls.Add(b);
|
||||
}
|
||||
Label l = new Label();
|
||||
l.Dock = DockStyle.Fill;
|
||||
l.TextAlign = ContentAlignment.MiddleLeft;
|
||||
|
@ -112,16 +112,16 @@
|
||||
<value>2.0</value>
|
||||
</resheader>
|
||||
<resheader name="reader">
|
||||
<value>System.Resources.ResXResourceReader, System.Windows.Forms, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089</value>
|
||||
<value>System.Resources.ResXResourceReader, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089</value>
|
||||
</resheader>
|
||||
<resheader name="writer">
|
||||
<value>System.Resources.ResXResourceWriter, System.Windows.Forms, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089</value>
|
||||
<value>System.Resources.ResXResourceWriter, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089</value>
|
||||
</resheader>
|
||||
<metadata name="tmrCheck.TrayLocation" type="System.Drawing.Point, System.Drawing, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a">
|
||||
<metadata name="tmrCheck.TrayLocation" type="System.Drawing.Point, System.Drawing, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a">
|
||||
<value>17, 17</value>
|
||||
</metadata>
|
||||
<data name="label2.Text" xml:space="preserve">
|
||||
<value>While this form is visible, there is a timer running that checks every 30 seconds to see if any of the above procedures have been checked in. You have the option of sending an email to the user asking them to close the procedure so you can finish the batch refresh process or you can force check in the procedure.
|
||||
<value>For Ro Value Updates, this form shows users in procedures but does not update ro values for associated sets, even if user exits. It also does not send email or allow Forced Check In. For transitions, while this form is visible, there is a timer running that checks every 30 seconds to see if any of the above procedures have been checked in. You have the option of sending an email to the user asking them to close the procedure so you can finish the batch refresh process or you can force check in the procedure.
|
||||
|
||||
The recommended practice would be to send an email and wait to see if the user closes the procedure. If after an acceptable period of time, the procedure is still checked out, the forced check in step can be taken. When you select forced check in, an email will be sent to the user stating that the procedure was forced checked in.</value>
|
||||
</data>
|
||||
|
@ -2031,6 +2031,7 @@ namespace VEPROMS
|
||||
tc.MySessionInfo = MySessionInfo;
|
||||
tv.MySessionInfo = MySessionInfo;
|
||||
tv.MyUserInfo = MyUserInfo;
|
||||
StepTabRibbon.MySessionInfo = MySessionInfo;
|
||||
|
||||
// Initialize Caption with Server name and Database name.
|
||||
SetCaption(tv.TopNode as VETreeNode);
|
||||
|
@ -126,7 +126,12 @@ namespace Volian.Controls.Library
|
||||
get { return _MyUserInfo; }
|
||||
set { _MyUserInfo = value; }
|
||||
}
|
||||
|
||||
private static SessionInfo _MySessionInfo;
|
||||
public static SessionInfo MySessionInfo
|
||||
{
|
||||
get { return _MySessionInfo; }
|
||||
set { _MySessionInfo = value; }
|
||||
}
|
||||
private DevComponents.DotNetBar.ButtonItem _DefaultContextMenu;
|
||||
|
||||
public void ClearContextMenu()
|
||||
@ -3378,7 +3383,15 @@ namespace Volian.Controls.Library
|
||||
// return;
|
||||
//}
|
||||
Cursor = Cursors.WaitCursor;
|
||||
|
||||
// C2023-001: Check whether docversion can be checked out before continuing with update of ro.fst
|
||||
string message = string.Empty;
|
||||
if (!MySessionInfo.CanCheckOutItem(Mydvi.VersionID, CheckOutType.DocVersion, ref message))
|
||||
{
|
||||
FlexibleMessageBox.Show(this, message, "Working Draft Has Items Already Checked Out", MessageBoxButtons.OK, MessageBoxIcon.Warning);
|
||||
FinalProgressBarMessage = "Cannot check-out Working Draft";
|
||||
Cursor = Cursors.Default;
|
||||
return;
|
||||
}
|
||||
using (DocVersion dv = DocVersion.Get(Mydvi.VersionID))
|
||||
{
|
||||
swROUpdate = new System.IO.StreamWriter(ROFstInfo.ROUpdateResultsPath(Mydvi));
|
||||
|
Loading…
x
Reference in New Issue
Block a user