This commit is contained in:
2020-04-28 18:32:52 +00:00
parent bb11690775
commit c239ae57f4
3 changed files with 50 additions and 44 deletions

View File

@@ -38,8 +38,8 @@
this.pictureBox1 = new System.Windows.Forms.PictureBox(); this.pictureBox1 = new System.Windows.Forms.PictureBox();
this.edServerUrl = new System.Windows.Forms.TextBox(); this.edServerUrl = new System.Windows.Forms.TextBox();
this.label1 = new System.Windows.Forms.Label(); this.label1 = new System.Windows.Forms.Label();
this.label2 = new System.Windows.Forms.Label();
this.btnTest = new System.Windows.Forms.Button(); this.btnTest = new System.Windows.Forms.Button();
this.label2 = new System.Windows.Forms.Label();
((System.ComponentModel.ISupportInitialize)(this.pictureBox2)).BeginInit(); ((System.ComponentModel.ISupportInitialize)(this.pictureBox2)).BeginInit();
((System.ComponentModel.ISupportInitialize)(this.pictureBox3)).BeginInit(); ((System.ComponentModel.ISupportInitialize)(this.pictureBox3)).BeginInit();
((System.ComponentModel.ISupportInitialize)(this.pictureBox1)).BeginInit(); ((System.ComponentModel.ISupportInitialize)(this.pictureBox1)).BeginInit();
@@ -48,25 +48,25 @@
// edUserName // edUserName
// //
this.edUserName.Font = new System.Drawing.Font("Microsoft Sans Serif", 12F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(0))); this.edUserName.Font = new System.Drawing.Font("Microsoft Sans Serif", 12F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(0)));
this.edUserName.Location = new System.Drawing.Point(100, 334); this.edUserName.Location = new System.Drawing.Point(100, 335);
this.edUserName.Name = "edUserName"; this.edUserName.Name = "edUserName";
this.edUserName.Size = new System.Drawing.Size(408, 26); this.edUserName.Size = new System.Drawing.Size(460, 26);
this.edUserName.TabIndex = 1; this.edUserName.TabIndex = 1;
this.edUserName.Text = "manager"; this.edUserName.Text = "manager";
// //
// edPassword // edPassword
// //
this.edPassword.Font = new System.Drawing.Font("Microsoft Sans Serif", 12F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(0))); this.edPassword.Font = new System.Drawing.Font("Microsoft Sans Serif", 12F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(0)));
this.edPassword.Location = new System.Drawing.Point(100, 383); this.edPassword.Location = new System.Drawing.Point(100, 395);
this.edPassword.Name = "edPassword"; this.edPassword.Name = "edPassword";
this.edPassword.Size = new System.Drawing.Size(408, 26); this.edPassword.Size = new System.Drawing.Size(460, 26);
this.edPassword.TabIndex = 2; this.edPassword.TabIndex = 2;
this.edPassword.Text = "l3tm3in"; this.edPassword.Text = "l3tm3in";
// //
// pictureBox2 // pictureBox2
// //
this.pictureBox2.Image = global::AyaNova.PlugIn.V8.Resource1.LoginPassword32; this.pictureBox2.Image = global::AyaNova.PlugIn.V8.Resource1.LoginPassword32;
this.pictureBox2.Location = new System.Drawing.Point(26, 383); this.pictureBox2.Location = new System.Drawing.Point(26, 395);
this.pictureBox2.Name = "pictureBox2"; this.pictureBox2.Name = "pictureBox2";
this.pictureBox2.Size = new System.Drawing.Size(68, 35); this.pictureBox2.Size = new System.Drawing.Size(68, 35);
this.pictureBox2.TabIndex = 31; this.pictureBox2.TabIndex = 31;
@@ -75,7 +75,7 @@
// pictureBox3 // pictureBox3
// //
this.pictureBox3.Image = global::AyaNova.PlugIn.V8.Resource1.Login32; this.pictureBox3.Image = global::AyaNova.PlugIn.V8.Resource1.Login32;
this.pictureBox3.Location = new System.Drawing.Point(26, 334); this.pictureBox3.Location = new System.Drawing.Point(26, 335);
this.pictureBox3.Name = "pictureBox3"; this.pictureBox3.Name = "pictureBox3";
this.pictureBox3.Size = new System.Drawing.Size(68, 39); this.pictureBox3.Size = new System.Drawing.Size(68, 39);
this.pictureBox3.TabIndex = 30; this.pictureBox3.TabIndex = 30;
@@ -86,7 +86,7 @@
this.btnCancel.DialogResult = System.Windows.Forms.DialogResult.Cancel; this.btnCancel.DialogResult = System.Windows.Forms.DialogResult.Cancel;
this.btnCancel.FlatStyle = System.Windows.Forms.FlatStyle.Popup; this.btnCancel.FlatStyle = System.Windows.Forms.FlatStyle.Popup;
this.btnCancel.Image = global::AyaNova.PlugIn.V8.Resource1.Cancel24; this.btnCancel.Image = global::AyaNova.PlugIn.V8.Resource1.Cancel24;
this.btnCancel.Location = new System.Drawing.Point(26, 450); this.btnCancel.Location = new System.Drawing.Point(26, 482);
this.btnCancel.Name = "btnCancel"; this.btnCancel.Name = "btnCancel";
this.btnCancel.Size = new System.Drawing.Size(68, 41); this.btnCancel.Size = new System.Drawing.Size(68, 41);
this.btnCancel.TabIndex = 26; this.btnCancel.TabIndex = 26;
@@ -96,7 +96,7 @@
// //
this.btnOk.FlatStyle = System.Windows.Forms.FlatStyle.Popup; this.btnOk.FlatStyle = System.Windows.Forms.FlatStyle.Popup;
this.btnOk.Image = global::AyaNova.PlugIn.V8.Resource1.OK24; this.btnOk.Image = global::AyaNova.PlugIn.V8.Resource1.OK24;
this.btnOk.Location = new System.Drawing.Point(440, 450); this.btnOk.Location = new System.Drawing.Point(492, 482);
this.btnOk.Name = "btnOk"; this.btnOk.Name = "btnOk";
this.btnOk.Size = new System.Drawing.Size(68, 41); this.btnOk.Size = new System.Drawing.Size(68, 41);
this.btnOk.TabIndex = 3; this.btnOk.TabIndex = 3;
@@ -106,7 +106,7 @@
// pictureBox1 // pictureBox1
// //
this.pictureBox1.Image = ((System.Drawing.Image)(resources.GetObject("pictureBox1.Image"))); this.pictureBox1.Image = ((System.Drawing.Image)(resources.GetObject("pictureBox1.Image")));
this.pictureBox1.Location = new System.Drawing.Point(191, 12); this.pictureBox1.Location = new System.Drawing.Point(248, 12);
this.pictureBox1.Name = "pictureBox1"; this.pictureBox1.Name = "pictureBox1";
this.pictureBox1.Size = new System.Drawing.Size(136, 126); this.pictureBox1.Size = new System.Drawing.Size(136, 126);
this.pictureBox1.TabIndex = 0; this.pictureBox1.TabIndex = 0;
@@ -115,9 +115,9 @@
// edServerUrl // edServerUrl
// //
this.edServerUrl.Font = new System.Drawing.Font("Microsoft Sans Serif", 12F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(0))); this.edServerUrl.Font = new System.Drawing.Font("Microsoft Sans Serif", 12F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(0)));
this.edServerUrl.Location = new System.Drawing.Point(26, 192); this.edServerUrl.Location = new System.Drawing.Point(26, 247);
this.edServerUrl.Name = "edServerUrl"; this.edServerUrl.Name = "edServerUrl";
this.edServerUrl.Size = new System.Drawing.Size(482, 26); this.edServerUrl.Size = new System.Drawing.Size(534, 26);
this.edServerUrl.TabIndex = 32; this.edServerUrl.TabIndex = 32;
this.edServerUrl.Text = "http://localhost:7575"; this.edServerUrl.Text = "http://localhost:7575";
// //
@@ -125,25 +125,15 @@
// //
this.label1.AutoSize = true; this.label1.AutoSize = true;
this.label1.Font = new System.Drawing.Font("Microsoft Sans Serif", 9.75F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(0))); this.label1.Font = new System.Drawing.Font("Microsoft Sans Serif", 9.75F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(0)));
this.label1.Location = new System.Drawing.Point(28, 168); this.label1.Location = new System.Drawing.Point(28, 223);
this.label1.Name = "label1"; this.label1.Name = "label1";
this.label1.Size = new System.Drawing.Size(149, 16); this.label1.Size = new System.Drawing.Size(149, 16);
this.label1.TabIndex = 33; this.label1.TabIndex = 33;
this.label1.Text = "AyaNova 8 server URL:"; this.label1.Text = "AyaNova 8 server URL:";
// //
// label2
//
this.label2.AutoSize = true;
this.label2.Font = new System.Drawing.Font("Microsoft Sans Serif", 9.75F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(0)));
this.label2.Location = new System.Drawing.Point(28, 302);
this.label2.Name = "label2";
this.label2.Size = new System.Drawing.Size(298, 16);
this.label2.TabIndex = 34;
this.label2.Text = "Login as v8 user with ``Business Admin Full`` role:";
//
// btnTest // btnTest
// //
this.btnTest.Location = new System.Drawing.Point(432, 225); this.btnTest.Location = new System.Drawing.Point(485, 279);
this.btnTest.Name = "btnTest"; this.btnTest.Name = "btnTest";
this.btnTest.Size = new System.Drawing.Size(75, 23); this.btnTest.Size = new System.Drawing.Size(75, 23);
this.btnTest.TabIndex = 35; this.btnTest.TabIndex = 35;
@@ -151,13 +141,29 @@
this.btnTest.UseVisualStyleBackColor = true; this.btnTest.UseVisualStyleBackColor = true;
this.btnTest.Click += new System.EventHandler(this.btnTest_Click); this.btnTest.Click += new System.EventHandler(this.btnTest_Click);
// //
// label2
//
this.label2.BorderStyle = System.Windows.Forms.BorderStyle.FixedSingle;
this.label2.FlatStyle = System.Windows.Forms.FlatStyle.Popup;
this.label2.Font = new System.Drawing.Font("Microsoft Sans Serif", 12F, System.Drawing.FontStyle.Bold, System.Drawing.GraphicsUnit.Point, ((byte)(0)));
this.label2.ForeColor = System.Drawing.Color.Red;
this.label2.Location = new System.Drawing.Point(12, 159);
this.label2.Name = "label2";
this.label2.Size = new System.Drawing.Size(590, 37);
this.label2.TabIndex = 36;
this.label2.Text = "Warning: This *will* erase *all* data on AyaNova 8 Server!";
this.label2.TextAlign = System.Drawing.ContentAlignment.MiddleCenter;
this.label2.Click += new System.EventHandler(this.label2_Click);
//
// Auth // Auth
// //
this.AutoScaleDimensions = new System.Drawing.SizeF(6F, 13F); this.AutoScaleDimensions = new System.Drawing.SizeF(6F, 13F);
this.AutoScaleMode = System.Windows.Forms.AutoScaleMode.Font; this.AutoScaleMode = System.Windows.Forms.AutoScaleMode.Font;
this.ClientSize = new System.Drawing.Size(537, 513); this.AutoSize = true;
this.Controls.Add(this.btnTest); this.ClientSize = new System.Drawing.Size(614, 545);
this.ControlBox = false;
this.Controls.Add(this.label2); this.Controls.Add(this.label2);
this.Controls.Add(this.btnTest);
this.Controls.Add(this.label1); this.Controls.Add(this.label1);
this.Controls.Add(this.edServerUrl); this.Controls.Add(this.edServerUrl);
this.Controls.Add(this.pictureBox2); this.Controls.Add(this.pictureBox2);
@@ -169,7 +175,7 @@
this.Controls.Add(this.pictureBox1); this.Controls.Add(this.pictureBox1);
this.Icon = ((System.Drawing.Icon)(resources.GetObject("$this.Icon"))); this.Icon = ((System.Drawing.Icon)(resources.GetObject("$this.Icon")));
this.Name = "Auth"; this.Name = "Auth";
this.Text = "AyaNova 8"; this.Text = "Erase all data on v8 server and import from v7";
this.Load += new System.EventHandler(this.Auth_Load); this.Load += new System.EventHandler(this.Auth_Load);
((System.ComponentModel.ISupportInitialize)(this.pictureBox2)).EndInit(); ((System.ComponentModel.ISupportInitialize)(this.pictureBox2)).EndInit();
((System.ComponentModel.ISupportInitialize)(this.pictureBox3)).EndInit(); ((System.ComponentModel.ISupportInitialize)(this.pictureBox3)).EndInit();
@@ -190,7 +196,7 @@
private System.Windows.Forms.PictureBox pictureBox2; private System.Windows.Forms.PictureBox pictureBox2;
private System.Windows.Forms.TextBox edServerUrl; private System.Windows.Forms.TextBox edServerUrl;
private System.Windows.Forms.Label label1; private System.Windows.Forms.Label label1;
private System.Windows.Forms.Label label2;
private System.Windows.Forms.Button btnTest; private System.Windows.Forms.Button btnTest;
private System.Windows.Forms.Label label2;
} }
} }

View File

@@ -64,6 +64,11 @@ namespace AyaNova.PlugIn.V8
#endif #endif
} }
private void label2_Click(object sender, EventArgs e)
{
}
} }
} }

View File

@@ -155,7 +155,7 @@ namespace AyaNova.PlugIn.V8
/// Dump the objects into a temporary directory as a series of JSON files /// Dump the objects into a temporary directory as a series of JSON files
/// then zip it all up into a single archive file and then erase the temporary folder /// then zip it all up into a single archive file and then erase the temporary folder
/// </summary> /// </summary>
private void DoExport() private async void DoExport()
{ {
Map.Clear(); Map.Clear();
@@ -178,7 +178,8 @@ namespace AyaNova.PlugIn.V8
//Export in correct order: //Export in correct order:
//ERASE DB //ERASE DB
util.EraseDB(); var a = await util.PostAsync("License/PermanentlyEraseAllData", "I understand");
if (!a.HttpResponse.IsSuccessStatusCode) { MessageBox.Show("Error erasing database: \n" + a.HttpResponse.ReasonPhrase); return;}
//TAGS //TAGS
ExportUnitModelCategories(progress); ExportUnitModelCategories(progress);
@@ -221,7 +222,7 @@ namespace AyaNova.PlugIn.V8
#region Global settings #region Global settings
private void ExportGlobalSettings(ProgressForm progress) private void ExportGlobalSettings(ProgressForm progress)
{ {
List<string> objectExcludeProperties = new List<string>(standardExcludePropertiesList);
progress.Append("STUB: Dumping Global Settings"); progress.Append("STUB: Dumping Global Settings");
////DumpObjectToFolder(tempArchiveFolder, AyaBizUtils.GlobalSettings, "globalsettings", objectExcludeProperties, new TypeAndID(RootObjectTypes.Global, Address.GlobalAddressID)); ////DumpObjectToFolder(tempArchiveFolder, AyaBizUtils.GlobalSettings, "globalsettings", objectExcludeProperties, new TypeAndID(RootObjectTypes.Global, Address.GlobalAddressID));
} }
@@ -230,7 +231,7 @@ namespace AyaNova.PlugIn.V8
#region locales #region locales
private void ExportLocales(ProgressForm progress) private void ExportLocales(ProgressForm progress)
{ {
List<string> objectExcludeProperties = new List<string>(standardExcludePropertiesList); // List<string> objectExcludeProperties = new List<string>(standardExcludePropertiesList);
//Skip stock locales already handled in Raven //Skip stock locales already handled in Raven
List<string> SkipLocales = new List<string>(); List<string> SkipLocales = new List<string>();
@@ -255,9 +256,8 @@ namespace AyaNova.PlugIn.V8
#region REGIONS #region REGIONS
private void ExportRegions(ProgressForm progress) private void ExportRegions(ProgressForm progress)
{ {
List<string> objectExcludeProperties = new List<string>(standardExcludePropertiesList); // List<string> objectExcludeProperties = new List<string>(standardExcludePropertiesList);
objectExcludeProperties.Add("ContractName");
objectExcludeProperties.Add("uiHasTechNotes");
RegionList l = RegionList.GetList(string.Empty); RegionList l = RegionList.GetList(string.Empty);
progress.Append("Dumping " + l.Count.ToString() + " Regions"); progress.Append("Dumping " + l.Count.ToString() + " Regions");
foreach (RegionList.RegionListInfo i in l) foreach (RegionList.RegionListInfo i in l)
@@ -281,7 +281,7 @@ namespace AyaNova.PlugIn.V8
} }
private void ExportSeedNumbers(ProgressForm progress) private void ExportSeedNumbers(ProgressForm progress)
{ {
List<string> objectExcludeProperties = new List<string>(standardExcludePropertiesList); // List<string> objectExcludeProperties = new List<string>(standardExcludePropertiesList);
progress.Append("Dumping seeds"); progress.Append("Dumping seeds");
//create a new object with the id numbers in it and then dump it //create a new object with the id numbers in it and then dump it
WorkorderPMList pml = WorkorderPMList.GetList("<?xml version=\"1.0\" encoding=\"utf-16\" standalone=\"yes\"?> \r\n" + WorkorderPMList pml = WorkorderPMList.GetList("<?xml version=\"1.0\" encoding=\"utf-16\" standalone=\"yes\"?> \r\n" +
@@ -309,9 +309,6 @@ namespace AyaNova.PlugIn.V8
#region clients #region clients
private void ExportClients(ProgressForm progress) private void ExportClients(ProgressForm progress)
{ {
List<string> objectExcludeProperties = new List<string>(standardExcludePropertiesList);
objectExcludeProperties.Add("ContractName");
objectExcludeProperties.Add("uiHasTechNotes");
ClientPickList pl = ClientPickList.GetList(); ClientPickList pl = ClientPickList.GetList();
progress.Append("Dumping " + pl.Count.ToString() + " Clients"); progress.Append("Dumping " + pl.Count.ToString() + " Clients");
foreach (ClientPickList.ClientPickListInfo i in pl) foreach (ClientPickList.ClientPickListInfo i in pl)
@@ -326,9 +323,7 @@ namespace AyaNova.PlugIn.V8
#region headoffices #region headoffices
private void ExportHeadOffices(ProgressForm progress) private void ExportHeadOffices(ProgressForm progress)
{ {
List<string> excludes = new List<string>(standardExcludePropertiesList);
//excludes.Add("ContractInEffect");
//excludes.Add("uiHasTechNotes");
PickListAutoComplete pl = PickListAutoComplete.GetList("**", "headoffice"); PickListAutoComplete pl = PickListAutoComplete.GetList("**", "headoffice");
progress.Append("Dumping " + pl.Count.ToString() + " Head offices"); progress.Append("Dumping " + pl.Count.ToString() + " Head offices");
@@ -341,7 +336,7 @@ namespace AyaNova.PlugIn.V8
#endregion clients #endregion clients
#region users #region users
private void ExportUsers(ProgressForm progress) private async void ExportUsers(ProgressForm progress)
{ {
//List<string> objectExcludeProperties = new List<string>(standardExcludePropertiesList); //List<string> objectExcludeProperties = new List<string>(standardExcludePropertiesList);
@@ -388,7 +383,7 @@ namespace AyaNova.PlugIn.V8
Tagit(c.DispatchZoneID, tags); Tagit(c.DispatchZoneID, tags);
SetTags(d, tags); SetTags(d, tags);
util.PostAsync(" var a=await util.PostAsync("User", d.ToString());
//JObject xtra = new JObject(); //JObject xtra = new JObject();