Compare commits
33 Commits
B2024-062_
...
C2020-049-
Author | SHA1 | Date | |
---|---|---|---|
baa2ae334b | |||
60d7116549 | |||
7ca39a4d38 | |||
efe215f4d0 | |||
5e2e2f841c | |||
9da436ab2d | |||
5333b96c88 | |||
6561a11661 | |||
1c9334a52b | |||
2e00693a33 | |||
8617ce4562 | |||
78416ef452 | |||
9ad50af4dd | |||
a6f3d62a01 | |||
a25b5fc6b8 | |||
9e26e94e97 | |||
a571cb5f15 | |||
2e00c94d34 | |||
f1506b9aee | |||
2805471301 | |||
89f55e091f | |||
da6c47d0ff | |||
63cac73de3 | |||
c8ed5b0565 | |||
c6342fea49 | |||
7a3748f7e0 | |||
516b479c0c | |||
a43e059733 | |||
0ac79f4e46 | |||
c06744b3bb | |||
218a2c17a2 | |||
a629f6834b | |||
bf5337cf63 |
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
@@ -231,7 +231,6 @@ namespace VEPROMS
|
||||
cbxOpenAfterCreate2.Visible = oneProcedure;
|
||||
cbxOpenAfterCreate2.Checked = false;
|
||||
cbxOverwritePDF2.Visible = oneProcedure;
|
||||
cbxOverwritePDF2.Checked = true;
|
||||
gpnlDebug.Visible = Volian.Base.Library.VlnSettings.DebugMode;
|
||||
swtbtnGeneratePlacekeeper.Value = false;
|
||||
cbxGenerateConActSum.Checked = false;
|
||||
@@ -1206,18 +1205,23 @@ namespace VEPROMS
|
||||
private bool validateDate(TextBox txtDate)
|
||||
{
|
||||
DateTime dDate;
|
||||
if (DateTime.TryParse(txtDate.Text, out dDate))
|
||||
if (!(txtDate.Text == ""))
|
||||
{
|
||||
return true;
|
||||
}
|
||||
else
|
||||
{
|
||||
string txtDate2 = txtDate.Text;
|
||||
string message = String.Format("Date {0} in wrong format" + System.Environment.NewLine + "Correct the revision date.", txtDate2);
|
||||
string txtTitle = "Invalid Format";
|
||||
MessageBox.Show(message, txtTitle);
|
||||
return false;
|
||||
|
||||
if (DateTime.TryParse(txtDate.Text, out dDate))
|
||||
{
|
||||
return true;
|
||||
}
|
||||
else
|
||||
{
|
||||
string txtDate2 = txtDate.Text;
|
||||
string message = String.Format("Date {0} in wrong format" + System.Environment.NewLine + "Correct the revision date.", txtDate2);
|
||||
string txtTitle = "Invalid Format";
|
||||
MessageBox.Show(message, txtTitle);
|
||||
return false;
|
||||
}
|
||||
}
|
||||
return true;
|
||||
}
|
||||
|
||||
private void txbRevDate_Enter(object sender, EventArgs e)
|
||||
|
File diff suppressed because it is too large
Load Diff
@@ -425,9 +425,9 @@ namespace VEPROMS
|
||||
MessageBox.Show(msg, "Import Completed", MessageBoxButtons.OK, MessageBoxIcon.Information); // C2020-042 changed mesage box title
|
||||
//MessageBox.Show(string.Format("Finished Importing:\n\n{0}", txtImport.Text.Substring(txtImport.Text.LastIndexOf("\\") + 1)), "Import", MessageBoxButtons.OK, MessageBoxIcon.Information);
|
||||
}
|
||||
if (canceledPressed)
|
||||
if (canceledPressed || !isImported)
|
||||
{
|
||||
MessageBox.Show(string.Format("Canceling the import of:\n\n{0}", txtImport.Text.Substring(txtImport.Text.LastIndexOf("\\") + 1)), "Import", MessageBoxButtons.OK, MessageBoxIcon.Information);
|
||||
MessageBox.Show(string.Format("Cancelling the import of:\n\n{0}", txtImport.Text.Substring(txtImport.Text.LastIndexOf("\\") + 1)), "Cancelling Import", MessageBoxButtons.OK, MessageBoxIcon.Information);
|
||||
btnCloseImport.PerformClick();
|
||||
}
|
||||
}
|
||||
@@ -906,8 +906,8 @@ namespace VEPROMS
|
||||
// C2020-032: Import Procedure set when existing name exists, allow user to import with 'Copy (#) of'.
|
||||
// This is similar functionality to the import of a procedure without the overwrite part.
|
||||
string msg = string.Format("The procedure set you are importing, {0}, already exists.\n\nDo you want to import {0} as a COPY of the existing set?\n\nThis will prefix the name with \"Copy (#) of\"", name);
|
||||
DialogResult dr = MessageBox.Show(this, msg, "Create Copy Of Existing Procedure Set", MessageBoxButtons.YesNoCancel, MessageBoxIcon.Stop);
|
||||
if (dr == DialogResult.Yes)
|
||||
DialogResult dr = MessageBox.Show(this, msg, "Create Copy Of Existing Procedure Set", MessageBoxButtons.OKCancel, MessageBoxIcon.Stop);
|
||||
if (dr == DialogResult.OK)
|
||||
{
|
||||
string number = "";
|
||||
int max = -1;
|
||||
@@ -931,6 +931,11 @@ namespace VEPROMS
|
||||
|
||||
ff = AddFolder(Folder.Get(MyFolder.FolderID), xd, name);
|
||||
}
|
||||
//else if (dr == System.Windows.Forms.DialogResult.Cancel)
|
||||
//{
|
||||
// //canceledPressed = true;
|
||||
// //resolvedProcNum = false;
|
||||
//}
|
||||
else
|
||||
return false;
|
||||
}
|
||||
|
@@ -11,6 +11,7 @@ using Volian.Controls.Library;
|
||||
using DevComponents.DotNetBar;
|
||||
using JR.Utils.GUI.Forms;
|
||||
using Volian.Controls.Library;
|
||||
using System.Linq;
|
||||
|
||||
namespace VEPROMS
|
||||
{
|
||||
@@ -1799,6 +1800,21 @@ namespace VEPROMS
|
||||
}
|
||||
}
|
||||
|
||||
//B2024-074 If only deleting annotations from an individual procedure, verify can check out procedure.
|
||||
string msgpi = string.Empty;
|
||||
foreach (ProcedureInfo pi in pil)
|
||||
{
|
||||
//LINQ used for 1st check of if statement
|
||||
//basically check if procedure was already part of a docVersionsFolder
|
||||
//before checking if procedure was checked out already
|
||||
//to avoid duplicate messages for checked out procedures
|
||||
if (!dvil.Any(x => x.Procedures.Any(y => y.ItemID == pi.ItemID)) && !MySessionInfo.CanCheckOutItem(pi.ItemID, CheckOutType.Procedure, ref msgpi))
|
||||
{
|
||||
sbDocVersions.AppendLine(msgpi);
|
||||
cancelledOut = true;
|
||||
}
|
||||
}
|
||||
|
||||
if (cancelledOut)
|
||||
{
|
||||
StringBuilder sb = new StringBuilder();
|
||||
|
@@ -295,7 +295,10 @@ namespace VEPROMS
|
||||
}
|
||||
|
||||
}
|
||||
while (!MyPromsPrinter.MergeNotIncluded && _PdfFile == null && MessageBox.Show("Try Again?", "PDF Creation Failed", MessageBoxButtons.YesNo, MessageBoxIcon.Question) == DialogResult.Yes);
|
||||
// B2024-062 Added check for EmptyProcedure. We don't need to show the Try Again message if the procedure
|
||||
// is empty, as it would be just be a waste of time for the user.
|
||||
while (!MyPromsPrinter.MergeNotIncluded && _PdfFile == null && !MyPromsPrinter.EmptyProcedure &&
|
||||
MessageBox.Show("Try Again?", "PDF Creation Failed", MessageBoxButtons.YesNo, MessageBoxIcon.Question) == DialogResult.Yes);
|
||||
|
||||
|
||||
if (_PdfFile == null)
|
||||
|
@@ -1670,16 +1670,36 @@ namespace VEPROMS
|
||||
return;
|
||||
}
|
||||
|
||||
string stk = Volian.Base.Library.vlnStackTrace.StackToString();
|
||||
string stk = Volian.Base.Library.vlnStackTrace.StackToString();
|
||||
|
||||
if (!stk.Contains("Exception"))
|
||||
{
|
||||
// B2018-091 Allow PROMS to close if only MSWord sections have been opened.
|
||||
// B2019-071 we will now close one or all of the tabs (even step editor ones)
|
||||
|
||||
string DisplayTabID = "";
|
||||
int pos;
|
||||
int TabItemID;
|
||||
string DisplayTabName = "";
|
||||
int cnt = 0;
|
||||
// Deactivate previous procedure tab state by user
|
||||
VEPROMS.CSLA.Library.Item.DeactivateStateDisplayTabTmp(MySessionInfo.UserID);
|
||||
// Save current procedure tab state
|
||||
foreach (KeyValuePair<string, DisplayTabItem> pgTab in tc._MyDisplayTabItems)
|
||||
{
|
||||
cnt++;
|
||||
DisplayTabID = pgTab.Key;
|
||||
TabItemID = Int32.Parse(DisplayTabID.Substring(DisplayTabID.IndexOf("Item - ") + 7));
|
||||
DisplayTabName = pgTab.Value.ToString();
|
||||
//tc.SelectedDisplayTabItem.MyStepTabPanel.ToString()
|
||||
VEPROMS.CSLA.Library.Item.AddDisplayTabsState(TabItemID, DisplayTabID, DisplayTabName, MySessionInfo.UserID, cnt);
|
||||
}
|
||||
|
||||
int n = tc._MyDisplayTabItems.Count;
|
||||
|
||||
while (n-- > 0 && tc._MyDisplayTabItems.Count > 0)
|
||||
{
|
||||
|
||||
tc.CloseTabItem(tc.SelectedDisplayTabItem);
|
||||
|
||||
// B2019-071 close just the current tab and continue working
|
||||
@@ -2320,6 +2340,27 @@ namespace VEPROMS
|
||||
CurrentID = txtSearch.Text;
|
||||
}
|
||||
}
|
||||
|
||||
// Add retrieve displaytabs state here.
|
||||
openDisplaytabstate();
|
||||
}
|
||||
|
||||
public void openDisplaytabstate()
|
||||
{
|
||||
DataTable DisPlayTabState = VEPROMS.CSLA.Library.Item.GetDisplayTabs(VlnSettings.UserID);
|
||||
|
||||
if (DisPlayTabState.Rows.Count > 0)
|
||||
{
|
||||
foreach (DataRow TabState in DisPlayTabState.Rows)
|
||||
{
|
||||
int _ItemID = (int)TabState["ItemID"];
|
||||
//ItemInfoList _Procedures = ItemInfoList.GetList(_ItemID, (int)E_FromType.Procedure));
|
||||
ItemInfo _Procedure = ItemInfo.Get(_ItemID);
|
||||
//ItemInfo.Get
|
||||
//ItemInfo.Get
|
||||
OpenItem(_Procedure);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
void tc_RefreshEnhancedDocument(object sender, ItemSelectedChangedEventArgs args)
|
||||
|
@@ -511,7 +511,7 @@ namespace VEPROMS
|
||||
|
||||
private void btnPC_Click(object sender, EventArgs e)
|
||||
{
|
||||
if (MessageBox.Show(this, "Are you sure you want to add Applicability to this Working Draft?", "Add Applicability", MessageBoxButtons.YesNoCancel, MessageBoxIcon.Stop) == DialogResult.Yes)
|
||||
if (MessageBox.Show(this, "Are you sure you want to add Applicability to this Working Draft?", "Add Applicability", MessageBoxButtons.YesNo, MessageBoxIcon.Stop) == DialogResult.Yes)
|
||||
{
|
||||
btnApplicability.Visible = true;
|
||||
tiApplicability.Visible = true;
|
||||
|
@@ -8004,6 +8004,171 @@ namespace VEPROMS.CSLA.Library
|
||||
MyContent.Config = _ProcedureConfig.ToString();
|
||||
}
|
||||
#endregion
|
||||
public class DisplayTabs
|
||||
{
|
||||
private int _ItemID;
|
||||
public int ItemID
|
||||
{
|
||||
get { return _ItemID; }
|
||||
set { _ItemID = value; }
|
||||
|
||||
}
|
||||
private string _DisplayTabID;
|
||||
public string DisplayTabID
|
||||
{
|
||||
get { return _DisplayTabID; }
|
||||
set { _DisplayTabID = value; }
|
||||
}
|
||||
private string _DisplayTabName;
|
||||
public string DisplayTabName
|
||||
{
|
||||
get { return _DisplayTabName; }
|
||||
set { _DisplayTabName = value; }
|
||||
}
|
||||
|
||||
public SafeDataReader Dr { get; }
|
||||
|
||||
public DisplayTabs()
|
||||
{
|
||||
|
||||
}
|
||||
|
||||
public DisplayTabs(int itemID, String displayTabID, String displayTabName)
|
||||
{
|
||||
_ItemID = itemID;
|
||||
_DisplayTabID = displayTabID;
|
||||
_DisplayTabName = displayTabName;
|
||||
}
|
||||
|
||||
public DisplayTabs(SafeDataReader dr)
|
||||
{
|
||||
Dr = dr;
|
||||
}
|
||||
}
|
||||
public static DataTable GetDisplayTabs(int itemID) //, string displayTabID, string displayTabName)
|
||||
{
|
||||
try
|
||||
{
|
||||
DataTable tmp = DataPortal.Fetch<DataTable>(new DisplayTabs(itemID, "", "")); //, displayTabID, displayTabName));
|
||||
//ItemInfo.AddList(tmp);
|
||||
//tmp.AddEvents();
|
||||
return tmp;
|
||||
}
|
||||
catch (Exception ex)
|
||||
{
|
||||
throw new DbCslaException("Error on ItemInfoList.GetChildren", ex);
|
||||
}
|
||||
}
|
||||
private DataTable dt = new DataTable();
|
||||
private DataTable DataPortal_Fetch(DisplayTabs criteria)
|
||||
{
|
||||
|
||||
using (SqlConnection cn = Database.VEPROMS_SqlConnection)
|
||||
{
|
||||
using (SqlCommand cm = cn.CreateCommand())
|
||||
{
|
||||
try
|
||||
{
|
||||
cm.CommandType = CommandType.StoredProcedure;
|
||||
cm.CommandText = "GetDisplayTabData";
|
||||
cm.CommandTimeout = Database.DefaultTimeout;
|
||||
SqlDataAdapter da = new SqlDataAdapter(cm);
|
||||
da.Fill(dt);
|
||||
cn.Close();
|
||||
da.Dispose();
|
||||
return dt;
|
||||
}
|
||||
catch (Exception ex)
|
||||
{
|
||||
//if (_MyLog.IsErrorEnabled) _MyLog.Error("ItemExt.DataPortal_Fetch", ex);
|
||||
throw new DbCslaException("ItemExt.DataPortal_Fetch", ex);
|
||||
}
|
||||
|
||||
}
|
||||
}
|
||||
|
||||
}
|
||||
//public static void AddDisplayTabsState(int itemID, string displayTabID, string displayTabName)
|
||||
//{
|
||||
// try
|
||||
// {
|
||||
// //DisplayTabs tmp =
|
||||
// DataPortal.Fetch<DisplayTabs>(new DisplayTabs(itemID, displayTabID, displayTabName)); //, displayTabID, displayTabName));
|
||||
// //ItemInfo.AddList(tmp);
|
||||
// //tmp.AddEvents();
|
||||
// //return tmp;
|
||||
// }
|
||||
// catch (Exception ex)
|
||||
// {
|
||||
// throw new DbCslaException("Error on ItemInfoList.GetChildren", ex);
|
||||
// }
|
||||
//}
|
||||
//private DataTable dt = new DataTable();
|
||||
//private void DataPortal_Fetch(int itemID, string displayTabID, string displayTabName)
|
||||
//{
|
||||
|
||||
// using (SqlConnection cn = Database.VEPROMS_SqlConnection)
|
||||
// {
|
||||
// using (SqlCommand cm = cn.CreateCommand())
|
||||
// {
|
||||
// try
|
||||
// {
|
||||
// cm.CommandType = CommandType.StoredProcedure;
|
||||
// cm.CommandText = "AddDisplayTabState";
|
||||
// cm.CommandTimeout = Database.DefaultTimeout;
|
||||
// cm.Parameters.AddWithValue("@ItemID", ItemID);
|
||||
// cm.Parameters.AddWithValue("@displayTabID", displayTabID);
|
||||
// cm.Parameters.AddWithValue("@displayTabName", displayTabName);
|
||||
// cm.ExecuteNonQuery();
|
||||
// //SqlDataAdapter da = new SqlDataAdapter(cm);
|
||||
// //da.Fill(dt);
|
||||
// //cn.Close();
|
||||
// //da.Dispose();
|
||||
// //return dt; // fix
|
||||
// }
|
||||
// catch (Exception ex)
|
||||
// {
|
||||
// //if (_MyLog.IsErrorEnabled) _MyLog.Error("ItemExt.DataPortal_Fetch", ex);
|
||||
// throw new DbCslaException("ItemExt.DataPortal_Fetch", ex);
|
||||
// }
|
||||
|
||||
// }
|
||||
// }
|
||||
|
||||
//}
|
||||
public static void AddDisplayTabsState(int itemID, string displayTabID, string displayTabName)
|
||||
//private void DataPortal_Fetch(int itemID, string displayTabID, string displayTabName)
|
||||
{
|
||||
|
||||
using (SqlConnection cn = Database.VEPROMS_SqlConnection)
|
||||
{
|
||||
using (SqlCommand cm = cn.CreateCommand())
|
||||
{
|
||||
try
|
||||
{
|
||||
cm.CommandType = CommandType.StoredProcedure;
|
||||
cm.CommandText = "AddDisplayTabState";
|
||||
cm.CommandTimeout = Database.DefaultTimeout;
|
||||
cm.Parameters.AddWithValue("@ItemID", itemID);
|
||||
cm.Parameters.AddWithValue("@displayTabID", displayTabID);
|
||||
cm.Parameters.AddWithValue("@displayTabName", displayTabName);
|
||||
cm.ExecuteNonQuery();
|
||||
//SqlDataAdapter da = new SqlDataAdapter(cm);
|
||||
//da.Fill(dt);
|
||||
//cn.Close();
|
||||
//da.Dispose();
|
||||
//return dt; // fix
|
||||
}
|
||||
catch (Exception ex)
|
||||
{
|
||||
//if (_MyLog.IsErrorEnabled) _MyLog.Error("ItemExt.AddDisplayTabsState", ex);
|
||||
throw new DbCslaException("ItemExt.AddDisplayTabsState", ex);
|
||||
}
|
||||
|
||||
}
|
||||
}
|
||||
|
||||
}
|
||||
}
|
||||
#endregion
|
||||
#region SectionInfo
|
||||
|
@@ -156,32 +156,38 @@ namespace VEPROMS.CSLA.Library
|
||||
SessionInfoList sil = DataPortal.Fetch<SessionInfoList>(new SessionInfoList.CanCheckOutItemCriteria(objectID, objectType));
|
||||
if (sil.Count == 0)
|
||||
return true;
|
||||
if (objectType == CheckOutType.Session)
|
||||
{
|
||||
if (sil.Count == 1)
|
||||
{
|
||||
OwnerInfoList oil = OwnerInfoList.GetBySessionID(sil[0].SessionID);
|
||||
if (oil.Count == 0)
|
||||
return true;
|
||||
else
|
||||
{
|
||||
message = "Export Procedure Set and Import Procedure Set are not available because you have open procedures or documents";
|
||||
return false;
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
message = "Export Procedure Set and Import Procedure Set are not available because there are other sessions open in the database";
|
||||
return false;
|
||||
}
|
||||
}
|
||||
if (objectType == CheckOutType.Session)
|
||||
{
|
||||
if (sil.Count == 1)
|
||||
{
|
||||
OwnerInfoList oil = OwnerInfoList.GetBySessionID(sil[0].SessionID);
|
||||
if (oil.Count == 0)
|
||||
return true;
|
||||
else
|
||||
{
|
||||
message = "Export Procedure Set and Import Procedure Set are not available because you have open procedures or documents";
|
||||
return false;
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
message = "Export Procedure Set and Import Procedure Set are not available because there are other sessions open in the database";
|
||||
return false;
|
||||
}
|
||||
}
|
||||
bool rv = true;
|
||||
// C2015-022 part of separate windows logic, check the processID instead of the sessionID
|
||||
foreach (SessionInfo si in sil)
|
||||
{
|
||||
if (si.ProcessID != this.ProcessID && objectType == CheckOutType.Procedure)
|
||||
{
|
||||
message = string.Format("The procedure {0} is already checked out to {1}", ItemInfo.Get(objectID).MyProcedure.DisplayNumber, si.UserID);
|
||||
//B2024-074 If no Number for Procedure, Display Title
|
||||
ProcedureInfo tmpproc = ItemInfo.Get(objectID).MyProcedure;
|
||||
string name = tmpproc.DisplayNumber;
|
||||
if (string.IsNullOrEmpty(name))
|
||||
{ name = tmpproc.DisplayText; }
|
||||
|
||||
message = string.Format("The procedure {0} is already checked out to {1}", name, si.UserID);
|
||||
rv = rv && false;
|
||||
}
|
||||
else if (si.ProcessID != this.ProcessID && objectType == CheckOutType.Document)
|
||||
@@ -195,8 +201,16 @@ namespace VEPROMS.CSLA.Library
|
||||
OwnerInfo oi = OwnerInfo.GetBySessionIDandVersionID(si.SessionID, objectID);
|
||||
if (oi == null)
|
||||
message = message + string.Format("The working draft is already checked out to {0}", si.UserID) + Environment.NewLine;
|
||||
else if(oi.OwnerType == 0)
|
||||
message = message + string.Format("The procedure {0} is already checked out to {1}", ItemInfo.Get(oi.OwnerItemID).MyProcedure.DisplayNumber, si.UserID) + Environment.NewLine;
|
||||
else if (oi.OwnerType == 0)
|
||||
{
|
||||
//B2024-074 If no Number for Procedure, Display Title
|
||||
ProcedureInfo tmpproc = ItemInfo.Get(oi.OwnerItemID).MyProcedure;
|
||||
string name = tmpproc.DisplayNumber;
|
||||
if (string.IsNullOrEmpty(name))
|
||||
{ name = tmpproc.DisplayText; }
|
||||
|
||||
message = message + string.Format("The procedure {0} is already checked out to {1}", name, si.UserID) + Environment.NewLine;
|
||||
}
|
||||
else if (oi.OwnerType == 1)
|
||||
message = message + string.Format("The document {0} is already checked out to {1}", DocumentInfo.Get(oi.OwnerItemID).DocumentEntries[0].MyContent.Text, si.UserID) + Environment.NewLine;
|
||||
else if (oi.OwnerType == 2)
|
||||
@@ -211,7 +225,15 @@ namespace VEPROMS.CSLA.Library
|
||||
if (oi != null)
|
||||
{
|
||||
if (oi.OwnerType == 0)
|
||||
message = message + string.Format("The procedure {0} is already checked out to {1}", ItemInfo.Get(oi.OwnerItemID).MyProcedure.DisplayNumber, si.UserID) + Environment.NewLine;
|
||||
{
|
||||
//B2024-074 If no Number for Procedure, Display Title
|
||||
ProcedureInfo tmpproc = ItemInfo.Get(oi.OwnerItemID).MyProcedure;
|
||||
string name = tmpproc.DisplayNumber;
|
||||
if (string.IsNullOrEmpty(name))
|
||||
{ name = tmpproc.DisplayText; }
|
||||
|
||||
message = message + string.Format("The procedure {0} is already checked out to {1}", name, si.UserID) + Environment.NewLine;
|
||||
}
|
||||
else if (oi.OwnerType == 1)
|
||||
message = message + string.Format("The document {0} is already checked out to {1}", DocumentInfo.Get(oi.OwnerItemID).DocumentEntries[0].MyContent.Text, si.UserID) + Environment.NewLine;
|
||||
else if (oi.OwnerType == 2)
|
||||
|
@@ -1132,6 +1132,91 @@ namespace VEPROMS.CSLA.Library
|
||||
throw new DbCslaException("Item.Add", ex);
|
||||
}
|
||||
}
|
||||
public static void DeactivateStateDisplayTabTmp(string UserID)
|
||||
{
|
||||
using (SqlConnection cn = Database.VEPROMS_SqlConnection)
|
||||
{
|
||||
using (SqlCommand cm = cn.CreateCommand())
|
||||
{
|
||||
try
|
||||
{
|
||||
cm.CommandType = CommandType.StoredProcedure;
|
||||
cm.CommandText = "DeactivateStateDisplayTabTmp";
|
||||
cm.CommandTimeout = Database.DefaultTimeout;
|
||||
cm.Parameters.AddWithValue("@UserID", UserID);
|
||||
cm.ExecuteNonQuery();
|
||||
}
|
||||
catch (Exception ex)
|
||||
{
|
||||
//if (_MyLog.IsErrorEnabled) _MyLog.Error("ItemExt.DeactivateStateDisplayTabTmp", ex);
|
||||
throw new DbCslaException("ItemExt.DeactivateStateDisplayTabTmp", ex);
|
||||
}
|
||||
|
||||
}
|
||||
}
|
||||
}
|
||||
public static void AddDisplayTabsState(int itemID, string displayTabID, string displayTabName, string UserID, int order)
|
||||
//private void DataPortal_Fetch(int itemID, string displayTabID, string displayTabName)
|
||||
{
|
||||
using (SqlConnection cn = Database.VEPROMS_SqlConnection)
|
||||
{
|
||||
using (SqlCommand cm = cn.CreateCommand())
|
||||
{
|
||||
try
|
||||
{
|
||||
cm.CommandType = CommandType.StoredProcedure;
|
||||
cm.CommandText = "AddDisplayTabState";
|
||||
cm.CommandTimeout = Database.DefaultTimeout;
|
||||
cm.Parameters.AddWithValue("@ItemID", itemID);
|
||||
cm.Parameters.AddWithValue("@displayTabID", displayTabID);
|
||||
cm.Parameters.AddWithValue("@displayTabName", displayTabName);
|
||||
cm.Parameters.AddWithValue("@UserID", UserID);
|
||||
cm.Parameters.AddWithValue("@order", order);
|
||||
cm.ExecuteNonQuery();
|
||||
}
|
||||
catch (Exception ex)
|
||||
{
|
||||
//if (_MyLog.IsErrorEnabled) _MyLog.Error("ItemExt.AddDisplayTabsState", ex);
|
||||
throw new DbCslaException("ItemExt.AddDisplayTabsState", ex);
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
public static DataTable GetDisplayTabs(string UserID) //, string displayTabID, string displayTabName)
|
||||
//public static void DeactivateStateDisplayTabTmp(string UserID)
|
||||
{
|
||||
using (SqlConnection cn = Database.VEPROMS_SqlConnection)
|
||||
{
|
||||
using (SqlCommand cm = cn.CreateCommand())
|
||||
{
|
||||
try
|
||||
{
|
||||
cm.CommandType = CommandType.StoredProcedure;
|
||||
cm.CommandText = "GetDisplayTabdata";
|
||||
cm.CommandTimeout = Database.DefaultTimeout;
|
||||
cm.Parameters.AddWithValue("@UserID", UserID);
|
||||
//cm.ExecuteNonQuery();
|
||||
SqlDataAdapter da = new SqlDataAdapter(cm);
|
||||
//da.Fill(dt);
|
||||
//cn.Close();
|
||||
//da.Dispose();
|
||||
//return dt; // fix
|
||||
|
||||
SqlDataReader reader = cm.ExecuteReader();
|
||||
DataTable dt = new DataTable();
|
||||
dt.Load(reader);
|
||||
return dt;
|
||||
|
||||
}
|
||||
catch (Exception ex)
|
||||
{
|
||||
//if (_MyLog.IsErrorEnabled) _MyLog.Error("ItemExt.DeactivateStateDisplayTabTmp", ex);
|
||||
throw new DbCslaException("ItemExt.DeactivateStateDisplayTabTmp", ex);
|
||||
}
|
||||
|
||||
}
|
||||
}
|
||||
}
|
||||
[Transactional(TransactionalTypes.TransactionScope)]
|
||||
protected override void DataPortal_Update()
|
||||
{
|
||||
|
@@ -277,17 +277,27 @@ namespace Volian.Controls.Library
|
||||
|
||||
private void btnRemoveAnnotation_Click(object sender, EventArgs e)
|
||||
{
|
||||
//using (Annotation annotation = CurrentAnnotation.Get())
|
||||
//{
|
||||
// annotation.Delete();
|
||||
_AnnotationSearch.LoadingList = true;
|
||||
Annotation.DeleteAnnotation(CurrentAnnotation);
|
||||
// annotation.Save();
|
||||
_AnnotationSearch.LoadingList = false;
|
||||
CurrentAnnotation = null;
|
||||
UpdateAnnotationGrid();
|
||||
_AnnotationSearch.UpdateAnnotationSearchResults(); // B2019-004: update search results list when an annotation is removed.
|
||||
//}
|
||||
// CSM B2024-068 / B2024-069 - check if current annotation is not selected before removal of annotation
|
||||
if (CurrentAnnotation != null)
|
||||
{
|
||||
//using (Annotation annotation = CurrentAnnotation.Get())
|
||||
//{
|
||||
// annotation.Delete();
|
||||
_AnnotationSearch.LoadingList = true;
|
||||
Annotation.DeleteAnnotation(CurrentAnnotation);
|
||||
// annotation.Save();
|
||||
_AnnotationSearch.LoadingList = false;
|
||||
CurrentAnnotation = null;
|
||||
UpdateAnnotationGrid();
|
||||
_AnnotationSearch.UpdateAnnotationSearchResults(); // B2019-004: update search results list when an annotation is removed.
|
||||
//}
|
||||
}
|
||||
else
|
||||
{
|
||||
FlexibleMessageBox.Show("You Must Select an Annotation To Remove", "Annotation Not Selected", MessageBoxButtons.OK, MessageBoxIcon.Exclamation);
|
||||
return;
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
private void btnSaveAnnotation_Click(object sender, EventArgs e)
|
||||
@@ -674,12 +684,15 @@ namespace Volian.Controls.Library
|
||||
{
|
||||
using (Annotation annotation = CurrentAnnotation.Get())
|
||||
{
|
||||
annotation.RtfText = rtxbComment.Rtf;
|
||||
annotation.SearchText = rtxbComment.Text;
|
||||
annotation.MyAnnotationType = annotationType;
|
||||
annotation.DTS = DateTime.Now;
|
||||
annotation.UserID = Volian.Base.Library.VlnSettings.UserID;
|
||||
annotation.Save();
|
||||
if (annotation != null) // B2024-061 check for null reference
|
||||
{
|
||||
annotation.RtfText = rtxbComment.Rtf;
|
||||
annotation.SearchText = rtxbComment.Text;
|
||||
annotation.MyAnnotationType = annotationType;
|
||||
annotation.DTS = DateTime.Now;
|
||||
annotation.UserID = Volian.Base.Library.VlnSettings.UserID;
|
||||
annotation.Save();
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
@@ -503,7 +503,7 @@ namespace Volian.Controls.Library
|
||||
this.cbxSortBySetpointID.Size = new System.Drawing.Size(121, 23);
|
||||
this.cbxSortBySetpointID.Style = DevComponents.DotNetBar.eDotNetBarStyle.StyleManagerControlled;
|
||||
this.cbxSortBySetpointID.TabIndex = 11;
|
||||
this.cbxSortBySetpointID.Text = "Sort By Sepoint ID";
|
||||
this.cbxSortBySetpointID.Text = "Sort By Setpoint ID";
|
||||
this.cbxSortBySetpointID.Visible = false;
|
||||
//
|
||||
// DisplayReports
|
||||
|
@@ -270,7 +270,7 @@ namespace Volian.Controls.Library
|
||||
this.cbxTranCategory.Name = "cbxTranCategory";
|
||||
this.cbxTranCategory.Size = new System.Drawing.Size(215, 21);
|
||||
this.cbxTranCategory.TabIndex = 1;
|
||||
this.cbxTranCategory.WatermarkText = "Select Cateogry of Transitions";
|
||||
this.cbxTranCategory.WatermarkText = "Select Category of Transitions";
|
||||
//
|
||||
// lblTranCategory
|
||||
//
|
||||
@@ -402,7 +402,7 @@ namespace Volian.Controls.Library
|
||||
this.cbxTranCategory.Name = "cbxTranCategory";
|
||||
this.cbxTranCategory.Size = new System.Drawing.Size(215, 21);
|
||||
this.cbxTranCategory.TabIndex = 1;
|
||||
this.cbxTranCategory.WatermarkText = "Select Cateogry of Transitions";
|
||||
this.cbxTranCategory.WatermarkText = "Select Category of Transitions";
|
||||
//
|
||||
// lblTranCategory
|
||||
//
|
||||
|
@@ -16,6 +16,12 @@ namespace Volian.Controls.Library
|
||||
public delegate ItemInfo DisplayTabControlEditorSearchIncTransEvent(object sender, vlnTreeItemInfoEventArgs args);
|
||||
public delegate void DisplayTabControlEvent(object sender, EventArgs args);
|
||||
public delegate void DisplayTabControlStatusEvent(object sender, DisplayTabControlStatusEventArgs args);
|
||||
public class DisplayTabData
|
||||
{
|
||||
public int ItemID { get; set; }
|
||||
public string DisplayTabID { get; set; }
|
||||
public string DisplayTabName { get; set; }
|
||||
}
|
||||
public partial class DisplayTabControlStatusEventArgs : EventArgs
|
||||
{
|
||||
private VolianStatusType _Type;
|
||||
@@ -1145,6 +1151,9 @@ namespace Volian.Controls.Library
|
||||
}
|
||||
else // If not already open, create a new Page
|
||||
{
|
||||
|
||||
List<DisplayTabData> DisplayTabs = new List<DisplayTabData>();
|
||||
|
||||
pg = new DisplayTabItem(this.components, this, proc, key); // Open a new Procedure Tab
|
||||
_MyDisplayTabItems.Add(key, pg);
|
||||
if (setFocus)
|
||||
|
@@ -103,7 +103,7 @@ namespace Volian.Controls.Library
|
||||
public string TbFSwd
|
||||
{
|
||||
get {return tbFSWd.Text;}
|
||||
set { tbFSWd.Text = value; tbFSWd.Refresh(); trBarFS.Value = Convert.ToInt32(value); }
|
||||
set { tbFSWd.Text = value; tbFSWd.Refresh(); } // trBarFS.Value = Convert.ToInt32(value);
|
||||
}
|
||||
|
||||
public string TbFSht
|
||||
@@ -111,7 +111,7 @@ namespace Volian.Controls.Library
|
||||
get { return tbFSHt.Text; }
|
||||
set { tbFSHt.Text = value; tbFSHt.Refresh(); _origFigureSizeRatio = float.Parse(value) / float.Parse(tbFSWd.Text); }
|
||||
}
|
||||
|
||||
|
||||
#endregion
|
||||
#region Constructor
|
||||
public DisplayTags()
|
||||
|
@@ -285,7 +285,7 @@ namespace Volian.Controls.Library
|
||||
}
|
||||
public EditItem ActiveParent
|
||||
{
|
||||
get { return _MyParentEditItem != null ? _MyParentEditItem : _MyPreviousEditItem.ActiveParent; }
|
||||
get { return _MyParentEditItem != null ? _MyParentEditItem : _MyPreviousEditItem?.ActiveParent; }
|
||||
}
|
||||
/// <summary>
|
||||
/// Return the Parent EditItem
|
||||
|
@@ -256,7 +256,8 @@ namespace Volian.Controls.Library
|
||||
private int _origCfgHt = 0; // keep track if original size was stored in cfg
|
||||
private int _origCfgWd = 0;
|
||||
private bool _pastedNew = false; // need this for flagging newly pasted image (may need to clear cfg)
|
||||
private DisplayTags _displayTags;
|
||||
private DisplayTags _displayTags = new DisplayTags();
|
||||
//House myhouse = new House();
|
||||
|
||||
#endregion
|
||||
#region Constructors
|
||||
@@ -316,8 +317,11 @@ namespace Volian.Controls.Library
|
||||
}
|
||||
private void SetWidthsAndHeights(System.Drawing.Image img)
|
||||
{
|
||||
|
||||
int wd = img.Width * MyStepPanel.DPI / 72; // converts from screen resolution's DPI to image's points (72/inch)
|
||||
int ht = img.Height * MyStepPanel.DPI / 72;
|
||||
|
||||
|
||||
if (MyItemInfo.MyContent.MyImage != null) // image is null if creating new.
|
||||
{
|
||||
ImageConfig ic = new ImageConfig(MyItemInfo.MyContent.MyImage);
|
||||
@@ -340,9 +344,9 @@ namespace Volian.Controls.Library
|
||||
_displayTags.TbFSwd = wd.ToString();
|
||||
_displayTags.TbFSht = ht.ToString();
|
||||
}
|
||||
|
||||
|
||||
}
|
||||
|
||||
|
||||
// the following gets called for 'NEW' images
|
||||
private E_ImageSource InsType = E_ImageSource.None;
|
||||
public ImageItem(ItemInfo itemInfo, StepPanel myStepPanel, EditItem myParentEditItem, ChildRelation myChildRelation, bool expand, EditItem nextEditItem, ImageItem.E_ImageSource insType, DisplayTags displayTags)
|
||||
|
@@ -138,6 +138,15 @@ namespace Volian.Print.Library
|
||||
get { return _Prefix; }
|
||||
set { _Prefix = value; }
|
||||
}
|
||||
|
||||
// B2024-062 Set to true when the procedure being printed has no content.
|
||||
// When set to true, will prevent the "Try Again" dialog from appearing
|
||||
// and simply exit the print function
|
||||
private bool _EmptyProcedure = false;
|
||||
public bool EmptyProcedure
|
||||
{
|
||||
get { return _EmptyProcedure; }
|
||||
}
|
||||
private static readonly log4net.ILog _MyLog = log4net.LogManager.GetLogger(System.Reflection.MethodBase.GetCurrentMethod().DeclaringType);
|
||||
public event PromsPrinterStatusEvent StatusChanged;
|
||||
internal void OnStatusChanged(object sender, PromsPrintStatusArgs args)
|
||||
@@ -933,6 +942,9 @@ namespace Volian.Print.Library
|
||||
{
|
||||
MessageBox.Show("This procedure has no content and will not be printed.", "Empty Procedure", MessageBoxButtons.OK, MessageBoxIcon.Information);
|
||||
ProfileTimer.Pop(profileDepth);
|
||||
// B2024-062 Added check for EmptyProcedure. This is to prevent the Try Again message
|
||||
// from appearing after the user clicks on the OK button from the Empty Procedure message
|
||||
_EmptyProcedure = true;
|
||||
return null;
|
||||
}
|
||||
OnStatusChanged(myProcedure.DisplayNumber, PromsPrinterStatusType.ProgressSetup, myProcedure.Sections.Count);
|
||||
|
Reference in New Issue
Block a user