Merge pull request 'Development' (#450) from Development into master

Merging all development items into master after successful testing.
This commit is contained in:
Devin Jankowski 2024-10-31 09:11:59 -04:00
commit 4ffd994c5e
56 changed files with 3961 additions and 2271 deletions

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.

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.

Binary file not shown.

View File

@ -23,8 +23,8 @@ using System.Runtime.CompilerServices;
// Build YYMM (two digit year, two digit month)
// Revision DHH (day - no leading zero, two digit hour - military time
//
[assembly: AssemblyVersion("2.3.2404.1611")]
[assembly: AssemblyFileVersion("2.3.2404.1611")]
[assembly: AssemblyVersion("2.3.2410.907")]
[assembly: AssemblyFileVersion("2.3.2410.907")]
//
// In order to sign your assembly you must specify a key to use. Refer to the
@ -91,6 +91,8 @@ using System.Runtime.CompilerServices;

View File

@ -377,6 +377,7 @@ namespace ROEditor
this.btnOK.TabIndex = 3;
this.btnOK.Text = "OK";
this.btnOK.Click += new System.EventHandler(this.btnOK_Click);
this.btnOK.DialogResult = System.Windows.Forms.DialogResult.OK;
//
// btnCancel
//
@ -553,6 +554,7 @@ namespace ROEditor
// update the local/internal copy of the schema.
if (success != true)
{
this.DialogResult = DialogResult.Cancel;
return; // DO YET process an error.
}
else

View File

@ -266,6 +266,7 @@ namespace ROEditor
if (success != true)
{
this.DialogResult = DialogResult.Cancel;
return; // DO YET process an error.
}
else
@ -367,6 +368,7 @@ namespace ROEditor
//
// btnOK
//
this.btnOK.DialogResult = System.Windows.Forms.DialogResult.OK;
this.btnOK.Location = new System.Drawing.Point(216, 72);
this.btnOK.Name = "btnOK";
this.btnOK.Size = new System.Drawing.Size(88, 24);

View File

@ -220,6 +220,7 @@ namespace ROEditor
return;
}
string origFieldName = myrof.GetFieldname;
myrof.SetFieldname(this.tbFieldName.Text);
uint ftype=0;
if (this.rbSingleLine.Checked == true)
@ -247,6 +248,7 @@ namespace ROEditor
if (success != true)
{
this.DialogResult = DialogResult.Cancel;
return; // DO YET process an error.
}
return;
@ -270,7 +272,9 @@ namespace ROEditor
}
myrof.SetFieldType(ftype);
FieldTextFrm ftxt = new FieldTextFrm(myrof, myrodb, myelem, original_type, editlevel, origname, avlist, iulist);
ftxt.ShowDialog();
if (ftxt.ShowDialog() == DialogResult.Cancel)
myrof.SetFieldname(origFieldName);
this.Close();
}
#region Windows Form Designer generated code

View File

@ -100,6 +100,7 @@ using System.Text;
using RODBInterface;
using ROFields;
using VlnStatus;
using System.Linq;
namespace ROEditor
{
@ -245,6 +246,37 @@ namespace ROEditor
return CvtFldToUserFld(origGroup);
}
}
//CSM C2024-023
//Part of 2024 PROMS Upgrades
//When the Overall Form is activated
//if there are any items that are Fields that are in use
//add them as auto-complete options to the
//Accessory Page Access - Value Textbox
//Typing < will bring up the auto-complete options
protected void tbValue_AddAutoComplete(object sender, EventArgs e)
{
string dummy = ""; // need for RODB_GetFIeldsInUse call, won't be used.
ArrayList AvailList, InUseList;
//first see if it is a valid 'InUse' Field.
AvailList = myrodb.RODB_GetFields(elem, (uint)RecordType.Schema);
InUseList = myrodb.RODB_GetFieldsInUse(elem, AvailList, "FieldsInUse", ref dummy, false);
//if any ROField items are in use,
//use LINQ to get a string array of the FieldNames
if (InUseList.Count > 0)
{
string[] InUseListFieldNames = InUseList.OfType<ROField>().Select(x => $"<{x.GetFieldname}>").ToArray();
AutoCompleteStringCollection allowedTypes = new AutoCompleteStringCollection();
allowedTypes.AddRange(InUseListFieldNames);
tbValue.AutoCompleteCustomSource = allowedTypes;
tbValue.AutoCompleteMode = AutoCompleteMode.Suggest;
tbValue.AutoCompleteSource = AutoCompleteSource.CustomSource;
}
}
private void FillInData()
{
this.tbGroup.Text = DetermineGroupName();
@ -401,6 +433,7 @@ namespace ROEditor
//
// btnOK
//
this.btnOK.DialogResult = System.Windows.Forms.DialogResult.OK;
this.btnOK.Location = new System.Drawing.Point(24, 248);
this.btnOK.Name = "btnOK";
this.btnOK.Size = new System.Drawing.Size(144, 24);
@ -432,6 +465,7 @@ namespace ROEditor
this.Font = new System.Drawing.Font("Tahoma", 9F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((System.Byte)(0)));
this.Name = "GroupDefFrm";
this.Text = "Group Definition";
this.Activated += new EventHandler(tbValue_AddAutoComplete);
this.groupBox1.ResumeLayout(false);
this.ResumeLayout(false);

View File

@ -188,23 +188,23 @@ namespace ROEditor
lboxInUse.Visible = true;
lb_chkApplc.Visible = false;
}
if (editlevel==(uint)RecordType.GroupSchema)this.Text = "Subgroup Definition";
if (editlevel == (uint)RecordType.GroupSchema) this.Text = "Subgroup Definition";
FillInData(grptxt);
}
/// <summary>
/// Clean up any resources being used.
/// </summary>
protected override void Dispose( bool disposing )
protected override void Dispose(bool disposing)
{
if( disposing )
if (disposing)
{
if(components != null)
if (components != null)
{
components.Dispose();
}
}
base.Dispose( disposing );
base.Dispose(disposing);
}
private void FillInAvailable()
@ -212,9 +212,9 @@ namespace ROEditor
ROField rof;
// put the items in the AvailList box.
for (int i=0; i< AvailList.Count; i++)
for (int i = 0; i < AvailList.Count; i++)
{
rof = (ROField) AvailList[i];
rof = (ROField)AvailList[i];
if (rof.GetFieldname != null) // DO YET: Why null?
this.lboxAvail.Items.Add(rof.GetFieldname);
}
@ -297,7 +297,7 @@ namespace ROEditor
else
parent = null;
}
if (menuitm !="")
if (menuitm != "")
this.tbMenuVal.Text = CvtFldToUserFld(menuitm);
else
this.tbMenuVal.Text = "";
@ -310,21 +310,21 @@ namespace ROEditor
this.lblRetVal.Visible = true;
VlnXmlElement parent;
parent = (VlnXmlElement) elem.ParentNode;
while (parent != null && (menuitm == "" || retval==""))
while (parent != null && (menuitm == "" || retval == ""))
{
// walk up tree to get parent and check for data there
if (menuitm == "") menuitm = parent.GetAttribute("MenuItem");
if (retval == "") retval = parent.GetAttribute("RetVal");
if (parent.Name != "RO_Root")
parent = (VlnXmlElement) parent.ParentNode;
parent = (VlnXmlElement)parent.ParentNode;
else
parent = null;
}
if (menuitm!="")
if (menuitm != "")
this.tbMenuVal.Text = CvtFldToUserFld(menuitm);
else
this.tbMenuVal.Text = "";
if (retval!="")
if (retval != "")
this.tbRetVal.Text = CvtFldToUserFld(retval);
else
this.tbRetVal.Text = "";
@ -344,24 +344,27 @@ namespace ROEditor
lboxAvail.GotFocus += new EventHandler(this.lboxAvail_GotFocus);
lboxInUse.MouseUp += new System.Windows.Forms.MouseEventHandler(this.lboxInUse_MouseUp);
lboxInUseCB.MouseUp += new System.Windows.Forms.MouseEventHandler(this.lboxInUseCB_MouseUp);
// save copies of local data, so if there is a change, we know we must save them.
origRetVal=this.tbRetVal.Text;
origMenuItem=this.tbMenuVal.Text;
origRetVal = this.tbRetVal.Text;
origMenuItem = this.tbMenuVal.Text;
// if this is a database level definition & it's a user defined database,
// the okay button is disabled until a field is used.
if (elem.ParentNode.Name == "RO_Root" && dbtype==3)
if (elem.ParentNode.Name == "RO_Root" && dbtype == 3)
{
string attr;
if (editlevel==(uint)RecordType.Schema)
if (editlevel == (uint)RecordType.Schema)
attr = elem.GetAttribute("FieldsInUse");
else
attr = elem.GetAttribute("GroupFieldsInUse");
if (attr==null || attr=="") btnOK.Enabled=false;
if (attr == null || attr == "") btnOK.Enabled = false;
}
}
protected void lboxInUse_GotFocus (object sender, EventArgs e)
protected void lboxInUse_GotFocus(object sender, EventArgs e)
{
lboxAvail.ClearSelected();
this.btnRemove.Enabled = true;
@ -375,7 +378,7 @@ namespace ROEditor
this.btnAdd.Enabled = false;
this.btnEdit.Enabled = true;
}
protected void lboxAvail_GotFocus (object sender, EventArgs e)
protected void lboxAvail_GotFocus(object sender, EventArgs e)
{
if (PCApplicabilityEnabled)
lboxInUseCB.ClearSelected();
@ -385,6 +388,103 @@ namespace ROEditor
this.btnRemove.Enabled = false;
this.btnEdit.Enabled = true;
}
//CSM C2024-024
//Simple Selection of Fields to add to Return Values and Menu Values.
//Part of 2024 PROMS Upgrades
//Add Context Menu for In Use Listbox
//Will allow user to right click Selected Items
//and add then to the Return Value / Menu Value Text Boxes
//without re-typing them
protected void lboxInUse_MouseUp(object sender, MouseEventArgs e)
{
if (e.Button == MouseButtons.Right && lboxInUse.SelectedItems.Count > 0)
{
ContextMenuStrip cn = new ContextMenuStrip();
if (tbRetVal.Visible)
{
var AddToReturnItem = new ToolStripMenuItem("Add to Return Value");
AddToReturnItem.Click += new EventHandler(lboxInUse_Click);
AddToReturnItem.Name = "Add to Return Value";
cn.Items.Add(AddToReturnItem);
}
var AddToMenuItem = new ToolStripMenuItem("Add to Menu Value");
AddToMenuItem.Click += new EventHandler(lboxInUse_Click);
AddToMenuItem.Name = "Add to Menu Value";
cn.Items.Add(AddToMenuItem);
this.lboxInUse.ContextMenuStrip = cn;
cn.Show(Control.MousePosition.X, Control.MousePosition.Y);
}
}
private void lboxInUse_Click(object sender, EventArgs e)
{
switch (((ToolStripMenuItem)sender).Name)
{
case "Add to Return Value":
if (tbRetVal.Text == "")
tbRetVal.Text += $"<{lboxInUse.SelectedItem}>";
else
tbRetVal.Text += $" - <{lboxInUse.SelectedItem}>";
break;
case "Add to Menu Value":
if (tbMenuVal.Text == "")
tbMenuVal.Text += $"<{lboxInUse.SelectedItem}>";
else
tbMenuVal.Text += $" - <{lboxInUse.SelectedItem}>";
break;
}
}
//CSM C2024-024
//Simple Selection of Fields to add to Return Values and Menu Values.
//Part of 2024 PROMS Upgrades
//Add Context Menu for In Use ComboBox
//(Replaces In Use Listbox when Applicability
//to allow for selection of items per Unit)
//Will allow user to right click Selected Items
//and add then to the Return Value / Menu Value Text Boxes
//without re-typing them
protected void lboxInUseCB_MouseUp(object sender, MouseEventArgs e)
{
if (e.Button == MouseButtons.Right && lboxInUseCB.SelectedItems.Count > 0)
{
ContextMenuStrip cn = new ContextMenuStrip();
if (tbRetVal.Visible)
{
var AddToReturnItem = new ToolStripMenuItem("Add to Return Value");
AddToReturnItem.Click += new EventHandler(lboxInUseCB_Click);
AddToReturnItem.Name = "Add to Return Value";
cn.Items.Add(AddToReturnItem);
}
var AddToMenuItem = new ToolStripMenuItem("Add to Menu Value");
AddToMenuItem.Click += new EventHandler(lboxInUseCB_Click);
AddToMenuItem.Name = "Add to Menu Value";
cn.Items.Add(AddToMenuItem);
this.lboxInUseCB.ContextMenuStrip = cn;
cn.Show(Control.MousePosition.X, Control.MousePosition.Y);
}
}
private void lboxInUseCB_Click(object sender, EventArgs e)
{
switch (((ToolStripMenuItem)sender).Name)
{
case "Add to Return Value":
if (tbRetVal.Text == "")
tbRetVal.Text += $"<{lboxInUseCB.SelectedItem}>";
else
tbRetVal.Text += $" - <{lboxInUseCB.SelectedItem}>";
break;
case "Add to Menu Value":
if (tbMenuVal.Text == "")
tbMenuVal.Text += $"<{lboxInUseCB.SelectedItem}>";
else
tbMenuVal.Text += $" - <{lboxInUseCB.SelectedItem}>";
break;
}
}
private void btnRemove_Click(object sender, System.EventArgs e)
{
//get item in lboxInUse (in use list) and remove it from there
@ -404,7 +504,7 @@ namespace ROEditor
ROField copyrof = new ROField(rof.GetFieldname, rof.GetRecID, rof.GetMasterRecID, rof.GetFieldType);
AvailList.Add(copyrof);
lboxAvail.Items.Add(copyrof.GetFieldname);
lboxAvail.Items.Add(CvtFldToUserFld(copyrof.GetFieldname));
InUseList.RemoveAt(indx);
if (InUseApplcList.Contains(rof)) // C2021-026 remove from the field applicability list
InUseApplcList.Remove(rof);
@ -427,7 +527,7 @@ namespace ROEditor
ROField copyrof = new ROField(rof.GetFieldname, rof.GetRecID, rof.GetMasterRecID, rof.GetFieldType);
AvailList.Add(copyrof);
lboxAvail.Items.Add(copyrof.GetFieldname);
lboxAvail.Items.Add(CvtFldToUserFld(copyrof.GetFieldname));
InUseList.RemoveAt(indx);
if (InUseApplcList.Contains(rof)) // C2021-026 remove from the field applicability list
InUseApplcList.Remove(rof);
@ -455,7 +555,7 @@ namespace ROEditor
ROField copyrof = new ROField(rof.GetFieldname, rof.GetRecID, rof.GetMasterRecID, rof.GetFieldType);
InUseList.Add(copyrof);
lboxInUseCB.Items.Add(copyrof.GetFieldname);
lboxInUseCB.Items.Add(CvtFldToUserFld(copyrof.GetFieldname));
AvailList.RemoveAt(indx);
lboxAvail.Refresh();
lboxInUseCB.Refresh();
@ -477,7 +577,7 @@ namespace ROEditor
ROField copyrof = new ROField(rof.GetFieldname, rof.GetRecID, rof.GetMasterRecID, rof.GetFieldType);
InUseList.Add(copyrof);
lboxInUse.Items.Add(copyrof.GetFieldname);
lboxInUse.Items.Add(CvtFldToUserFld(copyrof.GetFieldname));
AvailList.RemoveAt(indx);
lboxAvail.Refresh();
lboxInUse.Refresh();
@ -640,7 +740,7 @@ namespace ROEditor
{
ROField rof = (ROField) InUseList[i];
rofname = rof.GetFieldname;
if (inusename == rofname)
if (inusename == rofname || inusename == CvtFldToUserFld(rofname))
{
found = true;
break;
@ -745,7 +845,7 @@ namespace ROEditor
{
ROField rof = (ROField) InUseList[i];
rofname = rof.GetFieldname;
if (inusename == rofname)
if (inusename == rofname || inusename == CvtFldToUserFld(rofname))
{
found = true;
break;
@ -1097,6 +1197,7 @@ namespace ROEditor
}
}
string origname = CvtFldToUserFld(rof.GetFieldname);
uint ftype = rof.GetFieldType;
if (ftype == (uint)FieldTypes.FrmtSingleTxt || ftype == (uint)FieldTypes.VariableTxt ||
ftype == (uint)FieldTypes.SingleTxt || ftype == (uint)FieldTypes.Table ||
@ -1112,6 +1213,10 @@ namespace ROEditor
nwcomb.ShowDialog();
}
//need to refresh pull from table for fields in use.
_ = myrodb.RODB_GetFields(elem, 0, true);
string newname = CvtFldToUserFld(rof.GetFieldname);
// Update Lists & Text boxes to represent any modified text.
if (isInSelList)
{
@ -1125,20 +1230,28 @@ namespace ROEditor
rof = (ROField) InUseList[i];
if (rof.GetFieldname != null)
{
string fieldname = CvtFldToUserFld(rof.GetFieldname);
// C2021-026 if doing Parent/Child enabled RO Editor, put the In Use fields in the Check Box List instead of the normal list
if (PCApplicabilityEnabled)
{
this.lboxInUseCB.Items.Add(rof.GetFieldname);
this.lboxInUseCB.Items.Add(fieldname);
if (rof.FieldTypeCanDoApplicability())
{
if (ContainedInUseApplicList(rof))
this.lboxInUseCB.SetItemCheckState(lboxInUseCB.Items.IndexOf(rof.GetFieldname), CheckState.Checked);
this.lboxInUseCB.SetItemCheckState(lboxInUseCB.Items.IndexOf(fieldname), CheckState.Checked);
}
}
else
this.lboxInUse.Items.Add(rof.GetFieldname);
this.lboxInUse.Items.Add(fieldname);
}
}
if (origname != newname)
{
tbMenuVal.Text = tbMenuVal.Text.Replace($"<{origname}>", $"<{newname}>");
tbRetVal.Text = tbRetVal.Text.Replace($"<{origname}>", $"<{newname}>");
}
}
else
{
@ -1148,7 +1261,7 @@ namespace ROEditor
{
rof = (ROField) AvailList[i];
if (rof.GetFieldname != null)
this.lboxAvail.Items.Add(rof.GetFieldname);
this.lboxAvail.Items.Add(CvtFldToUserFld(rof.GetFieldname));
}
}
}
@ -1162,8 +1275,11 @@ namespace ROEditor
if (rof.GetFieldname != null)
{
AvailList.Add(rof);
lboxAvail.Items.Add(rof.GetFieldname);
lboxAvail.Items.Add(CvtFldToUserFld(rof.GetFieldname));
}
//need to refresh pull from table for fields in use.
_ = myrodb.RODB_GetFields(elem, 0, true);
}
// C2021-026 Check/un-check field for Parent/Child values
private void lboxInUseCB_ItemCheck(object sender, ItemCheckEventArgs e)
@ -1397,6 +1513,7 @@ namespace ROEditor
this.btnCancel.Size = new System.Drawing.Size(80, 24);
this.btnCancel.TabIndex = 10;
this.btnCancel.Text = "Cancel";
//
// RODefFrm
//
@ -1419,6 +1536,71 @@ namespace ROEditor
this.PerformLayout();
}
//if User clicked save (DialogResult.OK) close the form
//if use did not click save, ask if they are sure they want to close the form
//only close if they say "Yes, they want to"
protected override void OnFormClosing(FormClosingEventArgs e)
{
if (this.DialogResult != System.Windows.Forms.DialogResult.OK && IsPendingChange() && !CloseCancel())
{
e.Cancel = true;
}
}
public static bool CloseCancel()
{
const string message = "Are you sure that you would like to cancel? Information may not be saved.";
const string caption = "Cancel";
var result = MessageBox.Show(message, caption,
MessageBoxButtons.YesNo,
MessageBoxIcon.Question);
return result == DialogResult.Yes;
}
//return true if a field has been modified
private bool IsPendingChange()
{
if (origRetVal != this.tbRetVal.Text)
return true;
if (origMenuItem != this.tbMenuVal.Text)
return true;
// check if in use records have changed
string inuserecs = null;
ROField rof;
for (int i = 0; i < InUseList.Count; i++)
{
rof = (ROField)InUseList[i];
if (rof.GetFieldname != null) //DO YET: why null?
{
inuserecs = inuserecs + rof.GetRecID;
if (i + 1 < InUseList.Count) inuserecs = inuserecs + " ";
}
}
if (inuserecs != origFieldsInUse)
return true;
//check if applicability fields have changed
string applicfieldrecs = null;
for (int i = 0; i < InUseApplcList.Count; i++)
{
rof = (ROField)InUseApplcList[i];
if (rof.GetFieldname != null)
{
applicfieldrecs = applicfieldrecs + rof.GetRecID;
if (i + 1 < InUseApplcList.Count) applicfieldrecs = applicfieldrecs + " ";
}
}
if (applicfieldrecs != origApplicFields)
return true;
//nothing has changed
return false;
}
#endregion
}
}

File diff suppressed because it is too large Load Diff

View File

@ -125,7 +125,7 @@
AAEAAAD/////AQAAAAAAAAAMAgAAAFdTeXN0ZW0uV2luZG93cy5Gb3JtcywgVmVyc2lvbj00LjAuMC4w
LCBDdWx0dXJlPW5ldXRyYWwsIFB1YmxpY0tleVRva2VuPWI3N2E1YzU2MTkzNGUwODkFAQAAACZTeXN0
ZW0uV2luZG93cy5Gb3Jtcy5JbWFnZUxpc3RTdHJlYW1lcgEAAAAERGF0YQcCAgAAAAkDAAAADwMAAACE
CAAAAk1TRnQBSQFMAgEBAgEAARwBAAEcAQABEAEAARABAAT/AQkBAAj/AUIBTQE2AQQGAAE2AQQCAAEo
CAAAAk1TRnQBSQFMAgEBAgEAASwBAAEsAQABEAEAARABAAT/AQkBAAj/AUIBTQE2AQQGAAE2AQQCAAEo
AwABQAMAARADAAEBAQABCAYAAQQYAAGAAgABgAMAAoABAAGAAwABgAEAAYABAAKAAgADwAEAAcAB3AHA
AQAB8AHKAaYBAAEzBQABMwEAATMBAAEzAQACMwIAAxYBAAMcAQADIgEAAykBAANVAQADTQEAA0IBAAM5
AQABgAF8Af8BAAJQAf8BAAGTAQAB1gEAAf8B7AHMAQABxgHWAe8BAAHWAucBAAGQAakBrQIAAf8BMwMA
@ -175,7 +175,7 @@
AAEAAAD/////AQAAAAAAAAAMAgAAAFdTeXN0ZW0uV2luZG93cy5Gb3JtcywgVmVyc2lvbj00LjAuMC4w
LCBDdWx0dXJlPW5ldXRyYWwsIFB1YmxpY0tleVRva2VuPWI3N2E1YzU2MTkzNGUwODkFAQAAACZTeXN0
ZW0uV2luZG93cy5Gb3Jtcy5JbWFnZUxpc3RTdHJlYW1lcgEAAAAERGF0YQcCAgAAAAkDAAAADwMAAAAe
CwAAAk1TRnQBSQFMAgEBBgEAARwBAAEcAQABEAEAARABAAT/AQkBAAj/AUIBTQE2AQQGAAE2AQQCAAEo
CwAAAk1TRnQBSQFMAgEBBgEAASwBAAEsAQABEAEAARABAAT/AQkBAAj/AUIBTQE2AQQGAAE2AQQCAAEo
AwABQAMAASADAAEBAQABCAYAAQgYAAGAAgABgAMAAoABAAGAAwABgAEAAYABAAKAAgADwAEAAcAB3AHA
AQAB8AHKAaYBAAEzBQABMwEAATMBAAEzAQACMwIAAxYBAAMcAQADIgEAAykBAANVAQADTQEAA0IBAAM5
AQABgAF8Af8BAAJQAf8BAAGTAQAB1gEAAf8B7AHMAQABxgHWAe8BAAHWAucBAAGQAakBrQIAAf8BMwMA

View File

@ -336,10 +336,10 @@ namespace RODBInterface
public abstract bool RODB_GetChildData(VlnXmlElement node, bool CheckChildCount);
public abstract bool IsDuplicateAccPageID(VlnXmlElement ro, string newacc);
public abstract VlnXmlElement RODB_ReadRO(string tbl, string recid);
public abstract bool RODB_WriteRO(VlnXmlElement ro);
public abstract bool RODB_WriteRO(VlnXmlElement ro, bool movedRO = false);
public abstract bool RODB_InsertRO(VlnXmlElement ro);
public abstract ushort RODB_GetFieldType(VlnXmlElement elem, string TableName, string Fld);
public abstract ArrayList RODB_GetFields(VlnXmlElement elem, uint rtype);
public abstract ArrayList RODB_GetFields(VlnXmlElement elem, uint rtype, bool refresh = false);
public abstract string RODB_GetSchemaPiece(string Recid, string table);
public abstract bool RODB_NewSchemaPiece(string recid, string parentid, string table, string schpiece, uint rtype);
public abstract bool RODB_WriteSchemaPiece(string Recid, string table, string schpiece);
@ -2120,7 +2120,7 @@ namespace RODBInterface
return retele;
}
public override bool RODB_WriteRO(VlnXmlElement ro)
public override bool RODB_WriteRO(VlnXmlElement ro, bool movedRO = false)
{
bool success;
if (ro.Name == "vlnGroup")
@ -2140,6 +2140,13 @@ namespace RODBInterface
string dt = string.Format("{0:yyyyMMddHHmmss}", System.DateTime.Now);
string xmlstr = GenerateXmlString(ro, false);
string strUpdate = "UPDATE " + ro.GetAttribute("Table") + " SET Info = '" + xmlstr + "'";
if (movedRO)
{
VlnXmlElement parent = (VlnXmlElement)ro.ParentNode;
ro.SetAttribute("ParentID", parent.GetAttribute("RecID"));
strUpdate += ", ParentID = '" + ro.GetAttribute("ParentID") + "'";
}
strUpdate = strUpdate + ", ModDateTime = '" + dt + "', AccPageID = '" + wraccid + "' WHERE RecID='" + ro.GetAttribute("RecID") + "'";
try
{
@ -2192,6 +2199,8 @@ namespace RODBInterface
ro.SetAttribute("HasChild", "False");
if (ro.HasAttribute("AccPageID"))
{
// Code is never reached, but this was noticed - this next line should likely be:
// strInsert = "INSERT INTO " + parent.GetAttribute("Table") + "( RecID, RecType, ParentID, AccPageID, ModDateTime, Info ) ";
strInsert = "INSERT INTO " + parent.GetAttribute("Table") + "( RecID, RecType, ParentID, ModDateTime, AccPageID, Info ) ";
strInsert = strInsert + " VALUES ('" + ro.GetAttribute("RecID") + "'," + (uint)RecordType.Group + ",'" + ro.GetAttribute("ParentID");
strInsert = strInsert + "','" + wraccid + "','" + dt + "','" + xmlstr + "');";
@ -2294,11 +2303,16 @@ namespace RODBInterface
}
// For the given element's table, get all of the RO fields defined in this table.
public override ArrayList RODB_GetFields(VlnXmlElement elem, uint rtype)
public override ArrayList RODB_GetFields(VlnXmlElement elem, uint rtype, bool refresh = false)
{
string table = elem.GetAttribute("Table");
if (!FieldDefinitions.ContainsKey(table))
FieldDefinitions.Add(table, RODB_GetFieldsFromDB(elem));
else if (refresh)
{
FieldDefinitions.Remove(table);
FieldDefinitions.Add(table, RODB_GetFieldsFromDB(elem));
}
return FieldDefinitions[table];
}
private Dictionary<string, ArrayList> _FieldDefinitions = null;
@ -2391,7 +2405,7 @@ namespace RODBInterface
Info = null;
DBE.ReaderClose();
DBE.CommandDispose();
return Info.Replace("&apos;", "\'");
return Info?.Replace("&apos;", "\'");
}
public override bool RODB_NewSchemaPiece(string recid, string parentid, string table, string schpiece, uint rtype)
@ -2666,8 +2680,8 @@ namespace RODBInterface
// Generic definition, i.e. all Groups, and No updates only Local definition, i.e. just this Group Added a
// Cancel button to Cancel from this dialog and return to previous dialog. Added more information to the
// dialog to inform user of this
string dmsg = "Update Generic definition?\r\n\r\n Yes - updates Generic definitions, \r\n No - updates Local definitions, \r\n Cancel - returns to previous dialog." +
"\r\n\r\n 'Generic' updates definition in ALL groups that use the name\r\n 'Local' updates definition only in the selected group.";
string dmsg = $"Update Generic definition?\r\n\r\n Yes - updates Generic definitions, \r\n No - updates Local definitions, \r\n Cancel - returns to previous dialog." +
$"\r\n\r\n 'Generic' updates definition in ALL groups that use the name\r\n 'Local' updates definition only in the selected group, and will change the definition for all items in that table ({GetTopParentName(myelem)}).";
System.Windows.Forms.DialogResult result = MessageBox.Show(dmsg, "Referenced Object Definition", MessageBoxButtons.YesNoCancel, MessageBoxIcon.Question);
if (result == DialogResult.Cancel) return false;
if (result == DialogResult.No) changegeneric = false;
@ -2772,6 +2786,19 @@ namespace RODBInterface
return success;
}
//CSM-C2024-030
//Explain that Local is local to that table (and include Table name in wording displayed to user)
public string GetTopParentName(VlnXmlElement elem)
{
VlnXmlElement nodetocheck = elem;
while (nodetocheck.GetAttribute("ParentID") != "00000000" && nodetocheck.ParentNode != null)
{
nodetocheck = (VlnXmlElement) nodetocheck.ParentNode;
}
return nodetocheck.FirstChild.InnerText;
}
public override XmlSchema RODB_GetGroupSchema(VlnXmlElement elem)
{
XmlSchema myschema;

View File

@ -1557,7 +1557,7 @@ namespace RODBInterface
}
return retele;
}
public override bool RODB_WriteRO(VlnXmlElement ro)
public override bool RODB_WriteRO(VlnXmlElement ro, bool movedRO = false)
{
bool success;
if (ro.Name == "vlnGroup")
@ -1589,6 +1589,13 @@ namespace RODBInterface
command.Parameters.AddWithValue("@ModDateTime", dt);
command.Parameters.AddWithValue("@AccPageID", wraccid); // B2020-003: set accpageid to correct value
command.Parameters.AddWithValue("@RecID", ro.GetAttribute("RecID"));
if (movedRO)
{
VlnXmlElement parent = (VlnXmlElement)ro.ParentNode;
ro.SetAttribute("ParentID", parent.GetAttribute("RecID"));
command.Parameters.AddWithValue("@ParentID", ro.GetAttribute("ParentID"));
}
using (SqlDataReader reader = command.ExecuteReader())
{
success = true;
@ -1744,13 +1751,18 @@ namespace RODBInterface
return ftype;
}
// For the given element's table, get all of the RO fields defined in this table.
public override ArrayList RODB_GetFields(VlnXmlElement elem, uint rtype)
public override ArrayList RODB_GetFields(VlnXmlElement elem, uint rtype, bool refresh = false)
{
string table = elem.GetAttribute("Table");
if (!FieldDefinitions.ContainsKey(table))
{
FieldDefinitions.Add(table, RODB_GetFieldsFromDB(elem));
}
else if (refresh)
{
FieldDefinitions.Remove(table);
FieldDefinitions.Add(table, RODB_GetFieldsFromDB(elem));
}
return FieldDefinitions[table];
}
private Dictionary<string, ArrayList> _FieldDefinitions = null;
@ -1909,7 +1921,7 @@ namespace RODBInterface
command.Parameters.AddWithValue("@RecID", Recid);
using (SqlDataReader reader = command.ExecuteReader())
{
if (DBE.Read())
if (reader.Read())
Info = reader.GetString(0);
else
Info = null;

View File

@ -85,7 +85,7 @@ namespace VlnStatus
this.lblStatMsg.Name = "lblStatMsg";
this.lblStatMsg.Size = new System.Drawing.Size(420, 81);
this.lblStatMsg.TabIndex = 0;
this.lblStatMsg.Text = "Put Satus Message Here";
this.lblStatMsg.Text = "Put Status Message Here";
this.lblStatMsg.TextAlign = System.Drawing.ContentAlignment.MiddleCenter;
//
// StatusMessageFrm

View File

@ -23798,7 +23798,7 @@ BEGIN TRY -- Try Block
--then remove the link from the copy
--if original item was not linked, update new items to not be linked
DECLARE @xconfig XML = (Select cast(config as xml) xconfig from Contents where ContentID = @ContentID);
IF @xconfig.exist('//Enhanced[1]') = 0
IF ISNULL(@xconfig.exist('//Enhanced[1]'),0) = 0
BEGIN
UPDATE Contents SET Config = dbo.vefn_RemoveEnhanced(Contents.Config)
Where ContentID in (Select ContentID FROM vefn_ChildItems(@NewItemID))
@ -23904,12 +23904,201 @@ GO
IF (@@Error = 0) PRINT 'Procedure Creation: [PasteItemReplace] Succeeded'
ELSE PRINT 'Procedure Creation: [PasteItemReplace] Error on Creation'
GO
-- SP: AddDisplayTabState
SET QUOTED_IDENTIFIER ON
GO
IF EXISTS (SELECT * FROM dbo.sysobjects WHERE id = OBJECT_ID(N'[AddDisplayTabState]') AND OBJECTPROPERTY(id,N'IsProcedure') = 1)
DROP PROCEDURE [AddDisplayTabState];
GO
-- =============================================
-- Author: Paul Larsen
-- Create date: 9/18/2024
-- Description: Save current open tab state in PROMS editor.
-- =============================================
CREATE PROCEDURE [dbo].[AddDisplayTabState]
(
@ItemID int,
@DisplayTabID varchar(30),
@DisplayTabName varchar(100),
@userID varchar(100),
@order int
)
AS
BEGIN
-- SET NOCOUNT ON added to prevent extra result sets from
-- interfering with SELECT statements.
SET NOCOUNT ON;
-- Remove all records
-- DELETE FROM [dbo].[DisplayTabTmp];
-- Record current tab information
INSERT INTO [dbo].[DisplayTabTmp] (itemid,DisplayTabID,DisplayTabName,userid,active, taborder)
VALUES (@ItemID,@DisplayTabID,@DisplayTabName,@userID, 1, @order)
END
GO
-- SP: GetDisplayTabdata
IF EXISTS (SELECT * FROM dbo.sysobjects WHERE id = OBJECT_ID(N'[GetDisplayTabdata]') AND OBJECTPROPERTY(id,N'IsProcedure') = 1)
DROP PROCEDURE [GetDisplayTabdata];
GO
/****** Object: StoredProcedure [dbo].[GetDisplayTabdata] Script Date: 10/3/2024 11:29:44 AM ******/
SET ANSI_NULLS ON
GO
SET QUOTED_IDENTIFIER ON
GO
-- =============================================
-- Author: Paul Larsen
-- Create date: 09/18/2024
-- Description: retrieve PROMS edit tab saved state.
-- =============================================
CREATE PROCEDURE [dbo].[GetDisplayTabdata]
(
@UserID varchar(100)
)
AS
BEGIN
-- SET NOCOUNT ON added to prevent extra result sets from
-- interfering with SELECT statements.
SET NOCOUNT ON;
SELECT [ItemID]
,[DisplayTabID]
,[DisplayTabName]
,[UpdateDate]
,[UserID]
,[taborder]
FROM [dbo].[DisplayTabTmp]
WHERE UserID = @UserID AND Active = 1
order by taborder
END
GO
-- SP: DeactivateStateDisplayTabTmp
IF EXISTS (SELECT * FROM dbo.sysobjects WHERE id = OBJECT_ID(N'[DeactivateStateDisplayTabTmp]') AND OBJECTPROPERTY(id,N'IsProcedure') = 1)
DROP PROCEDURE [DeactivateStateDisplayTabTmp];
GO
/****** Object: StoredProcedure [dbo].[DeactivateStateDisplayTabTmp] Script Date: 10/3/2024 11:30:53 AM ******/
SET ANSI_NULLS ON
GO
SET QUOTED_IDENTIFIER ON
GO
-- =============================================
-- Author: Paul Larsen
-- Create date: 10/1/2024
-- Description: Set PROMES Edit window tabs state inactive.
-- =============================================
CREATE procedure [dbo].[DeactivateStateDisplayTabTmp]
(
@UserID varchar(100)
)
AS
UPDATE [dbo].[DisplayTabTmp]
SET Active = 0
WHERE UserID = @UserID
GO
-- Table: DisplayTabTmp
-- If DisplayTabTmp table already exists then don't drop and recreate it
IF Not Exists(SELECT * FROM sys.objects Where name = 'DisplayTabTmp' AND type in (N'U'))
Begin
SET ANSI_NULLS ON
SET QUOTED_IDENTIFIER ON
-- =============================================
-- Author: Paul Larsen
-- Create date: 9/30/2024
-- Description: Table to hold tab state in PROMS editor.
-- =============================================
/****** Object: Table [dbo].[DisplayTabTmp] Script Date: 10/3/2024 11:22:00 AM ******/
CREATE TABLE [dbo].[DisplayTabTmp](
[ID] [int] IDENTITY(1,1) NOT NULL,
[ItemID] [int] NOT NULL,
[DisplayTabID] [nvarchar](100) NOT NULL,
[DisplayTabName] [nchar](100) NOT NULL,
[UpdateDate] [datetime] NOT NULL,
[UserID] [nchar](100) NOT NULL,
[Active] [bit] NOT NULL,
[taborder] [int] NOT NULL
) ON [PRIMARY]
ALTER TABLE [dbo].[DisplayTabTmp] ADD CONSTRAINT [DF_DisplayTabTmp_UpdateDate] DEFAULT (getdate()) FOR [UpdateDate]
ALTER TABLE [dbo].[DisplayTabTmp] ADD CONSTRAINT [DF_DisplayTabTmp_Active] DEFAULT ((1)) FOR [Active]
ALTER TABLE [dbo].[DisplayTabTmp] ADD DEFAULT ((0)) FOR [taborder]
End
GO
/*
==========================================================================================================
End: C2017-031: SQL to allow copy/replace enhanced step
==========================================================================================================
*/
---The following RememberOpenTabs/AlwaysOpenTabs columns were added for Remeber Open Tabs.
--- RememberOpenTabs = Do not prompt User when PROMS opens
--- AutoOpenTabs = OpenTabs when PROMS opens - Default to On
IF NOT EXISTS(SELECT *
FROM INFORMATION_SCHEMA.COLUMNS
WHERE TABLE_NAME = 'Users'
AND COLUMN_NAME = 'RememberOpenTabs')
ALTER TABLE Users ADD RememberOpenTabs bit NOT NULL DEFAULT(0);
go
-- Display the status
IF (@@Error = 0) PRINT 'Altered table [Users] Succeeded for RememberOpenTabs'
ELSE PRINT 'Altered table [Users] Error on Alter for RememberOpenTabs'
go
IF NOT EXISTS(SELECT *
FROM INFORMATION_SCHEMA.COLUMNS
WHERE TABLE_NAME = 'Users'
AND COLUMN_NAME = 'AutoOpenTabs')
ALTER TABLE Users ADD AutoOpenTabs bit NOT NULL DEFAULT(1);
go
-- Display the status
IF (@@Error = 0) PRINT 'Altered table [Users] Succeeded for AutoOpenTabs'
ELSE PRINT 'Altered table [Users] Error on Alter for AutoOpenTabs'
go
/****** Object: StoredProcedure [dbo].[vesp_UpdateUserSettings] Script Date: 10/24/2024 11:29:44 AM ******/
IF EXISTS (SELECT * FROM dbo.sysobjects WHERE id = OBJECT_ID(N'[vesp_UpdateUserSettings]') AND OBJECTPROPERTY(id,N'IsProcedure') = 1)
DROP PROCEDURE [vesp_UpdateUserSettings];
GO
SET ANSI_NULLS ON
GO
SET QUOTED_IDENTIFIER ON
GO
-- =============================================
-- Author: Matthew Schill
-- Create date: 10/24/2024
-- Description: Update User Settings
-- =============================================
CREATE PROCEDURE [dbo].[vesp_UpdateUserSettings]
(
@UID varchar(100),
@Remember bit = null,
@AutoOpen bit = null
)
WITH EXECUTE AS OWNER
AS
UPDATE Users SET
RememberOpenTabs = ISNULL(@Remember,RememberOpenTabs),
AutoOpenTabs = ISNULL(@AutoOpen,AutoOpenTabs)
WHERE UserID =@UID
RETURN
GO
IF (@@Error = 0) PRINT 'Running vesp_UpdateUserSettings Succeeded'
ELSE PRINT 'Running vesp_UpdateUserSettings Failed to Execute'
GO
/*
---------------------------------------------------------------------------
| ADD New Code Before this Block |
@ -23943,8 +24132,8 @@ BEGIN TRY -- Try Block
DECLARE @RevDate varchar(255)
DECLARE @RevDescription varchar(255)
set @RevDate = '09/26/2024 11:24'
set @RevDescription = 'SQL to allow copy/replace enhanced step.'
set @RevDate = '10/28/2024 11:24'
set @RevDescription = 'Add the ability for PROMS to remember the procedure tabs that were open when you closed PROMS'
Select cast(@RevDate as datetime) RevDate, @RevDescription RevDescription
PRINT 'SQL Code Revision ' + @RevDate + ' - ' + @RevDescription

View File

@ -674,7 +674,8 @@ CREATE PROCEDURE [dbo].[updateInfoAccidByRecid]
@RecID char(8),
@AccPageID char(32),
@Info nvarchar(max),
@ModDateTime char(14)
@ModDateTime char(14),
@ParentID varchar(8) = NULL
)
WITH EXECUTE AS OWNER
AS
@ -684,7 +685,8 @@ BEGIN TRY -- Try Block
SET
[Info]=@Info,
[ModDateTime]=@ModDateTime,
[AccPageID]=@AccPageID
[AccPageID]=@AccPageID,
[ParentID]=ISNULL(@ParentID, ParentID)
WHERE [ROTable]=@ROTable AND [RecID]=@RecID
IF @@ROWCOUNT = 0
BEGIN

View File

@ -163,6 +163,12 @@
<Compile Include="dlgCheckedOutProcedure.designer.cs">
<DependentUpon>dlgCheckedOutProcedure.cs</DependentUpon>
</Compile>
<Compile Include="dlgCheckOpenTabs.cs">
<SubType>Form</SubType>
</Compile>
<Compile Include="dlgCheckOpenTabs.Designer.cs">
<DependentUpon>dlgCheckOpenTabs.cs</DependentUpon>
</Compile>
<Compile Include="DlgCloseTabsOrExit.cs">
<SubType>Form</SubType>
</Compile>
@ -324,6 +330,9 @@
<SubType>Designer</SubType>
<DependentUpon>AboutVEPROMS.cs</DependentUpon>
</EmbeddedResource>
<EmbeddedResource Include="dlgCheckOpenTabs.resx">
<DependentUpon>dlgCheckOpenTabs.cs</DependentUpon>
</EmbeddedResource>
<EmbeddedResource Include="DlgCloseTabsOrExit.resx">
<DependentUpon>DlgCloseTabsOrExit.cs</DependentUpon>
</EmbeddedResource>

View File

@ -0,0 +1,116 @@

namespace VEPROMS
{
partial class dlgCheckOpenTabs
{
/// <summary>
/// Required designer variable.
/// </summary>
private System.ComponentModel.IContainer components = null;
/// <summary>
/// Clean up any resources being used.
/// </summary>
/// <param name="disposing">true if managed resources should be disposed; otherwise, false.</param>
protected override void Dispose(bool disposing)
{
if (disposing && (components != null))
{
components.Dispose();
}
base.Dispose(disposing);
}
#region Windows Form Designer generated code
/// <summary>
/// Required method for Designer support - do not modify
/// the contents of this method with the code editor.
/// </summary>
private void InitializeComponent()
{
this.labelX1 = new DevComponents.DotNetBar.LabelX();
this.cbRemember = new DevComponents.DotNetBar.Controls.CheckBoxX();
this.btnOpenTabs = new DevComponents.DotNetBar.ButtonX();
this.btnNoTabs = new DevComponents.DotNetBar.ButtonX();
this.SuspendLayout();
//
// labelX1
//
//
//
//
this.labelX1.BackgroundStyle.CornerType = DevComponents.DotNetBar.eCornerType.Square;
this.labelX1.Font = new System.Drawing.Font("Microsoft Sans Serif", 12F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(0)));
this.labelX1.Location = new System.Drawing.Point(23, 2);
this.labelX1.Name = "labelX1";
this.labelX1.Size = new System.Drawing.Size(363, 78);
this.labelX1.TabIndex = 0;
this.labelX1.Text = "Would you like for PROMS to reopen the tabs that you had open during your last se" +
"ssion?";
this.labelX1.WordWrap = true;
//
// cbRemember
//
//
//
//
this.cbRemember.BackgroundStyle.CornerType = DevComponents.DotNetBar.eCornerType.Square;
this.cbRemember.Location = new System.Drawing.Point(23, 75);
this.cbRemember.Name = "cbRemember";
this.cbRemember.Size = new System.Drawing.Size(376, 47);
this.cbRemember.Style = DevComponents.DotNetBar.eDotNetBarStyle.StyleManagerControlled;
this.cbRemember.TabIndex = 1;
this.cbRemember.Text = "Check this box to not be prompted in the future when opening PROMS. \nNote that th" +
"ese settings can be adjusted at any time from the \nOPTIONS menu for PROMS.";
//
// btnOpenTabs
//
this.btnOpenTabs.AccessibleRole = System.Windows.Forms.AccessibleRole.PushButton;
this.btnOpenTabs.ColorTable = DevComponents.DotNetBar.eButtonColor.OrangeWithBackground;
this.btnOpenTabs.DialogResult = System.Windows.Forms.DialogResult.Yes;
this.btnOpenTabs.Location = new System.Drawing.Point(23, 139);
this.btnOpenTabs.Name = "btnOpenTabs";
this.btnOpenTabs.Size = new System.Drawing.Size(150, 42);
this.btnOpenTabs.Style = DevComponents.DotNetBar.eDotNetBarStyle.StyleManagerControlled;
this.btnOpenTabs.TabIndex = 2;
this.btnOpenTabs.Text = "Yes, Open Tabs from Last Session";
this.btnOpenTabs.Click += new System.EventHandler(this.btnTabs_Click);
//
// btnNoTabs
//
this.btnNoTabs.AccessibleRole = System.Windows.Forms.AccessibleRole.PushButton;
this.btnNoTabs.ColorTable = DevComponents.DotNetBar.eButtonColor.OrangeWithBackground;
this.btnNoTabs.DialogResult = System.Windows.Forms.DialogResult.No;
this.btnNoTabs.Location = new System.Drawing.Point(216, 139);
this.btnNoTabs.Name = "btnNoTabs";
this.btnNoTabs.Size = new System.Drawing.Size(150, 42);
this.btnNoTabs.Style = DevComponents.DotNetBar.eDotNetBarStyle.StyleManagerControlled;
this.btnNoTabs.TabIndex = 3;
this.btnNoTabs.Text = "No, Do Not Open Tabs from Previous Session";
this.btnNoTabs.Click += new System.EventHandler(this.btnTabs_Click);
//
// dlgCheckOpenTabs
//
this.AutoScaleDimensions = new System.Drawing.SizeF(6F, 13F);
this.AutoScaleMode = System.Windows.Forms.AutoScaleMode.Font;
this.ClientSize = new System.Drawing.Size(411, 193);
this.ControlBox = false;
this.Controls.Add(this.btnNoTabs);
this.Controls.Add(this.btnOpenTabs);
this.Controls.Add(this.cbRemember);
this.Controls.Add(this.labelX1);
this.Name = "dlgCheckOpenTabs";
this.Text = "Open Tabs from Previous Session";
this.ResumeLayout(false);
}
#endregion
private DevComponents.DotNetBar.LabelX labelX1;
private DevComponents.DotNetBar.Controls.CheckBoxX cbRemember;
private DevComponents.DotNetBar.ButtonX btnOpenTabs;
private DevComponents.DotNetBar.ButtonX btnNoTabs;
}
}

View File

@ -0,0 +1,28 @@
using System;
using System.Collections.Generic;
using System.ComponentModel;
using System.Data;
using System.Drawing;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
using System.Windows.Forms;
namespace VEPROMS
{
public partial class dlgCheckOpenTabs : Form
{
public dlgCheckOpenTabs()
{
InitializeComponent();
}
public bool Remember { get; set; } = false;
private void btnTabs_Click(object sender, EventArgs e)
{
Remember = this.cbRemember.Checked;
this.Close();
}
}
}

View File

@ -0,0 +1,120 @@
<?xml version="1.0" encoding="utf-8"?>
<root>
<!--
Microsoft ResX Schema
Version 2.0
The primary goals of this format is to allow a simple XML format
that is mostly human readable. The generation and parsing of the
various data types are done through the TypeConverter classes
associated with the data types.
Example:
... ado.net/XML headers & schema ...
<resheader name="resmimetype">text/microsoft-resx</resheader>
<resheader name="version">2.0</resheader>
<resheader name="reader">System.Resources.ResXResourceReader, System.Windows.Forms, ...</resheader>
<resheader name="writer">System.Resources.ResXResourceWriter, System.Windows.Forms, ...</resheader>
<data name="Name1"><value>this is my long string</value><comment>this is a comment</comment></data>
<data name="Color1" type="System.Drawing.Color, System.Drawing">Blue</data>
<data name="Bitmap1" mimetype="application/x-microsoft.net.object.binary.base64">
<value>[base64 mime encoded serialized .NET Framework object]</value>
</data>
<data name="Icon1" type="System.Drawing.Icon, System.Drawing" mimetype="application/x-microsoft.net.object.bytearray.base64">
<value>[base64 mime encoded string representing a byte array form of the .NET Framework object]</value>
<comment>This is a comment</comment>
</data>
There are any number of "resheader" rows that contain simple
name/value pairs.
Each data row contains a name, and value. The row also contains a
type or mimetype. Type corresponds to a .NET class that support
text/value conversion through the TypeConverter architecture.
Classes that don't support this are serialized and stored with the
mimetype set.
The mimetype is used for serialized objects, and tells the
ResXResourceReader how to depersist the object. This is currently not
extensible. For a given mimetype the value must be set accordingly:
Note - application/x-microsoft.net.object.binary.base64 is the format
that the ResXResourceWriter will generate, however the reader can
read any of the formats listed below.
mimetype: application/x-microsoft.net.object.binary.base64
value : The object must be serialized with
: System.Runtime.Serialization.Formatters.Binary.BinaryFormatter
: and then encoded with base64 encoding.
mimetype: application/x-microsoft.net.object.soap.base64
value : The object must be serialized with
: System.Runtime.Serialization.Formatters.Soap.SoapFormatter
: and then encoded with base64 encoding.
mimetype: application/x-microsoft.net.object.bytearray.base64
value : The object must be serialized into a byte array
: using a System.ComponentModel.TypeConverter
: and then encoded with base64 encoding.
-->
<xsd:schema id="root" xmlns="" xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns:msdata="urn:schemas-microsoft-com:xml-msdata">
<xsd:import namespace="http://www.w3.org/XML/1998/namespace" />
<xsd:element name="root" msdata:IsDataSet="true">
<xsd:complexType>
<xsd:choice maxOccurs="unbounded">
<xsd:element name="metadata">
<xsd:complexType>
<xsd:sequence>
<xsd:element name="value" type="xsd:string" minOccurs="0" />
</xsd:sequence>
<xsd:attribute name="name" use="required" type="xsd:string" />
<xsd:attribute name="type" type="xsd:string" />
<xsd:attribute name="mimetype" type="xsd:string" />
<xsd:attribute ref="xml:space" />
</xsd:complexType>
</xsd:element>
<xsd:element name="assembly">
<xsd:complexType>
<xsd:attribute name="alias" type="xsd:string" />
<xsd:attribute name="name" type="xsd:string" />
</xsd:complexType>
</xsd:element>
<xsd:element name="data">
<xsd:complexType>
<xsd:sequence>
<xsd:element name="value" type="xsd:string" minOccurs="0" msdata:Ordinal="1" />
<xsd:element name="comment" type="xsd:string" minOccurs="0" msdata:Ordinal="2" />
</xsd:sequence>
<xsd:attribute name="name" type="xsd:string" use="required" msdata:Ordinal="1" />
<xsd:attribute name="type" type="xsd:string" msdata:Ordinal="3" />
<xsd:attribute name="mimetype" type="xsd:string" msdata:Ordinal="4" />
<xsd:attribute ref="xml:space" />
</xsd:complexType>
</xsd:element>
<xsd:element name="resheader">
<xsd:complexType>
<xsd:sequence>
<xsd:element name="value" type="xsd:string" minOccurs="0" msdata:Ordinal="1" />
</xsd:sequence>
<xsd:attribute name="name" type="xsd:string" use="required" />
</xsd:complexType>
</xsd:element>
</xsd:choice>
</xsd:complexType>
</xsd:element>
</xsd:schema>
<resheader name="resmimetype">
<value>text/microsoft-resx</value>
</resheader>
<resheader name="version">
<value>2.0</value>
</resheader>
<resheader name="reader">
<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=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089</value>
</resheader>
</root>

File diff suppressed because it is too large Load Diff

View File

@ -11,6 +11,7 @@ using DevComponents.DotNetBar;
using VEPROMS.Properties;
using Volian.Base.Library;
using DescriptiveEnum;
using VEPROMS.CSLA.Library;
namespace VEPROMS
{
@ -24,6 +25,9 @@ namespace VEPROMS
get { return _CanChangeSeparateWindowsSetting; }
set { _CanChangeSeparateWindowsSetting = value; }
}
private UserSettings _usersettings;
public frmSysOptions()
{
_initializing = true;
@ -89,6 +93,13 @@ namespace VEPROMS
break;
}
//CSM - C2024-031 - Getting User Settings
//and set checkboxes based on what they are set to
_usersettings = new UserSettings(VlnSettings.UserID);
cbOTRemember.Checked = _usersettings.UserSetting_OpenTabs_Remember;
cbOTAutoOpen.Enabled = cbOTAutoOpen.Visible = cbOTRemember.Checked;
cbOTAutoOpen.Checked = _usersettings.UserSetting_OpenTabs_AutoOpen || !cbOTRemember.Checked;
}
private void cbEnhancedDocumentSync_CheckedChanged(object sender, System.EventArgs e)
{
@ -151,6 +162,15 @@ namespace VEPROMS
Settings.Default.PropPageStyle = 3;
Settings.Default.Save();
//CSM - C2024-031 - Save User Settings
//based on what checkboxes are set to
bool? OTAuto = null;
if (cbOTRemember.Checked)
{
OTAuto = cbOTAutoOpen.Checked;
}
_usersettings.SetUserSettings(cbOTRemember.Checked, OTAuto);
this.DialogResult = DialogResult.OK;
this.Close();
}
@ -324,5 +344,10 @@ namespace VEPROMS
Settings.Default.UCFImportOpt = 4;
}
}
}
private void cbOTRemember_CheckedChanged(object sender, EventArgs e)
{
cbOTAutoOpen.Enabled = cbOTAutoOpen.Visible = cbOTRemember.Checked;
}
}
}

View File

@ -112,21 +112,20 @@
<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="superTooltip1.TrayLocation" type="System.Drawing.Point, System.Drawing, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a">
<metadata name="superTooltip1.TrayLocation" type="System.Drawing.Point, System.Drawing, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a">
<value>17, 17</value>
</metadata>
<assembly alias="System.Drawing" name="System.Drawing, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a" />
<assembly alias="System.Drawing" name="System.Drawing, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a" />
<data name="colorPickerButton1.Image" type="System.Drawing.Bitmap, System.Drawing" mimetype="application/x-microsoft.net.object.bytearray.base64">
<value>
iVBORw0KGgoAAAANSUhEUgAAABAAAAAQCAYAAAAf8/9hAAAAAXNSR0IArs4c6QAAAARnQU1BAACxjwv8
YQUAAAAgY0hSTQAAeiYAAICEAAD6AAAAgOgAAHUwAADqYAAAOpgAABdwnLpRPAAAAAlwSFlzAAAScQAA
EnEB89x6jgAAACpJREFUOE9j+P//P0UYQgApcjCKASCaFDxqwKgBIDwcDSAHww0gH/9nAACxLJWH1IMf
ngAAAABJRU5ErkJggg==
iVBORw0KGgoAAAANSUhEUgAAABAAAAAQCAYAAAAf8/9hAAAABGdBTUEAALGPC/xhBQAAACBjSFJNAAB6
JgAAgIQAAPoAAACA6AAAdTAAAOpgAAA6mAAAF3CculE8AAAACXBIWXMAABJxAAAScQHz3HqOAAAAKklE
QVQ4T2P4//8/RRhCAClyMIoBIJoUPGrAqAEgPBwNIAfDDSAf/2cAALEslYfUgx+eAAAAAElFTkSuQmCC
</value>
</data>
<data name="$this.Icon" type="System.Drawing.Icon, System.Drawing" mimetype="application/x-microsoft.net.object.bytearray.base64">

View File

@ -1654,6 +1654,10 @@ namespace VEPROMS
// B2017-214 added a null reference check
// B2010-071 Since we cannot tell if the user click on the X in Word or the X in PROMS, ask if the current tab
// should be closed or if we should exit PROMS or just Cancel to continue working
if (tc._MyDisplayTabItems.Count < 1) // If all thabs are closed in the editor will indicate that in the database.
{
VEPROMS.CSLA.Library.Item.DeactivateStateDisplayTabTmp(MySessionInfo.UserID);
}
if (!_WeAreExitingPROMS && !ClosingWithError && tc.SelectedDisplayTabItem != null && tc._MyDisplayTabItems.Count > 0)
{
// B2019-071 dialog to ask user if we are to close one tab or exit
@ -1676,10 +1680,32 @@ namespace VEPROMS
{
// 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)
if (_WeAreExitingPROMS)
{
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 +2346,48 @@ namespace VEPROMS
CurrentID = txtSearch.Text;
}
}
// Add retrieve displaytabs state here.
openDisplaytabstate();
}
public void openDisplaytabstate()
{
// Retrieve edit tab state from database.
DataTable DisPlayTabState = VEPROMS.CSLA.Library.Item.GetDisplayTabs(VlnSettings.UserID);
//CSM - C2024-031 - Getting User Settings
//and set checkboxes based on what they are set to
UserSettings usersettings = new UserSettings(VlnSettings.UserID);
if (DisPlayTabState.Rows.Count > 0 && (usersettings.UserSetting_OpenTabs_AutoOpen || !usersettings.UserSetting_OpenTabs_Remember))
{
//will open tabs by default / ask by default
DialogResult result = DialogResult.Yes;
if (!usersettings.UserSetting_OpenTabs_Remember)
{
dlgCheckOpenTabs checkOpenTabs = new dlgCheckOpenTabs();
result = checkOpenTabs.ShowDialog();
//if checkbox was checked in form, then update User Settings in database
if (checkOpenTabs.Remember)
usersettings.SetUserSettings(true, result == DialogResult.Yes);
}
if (result == DialogResult.Yes)
{
foreach (DataRow TabState in DisPlayTabState.Rows)
{
int _ItemID = (int)TabState["ItemID"];
ItemInfo _Procedure = ItemInfo.Get(_ItemID);
// Open procedure in the editor.
OpenItem(_Procedure);
// SelectedStepTabPanel needs to be set so the print buttons on the ribbon will work.
SelectedStepTabPanel = tc.MyEditItem.MyStepPanel.MyStepTabPanel;
}
}
}
}
void tc_RefreshEnhancedDocument(object sender, ItemSelectedChangedEventArgs args)

View File

@ -474,6 +474,25 @@ namespace VEPROMS.CSLA.Library
OnPropertyChanged("Step_FixedTblForSrch");
}
}
//CSM F2024-080: For South Texas - Ability to toggle off Initial Line
public bool Step_DisableInitialLine
{
get
{
string s = _Xp["Step", "DisableInitialLine"];
if (s == string.Empty) return false;
if (s == "True") return true;
return false;
}
set
{
string s = _Xp["Step", "DisableInitialLine"];
if (value.ToString() == s) return;
_Xp["Step", "DisableInitialLine"] = value.ToString();
OnPropertyChanged("Step_DisableInitialLine");
}
}
#region RO image sizing
// if the RO image (figure) is resized, save it in the step config, not in the ROImageConfig. If stored in ROImageConfig
// the size is set for ALL uses.

View File

@ -1165,13 +1165,17 @@ namespace VEPROMS.CSLA.Library
{
int sp = odte.Link.IndexOf(" ") + 1; // get past tran type
string srecid = odte.Link.Substring(sp, odte.Link.IndexOf(" ", sp) - sp);
recid = System.Convert.ToInt32(srecid);
foreach (ContentTransition ct in itm.MyContent.ContentTransitions)
//CSM B2024-078 - when a bad transition link / does not contain a number, simply return the text as-is
if (int.TryParse(srecid, out recid))
{
if (ct.TransitionID == recid)
foreach (ContentTransition ct in itm.MyContent.ContentTransitions)
{
itm.MyContent.ContentTransitions.Remove(ct);
break;
if (ct.TransitionID == recid)
{
itm.MyContent.ContentTransitions.Remove(ct);
break;
}
}
}
}
@ -1656,7 +1660,15 @@ namespace VEPROMS.CSLA.Library
private string FixTransition(string link, string text)
{
if (link.IndexOf("<NewID>") != -1) return text;
int transitionID = Convert.ToInt32(link.Split(" ".ToCharArray())[1]);
//CSM B2024-078 - when a bad transition link / does not contain a number, simply return the text as-is
int transitionID;
string[] splt_link = link.Split(' ');
if (splt_link.Length < 2 || !int.TryParse(splt_link[1], out transitionID))
{
return text;
}
// Find the transition
if (_MyItemInfo.MyContent.ContentTransitionCount <= 0)
{

View File

@ -4251,6 +4251,13 @@ namespace VEPROMS.CSLA.Library
if (tbformat.Contains("{!.+?}"))
tstr = tbformat.Replace("{!.+?}", " "); // Comanche Peak Indented Paragraph
_MyTab.Text = tstr;
//CSM F2024 - 080: For South Texas - if format contains initial line and it is not disabled, show an initial line
if (!string.IsNullOrEmpty(FormatStepData.TabData.MacroEditTag) && FormatStepData.TabData.MacroList != null && FormatStepData.TabData.MacroList.Count > 0 && !(this.IsRNOPart && FormatStepData.TabData.MacroList[0].NotInRNO) && !IsInitialLineDisabled)
{
if (tstr.StartsWith(" "))
tstr = tstr.Substring(1);
tstr = FormatStepData.TabData.MacroEditTag + tstr;
}
_MyTab.CleanText = tstr;
return;
}
@ -4341,25 +4348,73 @@ namespace VEPROMS.CSLA.Library
incSub = (ord + 1).ToString();
if (MyParent.MyTab.CleanText.Trim().EndsWith(")"))
{
_MyTab.CleanText = MyParent.MyTab.CleanText.Trim() + "." + incSub;
//CSM F2024 - 080: For South Texas - if format contains initial line and it is not disabled, show an initial line
string tstr = MyParent.MyTab.CleanText.Trim() + "." + incSub;
if (!string.IsNullOrEmpty(FormatStepData.TabData.MacroEditTag) && FormatStepData.TabData.MacroList != null && FormatStepData.TabData.MacroList.Count > 0 && !(this.IsRNOPart && FormatStepData.TabData.MacroList[0].NotInRNO) && !IsInitialLineDisabled && !tstr.StartsWith("_"))
{
if (tstr.StartsWith(" "))
tstr = tstr.Substring(1);
tstr = FormatStepData.TabData.MacroEditTag + tstr;
}
else if (IsInitialLineDisabled && tstr.StartsWith("_"))
tstr = tstr.Substring(1);
_MyTab.CleanText = tstr;
_MyTab.Text = _MyTab.CleanText;
return;
}
if (MyParent.MyTab.CleanText.Contains(ActiveFormat.PlantFormat.FormatData.SectData.StepSectionData.IdentB))
{
_MyTab.CleanText = MyParent.MyTab.CleanText.Trim() + "." + incSub + " ";
//CSM F2024 - 080: For South Texas - if format contains initial line and it is not disabled, show an initial line
string tstr = MyParent.MyTab.CleanText.Trim() + "." + incSub + " ";
if (!string.IsNullOrEmpty(FormatStepData.TabData.MacroEditTag) && FormatStepData.TabData.MacroList != null && FormatStepData.TabData.MacroList.Count > 0 && !(this.IsRNOPart && FormatStepData.TabData.MacroList[0].NotInRNO) && !IsInitialLineDisabled && !tstr.StartsWith("_"))
{
if (tstr.StartsWith(" "))
tstr = tstr.Substring(1);
tstr = FormatStepData.TabData.MacroEditTag + tstr;
}
else if(IsInitialLineDisabled && tstr.StartsWith("_"))
tstr = tstr.Substring(1);
_MyTab.CleanText = tstr;
_MyTab.Text = _MyTab.CleanText;
return;
}
string tmprnotab = MyParent.MyTab.CleanText.Substring(0, MyParent.MyTab.CleanText.IndexOf(".") + 1) + incSub;
_MyTab.CleanText = tmprnotab.TrimStart();
_MyTab.Text = tmprnotab.TrimStart();
//CSM F2024 - 080: For South Texas - if format contains initial line and it is not disabled, show an initial line
tmprnotab = tmprnotab.TrimStart();
if (!string.IsNullOrEmpty(FormatStepData.TabData.MacroEditTag) && FormatStepData.TabData.MacroList != null && FormatStepData.TabData.MacroList.Count > 0 && !(this.IsRNOPart && FormatStepData.TabData.MacroList[0].NotInRNO) && !IsInitialLineDisabled && !tmprnotab.StartsWith("_"))
{
if (tmprnotab.StartsWith(" "))
tmprnotab = tmprnotab.Substring(1);
tmprnotab = FormatStepData.TabData.MacroEditTag + tmprnotab;
}
else if (IsInitialLineDisabled && tmprnotab.StartsWith("_"))
tmprnotab = tmprnotab.Substring(1);
_MyTab.CleanText = tmprnotab;
_MyTab.Text = tmprnotab;
return;
}
if ((((ItemInfo)ActiveParent).IsHigh && FormatStepData.NumberHighLevel) || ((!((ItemInfo)ActiveParent).IsHigh) && ((tbformat == null || tbformat == "") && (RNOLevel <= ColumnMode))))
{
_MyTab.CleanText = ((ItemInfo)ActiveParent).MyTab.CleanText;
_MyTab.Text = ((ItemInfo)ActiveParent).MyTab.Text;
//CSM F2024 - 080: For South Texas - if format contains initial line and it is not disabled, show an initial line
if (!string.IsNullOrEmpty(FormatStepData.TabData.MacroEditTag) && FormatStepData.TabData.MacroList != null && FormatStepData.TabData.MacroList.Count > 0 && !(this.IsRNOPart && FormatStepData.TabData.MacroList[0].NotInRNO) && !IsInitialLineDisabled && !_MyTab.CleanText.StartsWith("_"))
{
if (_MyTab.CleanText.StartsWith(" "))
_MyTab.CleanText = _MyTab.CleanText.Substring(1);
_MyTab.CleanText = FormatStepData.TabData.MacroEditTag + _MyTab.CleanText;
}
if (IsInitialLineDisabled && _MyTab.CleanText.StartsWith("_"))
{
_MyTab.CleanText = _MyTab.CleanText.Substring(1);
}
if (IsInitialLineDisabled && _MyTab.Text.StartsWith("_"))
{
_MyTab.Text = _MyTab.Text.Substring(1);
}
_MyTab.RNOTabWidthAdjust = ((ItemInfo)ActiveParent).FormatStepData.TabData.RNOAdjustTabSize ?? 0;
if (((ItemInfo)ActiveParent).MyTab.Offset != 0) _MyTab.Offset = ((ItemInfo)ActiveParent).MyTab.Offset;
if (((ItemInfo)ActiveParent).FormatStepData.TabData.RNOExcludeMacros)
@ -4716,6 +4771,15 @@ namespace VEPROMS.CSLA.Library
cltext = cltext + " ";
}
}
//CSM F2024 - 080: For South Texas - if format contains initial line and it is not disabled, show an initial line
else if (macroindx == -1 && !string.IsNullOrEmpty(FormatStepData.TabData.MacroEditTag) && FormatStepData.TabData.MacroList != null && FormatStepData.TabData.MacroList.Count > 0 && !(this.IsRNOPart && FormatStepData.TabData.MacroList[0].NotInRNO) && !IsInitialLineDisabled)
{
if (cltext == null)
cltext = tbformat;
if (cltext.StartsWith(" "))
cltext = cltext.Substring(1);
cltext = FormatStepData.TabData.MacroEditTag + cltext;
}
}
macroindx = tbformat.IndexOf("{!diamond1}");
if (macroindx > -1) //i found it
@ -5520,15 +5584,32 @@ namespace VEPROMS.CSLA.Library
}
if (count <= macro.Grouping) addToList = false;
}
//CSM F2024 - 080: For South Texas - if initial line is disabled for this step, do not add the macro
if (macro.Name.ToUpper() == "CHECKOFF" && ActiveFormat.PlantFormat.FormatData.SectData.StepSectionData.ShowInitialLineDisable && !string.IsNullOrEmpty(FormatStepData.TabData.MacroEditTag) && FormatStepData.TabData.MacroEditTag == "_" && IsInitialLineDisabled)
addToList = false;
if (addToList) tmp.Add(macro);
}
if (tmp.Count > 0) _MyMacros = tmp;
}
#endregion
#region UseSmartTemplate
// TemplateIndex is for Calvert only:
private int _TemplateIndex = -2; // -2 not set; -1 not a template
//CSM F2024 - 080: For South Texas - check if initial line is disabled for this step
public bool IsInitialLineDisabled
{
get
{
if (!IsStep) return false;
StepConfig sc = MyConfig as StepConfig;
return sc.Step_DisableInitialLine;
}
}
#endregion
#region UseSmartTemplate
// TemplateIndex is for Calvert only:
private int _TemplateIndex = -2; // -2 not set; -1 not a template
public int TemplateIndex
{
get
@ -8004,6 +8085,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

View File

@ -3175,6 +3175,17 @@ namespace VEPROMS.CSLA.Library
return LazyLoad(ref _ChangeFontUpperCaseIinArial, "@ChangeFontUpperCaseIinArial");
}
}
// F2024-080 South Texas
// Used to show if "Initial Line Disable" checkbox should show in the DisplayTab
private LazyLoad<bool> _ShowInitialLineDisable;
public bool ShowInitialLineDisable
{
get
{
return LazyLoad(ref _ShowInitialLineDisable, "@ShowInitialLineDisable");
}
}
}
#endregion - StepSectionData
#region TextTypeValue

View File

@ -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()
{

View File

@ -0,0 +1,91 @@
using System;
using Csla.Data;
using System.Data;
using System.Data.SqlClient;
//CSM - C2024-031 - Minimal Class for Saving / Getting User Settings
//For Use with getting / saving if a User wishes to have tabs kept open
namespace VEPROMS.CSLA.Library
{
public class UserSettings
{
#region Private Properties
private readonly string _userid;
#endregion
#region Public Properties
public bool UserSetting_OpenTabs_Remember { get; protected set; } = false;
public bool UserSetting_OpenTabs_AutoOpen { get; protected set; } = true;
#endregion
#region Constructor
public UserSettings(string UserID)
{
_userid = UserID;
try
{
using (SqlConnection cn = Database.VEPROMS_SqlConnection)
{
using (SqlCommand cm = cn.CreateCommand())
{
cm.CommandType = CommandType.Text;
cm.CommandText = "Select RememberOpenTabs, AutoOpenTabs FROM Users where UserID = @UID";
cm.Parameters.AddWithValue("@UID", _userid);
cm.CommandTimeout = Database.DefaultTimeout;
using (SafeDataReader dr = new SafeDataReader(cm.ExecuteReader()))
{
if (dr.Read())
{
UserSetting_OpenTabs_Remember = (bool) dr.GetValue("RememberOpenTabs");
UserSetting_OpenTabs_AutoOpen = (bool) dr.GetValue("AutoOpenTabs");
}
}
}
}
}
catch (Exception ex)
{
Database.LogException("UserSettings_GetData", ex);
throw new DbCslaException("UserSettings_GetData", ex);
}
}
#endregion
#region Save Properties
public void SetUserSettings(bool OpenTabs_Remember, bool? OpenTabs_AutoOpen = null)
{
try
{
using (SqlConnection cn = Database.VEPROMS_SqlConnection)
{
using (SqlCommand cm = cn.CreateCommand())
{
cm.CommandType = CommandType.StoredProcedure;
cm.CommandText = "vesp_UpdateUserSettings";
cm.Parameters.AddWithValue("@UID", _userid);
UserSetting_OpenTabs_Remember = OpenTabs_Remember;
cm.Parameters.AddWithValue("@Remember", OpenTabs_Remember);
if (OpenTabs_AutoOpen != null)
{
UserSetting_OpenTabs_AutoOpen = (bool) OpenTabs_AutoOpen;
cm.Parameters.AddWithValue("@AutoOpen", OpenTabs_AutoOpen);
}
cm.CommandTimeout = Database.DefaultTimeout;
cm.ExecuteNonQuery();
}
}
}
catch (Exception ex)
{
Database.LogException("UserSettings_SetUserSettings", ex);
throw new DbCslaException("UserSettings_SetUserSettings", ex);
}
}
#endregion
}
}

View File

@ -380,6 +380,7 @@
<Compile Include="Generated\ZContentInfo.cs" />
<Compile Include="Generated\ZTransition.cs" />
<Compile Include="Generated\ZTransitionInfo.cs" />
<Compile Include="Minimal\UserSettings.cs" />
<Compile Include="Properties\AssemblyInfo.cs" />
<Compile Include="VEObjects\VEDrillDown.cs" />
<Compile Include="VEObjects\VETreeNode.cs" />

View File

@ -511,8 +511,8 @@ namespace Volian.Controls.Library
this.AutoScaleDimensions = new System.Drawing.SizeF(6F, 13F);
this.AutoScaleMode = System.Windows.Forms.AutoScaleMode.Font;
this.Controls.Add(this.btnPrintReport);
this.Controls.Add(this.xpSetToReport);
this.Controls.Add(this.xpSelROs);
this.Controls.Add(this.xpSetToReport);
this.Controls.Add(this.tctrlReports);
this.Margin = new System.Windows.Forms.Padding(2);
this.Name = "DisplayReports";

View File

@ -658,7 +658,7 @@ namespace Volian.Controls.Library
this.superTooltip1.SetSuperTooltip(this.cmboTreeROs, new DevComponents.DotNetBar.SuperTooltipInfo("Select the RO to Search", "", "Select the Referenced Object to search for.", null, null, DevComponents.DotNetBar.eTooltipColor.Gray));
this.cmboTreeROs.TabIndex = 1;
this.cmboTreeROs.ThemeAware = true;
this.cmboTreeROs.WatermarkText = "Select an RO to seach";
this.cmboTreeROs.WatermarkText = "Select an RO to search";
this.cmboTreeROs.SelectedIndexChanged += new System.EventHandler(this.cmboTreeROs_SelectedIndexChanged);
//
// tabROSearch

File diff suppressed because it is too large Load Diff

View File

@ -142,6 +142,8 @@ namespace Volian.Controls.Library
tbChgID.Enabled = false;
lblChgId.Visible = tbChgID.Visible = false;
CurItemInfo = null;
cbInitialLine.Visible = cbInitialLine.Enabled = false;
}
private bool StepOverRide()
{
@ -553,6 +555,16 @@ namespace Volian.Controls.Library
}
}
}
//CSM F2024 - 080: For South Texas (HLP formats), enable the initial line checkbox if it is in the formats
//Also, they want disable being selected to impact substeps - so do not show toggle if selected on a parent step
cbInitialLine.Visible = cbInitialLine.Enabled = false;
if (CurItemInfo.ActiveFormat.PlantFormat.FormatData.SectData.StepSectionData.ShowInitialLineDisable && !string.IsNullOrEmpty(CurItemInfo.FormatStepData.TabData.MacroEditTag) && CurItemInfo.FormatStepData.TabData.MacroEditTag == "_" && CurItemInfo.FormatStepData.TabData.MacroList != null && CurItemInfo.FormatStepData.TabData.MacroList.Count > 0 && !(CurItemInfo.IsRNOPart && CurItemInfo.FormatStepData.TabData.MacroList[0].NotInRNO))
{
cbInitialLine.Visible = cbInitialLine.Enabled = true;
cbInitialLine.Checked = sc.Step_DisableInitialLine;
}
_Initalizing = false;
}
public void SetFigure(double wd, double wd2)
@ -969,25 +981,42 @@ namespace Volian.Controls.Library
sc.Step_PreferredPagebreak = cbPrefPageBreak.Checked;
MyEditItem.ChangeBarForConfigItemChange = true;
}
//private void txbxAltConActSumText_Leave(object sender, EventArgs e)
//{
// // User left Atlernate Continuous Action Text field. If text changed, then prompt
// // to see if save should occur.
// StepConfig sc = CurItemInfo.MyConfig as StepConfig;
// if (sc == null) return;
// bool bothEmpty = (sc.Step_AlternateContActSumText == null || sc.Step_AlternateContActSumText == "") && (txbxAltConActSumText.Text == null || txbxAltConActSumText.Text == "");
// if (!bothEmpty && sc.Step_AlternateContActSumText != txbxAltConActSumText.Text)
// {
// if (MessageBox.Show(this, "Do you want to save the Alternate Continuous Action Text?", "Confirm Save", MessageBoxButtons.YesNo, MessageBoxIcon.Question) == DialogResult.Yes)
// {
// MyEditItem.SaveContents();
// sc.Step_AlternateContActSumText = txbxAltConActSumText.Text; // this actually saves the config
// }
// else
// txbxAltConActSumText.Text = sc.Step_AlternateContActSumText;
// }
//}
private void cbInitialLine_CheckedChanged(object sender, EventArgs e)
{
if (_Initalizing) return;
MyEditItem.SaveContents();
StepConfig sc = CurItemInfo.MyConfig as StepConfig;
if (sc == null) return;
MyEditItem.ChangeBarForConfigItemChange = false;
sc.Step_DisableInitialLine = cbInitialLine.Checked;
MyEditItem.ChangeBarForConfigItemChange = true;
}
//needed to refresh display changing
MyEditItem.RefreshContent();
MyEditItem.SetAllTabs();
}
//private void txbxAltConActSumText_Leave(object sender, EventArgs e)
//{
// // User left Atlernate Continuous Action Text field. If text changed, then prompt
// // to see if save should occur.
// StepConfig sc = CurItemInfo.MyConfig as StepConfig;
// if (sc == null) return;
// bool bothEmpty = (sc.Step_AlternateContActSumText == null || sc.Step_AlternateContActSumText == "") && (txbxAltConActSumText.Text == null || txbxAltConActSumText.Text == "");
// if (!bothEmpty && sc.Step_AlternateContActSumText != txbxAltConActSumText.Text)
// {
// if (MessageBox.Show(this, "Do you want to save the Alternate Continuous Action Text?", "Confirm Save", MessageBoxButtons.YesNo, MessageBoxIcon.Question) == DialogResult.Yes)
// {
// MyEditItem.SaveContents();
// sc.Step_AlternateContActSumText = txbxAltConActSumText.Text; // this actually saves the config
// }
// else
// txbxAltConActSumText.Text = sc.Step_AlternateContActSumText;
// }
//}
}
}