Added SessionInfo property to dlgApproveProcedure and ApprovalInfo classes.
Added SessionInfo property to DlgPrintProcedure and added checks to print routines to notify user that another user has procedure checked out with a confirmation to continue printing. Added code to support multiuser and security including initializing security, creating user if user does not exist in database, checking in and out DocVersions, Procedures and Documents and keeping the database notified that user is still active. Added label to bottom of PROMS main form to indicate who user is and what security they have on open objects.
This commit is contained in:
@@ -15,6 +15,12 @@ namespace VEPROMS
|
||||
{
|
||||
public partial class DlgPrintProcedure : DevComponents.DotNetBar.Office2007Form
|
||||
{
|
||||
private SessionInfo _MySessionInfo;
|
||||
public SessionInfo MySessionInfo
|
||||
{
|
||||
get { return _MySessionInfo; }
|
||||
set { _MySessionInfo = value; }
|
||||
}
|
||||
private bool _Automatic;
|
||||
public bool Automatic
|
||||
{
|
||||
@@ -487,6 +493,21 @@ namespace VEPROMS
|
||||
private string _MultiunitPdfLocation = string.Empty;
|
||||
private void CreatePDFs()
|
||||
{
|
||||
StringBuilder sb = new StringBuilder();
|
||||
foreach (ProcedureInfo myProc in _DocVersionInfo.Procedures)
|
||||
{
|
||||
string message = string.Empty;
|
||||
if (!MySessionInfo.CanCheckOutItem(myProc.ItemID, CheckOutType.Procedure, ref message))
|
||||
{
|
||||
sb.AppendLine(message);
|
||||
}
|
||||
}
|
||||
if (sb.Length > 0)
|
||||
{
|
||||
if (MessageBox.Show(sb.ToString() + Environment.NewLine + Environment.NewLine + "Do you want to continue to print all procedures?", "Procedures Already Checked Out", MessageBoxButtons.YesNo, MessageBoxIcon.Question) == DialogResult.No)
|
||||
return;
|
||||
}
|
||||
|
||||
CreateDebugFiles();
|
||||
// If file exists, determine if overwrite checkbox allows overwrite, if not prompt.
|
||||
|
||||
@@ -600,6 +621,12 @@ namespace VEPROMS
|
||||
}
|
||||
private void CreatePDF()
|
||||
{
|
||||
string message = string.Empty;
|
||||
if (!MySessionInfo.CanCheckOutItem(MyProcedure.ItemID, CheckOutType.Procedure, ref message))
|
||||
{
|
||||
if (MessageBox.Show(this, message + Environment.NewLine + Environment.NewLine + "Do you want to continue to print the procedure?", "Procedure Is Checked Out", MessageBoxButtons.YesNo, MessageBoxIcon.Question) == DialogResult.No)
|
||||
return;
|
||||
}
|
||||
CreateDebugFiles();
|
||||
// If file exists, determine if overwrite checkbox allows overwrite, if not prompt.
|
||||
|
||||
|
Reference in New Issue
Block a user