Upgrade Settings from previous revision

Save config changes once
This commit is contained in:
Rich 2012-05-03 21:45:49 +00:00
parent 079a0ef80e
commit c5b790bbb0
5 changed files with 41 additions and 18 deletions

View File

@ -315,5 +315,17 @@ namespace VEPROMS.Properties {
this["SMTPUser"] = value; this["SMTPUser"] = value;
} }
} }
[global::System.Configuration.UserScopedSettingAttribute()]
[global::System.Diagnostics.DebuggerNonUserCodeAttribute()]
[global::System.Configuration.DefaultSettingValueAttribute("True")]
public bool UpdateSettings {
get {
return ((bool)(this["UpdateSettings"]));
}
set {
this["UpdateSettings"] = value;
}
}
} }
} }

View File

@ -77,5 +77,8 @@
<Setting Name="SMTPUser" Type="System.String" Scope="User"> <Setting Name="SMTPUser" Type="System.String" Scope="User">
<Value Profile="(Default)" /> <Value Profile="(Default)" />
</Setting> </Setting>
<Setting Name="UpdateSettings" Type="System.Boolean" Scope="User">
<Value Profile="(Default)">True</Value>
</Setting>
</Settings> </Settings>
</SettingsFile> </SettingsFile>

View File

@ -111,6 +111,12 @@ namespace VEPROMS
#endregion #endregion
public frmVEPROMS() public frmVEPROMS()
{ {
if (Properties.Settings.Default.UpdateSettings)
{
Properties.Settings.Default.Upgrade();
Properties.Settings.Default.UpdateSettings = false;
Properties.Settings.Default.Save();
}
// cleanup from previous run: // cleanup from previous run:
Volian.Base.Library.TmpFile.RemoveAllTmps(); Volian.Base.Library.TmpFile.RemoveAllTmps();

View File

@ -355,12 +355,12 @@ namespace Volian.Controls.Library
{ {
StepConfig sc = CurItemInfo.MyConfig as StepConfig; StepConfig sc = CurItemInfo.MyConfig as StepConfig;
sc.Step_CBOverride = "On"; sc.Step_CBOverride = "On";
using (Content cnt = Content.Get(CurItemInfo.MyContent.ContentID)) //using (Content cnt = Content.Get(CurItemInfo.MyContent.ContentID))
{ //{
cnt.DTS = DateTime.Now; // cnt.DTS = DateTime.Now;
cnt.UserID = Volian.Base.Library.VlnSettings.UserID; // cnt.UserID = Volian.Base.Library.VlnSettings.UserID;
cnt.Save(); // cnt.Save();
} //}
} }
} }
private void rbChgBarOvrRideOff_CheckedChanged(object sender, EventArgs e) private void rbChgBarOvrRideOff_CheckedChanged(object sender, EventArgs e)
@ -373,12 +373,12 @@ namespace Volian.Controls.Library
{ {
StepConfig sc = CurItemInfo.MyConfig as StepConfig; StepConfig sc = CurItemInfo.MyConfig as StepConfig;
sc.Step_CBOverride = "Off"; sc.Step_CBOverride = "Off";
using (Content cnt = Content.Get(CurItemInfo.MyContent.ContentID)) //using (Content cnt = Content.Get(CurItemInfo.MyContent.ContentID))
{ //{
cnt.DTS = CurItemInfo.MyProcedure.DTS; // cnt.DTS = CurItemInfo.MyProcedure.DTS;
cnt.UserID = CurItemInfo.MyProcedure.UserID; // cnt.UserID = CurItemInfo.MyProcedure.UserID;
cnt.Save(); // cnt.Save();
} //}
} }
} }
private void cmbCheckoff_SelectedIndexChanged(object sender, EventArgs e) private void cmbCheckoff_SelectedIndexChanged(object sender, EventArgs e)
@ -389,12 +389,12 @@ namespace Volian.Controls.Library
int indx = cmbCheckoff.SelectedIndex; int indx = cmbCheckoff.SelectedIndex;
StepConfig sc = CurItemInfo.MyConfig as StepConfig; StepConfig sc = CurItemInfo.MyConfig as StepConfig;
sc.Step_CheckOffIndex = indx; sc.Step_CheckOffIndex = indx;
using (Content cnt = Content.Get(CurItemInfo.MyContent.ContentID)) //using (Content cnt = Content.Get(CurItemInfo.MyContent.ContentID))
{ //{
cnt.DTS = CurItemInfo.MyProcedure.DTS; // cnt.DTS = CurItemInfo.MyProcedure.DTS;
cnt.UserID = CurItemInfo.MyProcedure.UserID; // cnt.UserID = CurItemInfo.MyProcedure.UserID;
cnt.Save(); // cnt.Save();
} //}
} }
#endregion #endregion
} }

View File

@ -2294,6 +2294,8 @@ namespace Volian.Controls.Library
using (Item itm = MyItemInfo.Get()) using (Item itm = MyItemInfo.Get())
{ {
itm.MyContent.Config = MyItemInfo.MyConfig.ToString(); itm.MyContent.Config = MyItemInfo.MyConfig.ToString();
itm.MyContent.DTS = DateTime.Now;
itm.MyContent.UserID = Volian.Base.Library.VlnSettings.UserID;
itm.Save(); itm.Save();
} }
MyItemInfo.MyConfig.IsDirty = false; MyItemInfo.MyConfig.IsDirty = false;