Fixed logic for Change Bar portion of Step Properties Panel, Tags Tab

This commit is contained in:
Rich 2014-06-20 14:08:19 +00:00
parent fc0b4424ae
commit 9419fc36a6

View File

@ -217,28 +217,31 @@ namespace Volian.Controls.Library
// There is also an override flag in the config for the step, used to override the change bar to 'off'
// if the date show it as having one, or allow a change bar to be 'on' if there the dates are
// not different. Note also that a user may edit data after the change bar is set to 'on'.
DateTime curDts;
using (Item itm = Item.Get(CurItemInfo.ItemID))
{
curDts = itm.DTS;
}
//DateTime curDts;
//using (Item itm = Item.Get(CurItemInfo.ItemID))
//{
// curDts = itm.DTS;
//}
// set change bar radio buttons for the default that there is no change
// bar & override sets it to On.
rbChgBarOff.Checked = true;
rbChgBarOn.Text = "ON (Override)";
rbChgBarOff.Text = "OFF";
if (CurItemInfo.HasChanges)
{
rbChgBarOff.Text = "OFF (Override)";
rbChgBarOn.Text = "ON";
}
else
{
rbChgBarOn.Text = "ON (Override)";
rbChgBarOff.Text = "OFF";
}
// if there is no override & a change occurred to the text, there is a
// change bar & override sets it to Off.
if (sc.Step_CBOverride == null)
{
if (curDts > CurItemInfo.MyProcedure.DTS)
{
rbChgBarOn.Checked = true;
rbChgBarOff.Text = "OFF (Override)";
rbChgBarOn.Text = "ON";
}
rbChgBarOn.Checked = CurItemInfo.HasChanges;
rbChgBarOff.Checked = ! rbChgBarOn.Checked;
}
else
{
@ -249,17 +252,17 @@ namespace Volian.Controls.Library
// If the date of this is greater than the procedure, a change bar should be displayed -
// see what the override says. The override states whether change bar is on/off (not
// whether override is on/off)
if (curDts > CurItemInfo.MyProcedure.DTS)
{
rbChgBarOff.Text = "OFF (Override)";
rbChgBarOn.Text = "ON";
}
else
{
// date time stamp says no change bar should be displayed:
rbChgBarOff.Text = "OFF";
rbChgBarOn.Text = "ON (Override)";
}
//if (curDts > CurItemInfo.MyProcedure.DTS)
//{
// rbChgBarOff.Text = "OFF (Override)";
// rbChgBarOn.Text = "ON";
//}
//else
//{
// // date time stamp says no change bar should be displayed:
// rbChgBarOff.Text = "OFF";
// rbChgBarOn.Text = "ON (Override)";
//}
}
// see if the change id label & text box are visible, i.e. plant has multiple change ids.
@ -434,7 +437,7 @@ namespace Volian.Controls.Library
if (rbChgBarOn.Checked)
{
StepConfig sc = CurItemInfo.MyConfig as StepConfig;
sc.Step_CBOverride = "On";
sc.Step_CBOverride = CurItemInfo.HasChanges ? null : "On";
//using (Content cnt = Content.Get(CurItemInfo.MyContent.ContentID))
//{
// cnt.DTS = DateTime.Now;
@ -453,7 +456,7 @@ namespace Volian.Controls.Library
if (rbChgBarOff.Checked)
{
StepConfig sc = CurItemInfo.MyConfig as StepConfig;
sc.Step_CBOverride = "Off";
sc.Step_CBOverride = CurItemInfo.HasChanges ? "Off" :null;
//using (Content cnt = Content.Get(CurItemInfo.MyContent.ContentID))
//{
// cnt.DTS = CurItemInfo.MyProcedure.DTS;