diff --git a/source/Plugins/AyaNova.Plugin.V8/Auth.Designer.cs b/source/Plugins/AyaNova.Plugin.V8/Auth.Designer.cs index 9b95430..e3f252c 100644 --- a/source/Plugins/AyaNova.Plugin.V8/Auth.Designer.cs +++ b/source/Plugins/AyaNova.Plugin.V8/Auth.Designer.cs @@ -38,8 +38,8 @@ this.pictureBox1 = new System.Windows.Forms.PictureBox(); this.edServerUrl = new System.Windows.Forms.TextBox(); this.label1 = new System.Windows.Forms.Label(); - this.label2 = new System.Windows.Forms.Label(); this.btnTest = new System.Windows.Forms.Button(); + this.label2 = new System.Windows.Forms.Label(); ((System.ComponentModel.ISupportInitialize)(this.pictureBox2)).BeginInit(); ((System.ComponentModel.ISupportInitialize)(this.pictureBox3)).BeginInit(); ((System.ComponentModel.ISupportInitialize)(this.pictureBox1)).BeginInit(); @@ -48,25 +48,25 @@ // edUserName // 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.Size = new System.Drawing.Size(408, 26); + this.edUserName.Size = new System.Drawing.Size(460, 26); this.edUserName.TabIndex = 1; this.edUserName.Text = "manager"; // // edPassword // 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.Size = new System.Drawing.Size(408, 26); + this.edPassword.Size = new System.Drawing.Size(460, 26); this.edPassword.TabIndex = 2; this.edPassword.Text = "l3tm3in"; // // pictureBox2 // 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.Size = new System.Drawing.Size(68, 35); this.pictureBox2.TabIndex = 31; @@ -75,7 +75,7 @@ // pictureBox3 // 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.Size = new System.Drawing.Size(68, 39); this.pictureBox3.TabIndex = 30; @@ -86,7 +86,7 @@ this.btnCancel.DialogResult = System.Windows.Forms.DialogResult.Cancel; this.btnCancel.FlatStyle = System.Windows.Forms.FlatStyle.Popup; 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.Size = new System.Drawing.Size(68, 41); this.btnCancel.TabIndex = 26; @@ -96,7 +96,7 @@ // this.btnOk.FlatStyle = System.Windows.Forms.FlatStyle.Popup; 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.Size = new System.Drawing.Size(68, 41); this.btnOk.TabIndex = 3; @@ -106,7 +106,7 @@ // pictureBox1 // 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.Size = new System.Drawing.Size(136, 126); this.pictureBox1.TabIndex = 0; @@ -115,9 +115,9 @@ // edServerUrl // 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.Size = new System.Drawing.Size(482, 26); + this.edServerUrl.Size = new System.Drawing.Size(534, 26); this.edServerUrl.TabIndex = 32; this.edServerUrl.Text = "http://localhost:7575"; // @@ -125,25 +125,15 @@ // 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.Location = new System.Drawing.Point(28, 168); + this.label1.Location = new System.Drawing.Point(28, 223); this.label1.Name = "label1"; this.label1.Size = new System.Drawing.Size(149, 16); this.label1.TabIndex = 33; 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 // - this.btnTest.Location = new System.Drawing.Point(432, 225); + this.btnTest.Location = new System.Drawing.Point(485, 279); this.btnTest.Name = "btnTest"; this.btnTest.Size = new System.Drawing.Size(75, 23); this.btnTest.TabIndex = 35; @@ -151,13 +141,29 @@ this.btnTest.UseVisualStyleBackColor = true; 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 // this.AutoScaleDimensions = new System.Drawing.SizeF(6F, 13F); this.AutoScaleMode = System.Windows.Forms.AutoScaleMode.Font; - this.ClientSize = new System.Drawing.Size(537, 513); - this.Controls.Add(this.btnTest); + this.AutoSize = true; + this.ClientSize = new System.Drawing.Size(614, 545); + this.ControlBox = false; this.Controls.Add(this.label2); + this.Controls.Add(this.btnTest); this.Controls.Add(this.label1); this.Controls.Add(this.edServerUrl); this.Controls.Add(this.pictureBox2); @@ -169,7 +175,7 @@ this.Controls.Add(this.pictureBox1); this.Icon = ((System.Drawing.Icon)(resources.GetObject("$this.Icon"))); 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); ((System.ComponentModel.ISupportInitialize)(this.pictureBox2)).EndInit(); ((System.ComponentModel.ISupportInitialize)(this.pictureBox3)).EndInit(); @@ -190,7 +196,7 @@ private System.Windows.Forms.PictureBox pictureBox2; private System.Windows.Forms.TextBox edServerUrl; private System.Windows.Forms.Label label1; - private System.Windows.Forms.Label label2; private System.Windows.Forms.Button btnTest; + private System.Windows.Forms.Label label2; } } \ No newline at end of file diff --git a/source/Plugins/AyaNova.Plugin.V8/Auth.cs b/source/Plugins/AyaNova.Plugin.V8/Auth.cs index 545e794..126f4d3 100644 --- a/source/Plugins/AyaNova.Plugin.V8/Auth.cs +++ b/source/Plugins/AyaNova.Plugin.V8/Auth.cs @@ -64,6 +64,11 @@ namespace AyaNova.PlugIn.V8 #endif } + private void label2_Click(object sender, EventArgs e) + { + + } + } } diff --git a/source/Plugins/AyaNova.Plugin.V8/V8.cs b/source/Plugins/AyaNova.Plugin.V8/V8.cs index bbcb748..2336976 100644 --- a/source/Plugins/AyaNova.Plugin.V8/V8.cs +++ b/source/Plugins/AyaNova.Plugin.V8/V8.cs @@ -155,7 +155,7 @@ namespace AyaNova.PlugIn.V8 /// 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 /// - private void DoExport() + private async void DoExport() { Map.Clear(); @@ -178,7 +178,8 @@ namespace AyaNova.PlugIn.V8 //Export in correct order: //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 ExportUnitModelCategories(progress); @@ -221,7 +222,7 @@ namespace AyaNova.PlugIn.V8 #region Global settings private void ExportGlobalSettings(ProgressForm progress) { - List objectExcludeProperties = new List(standardExcludePropertiesList); + progress.Append("STUB: Dumping Global Settings"); ////DumpObjectToFolder(tempArchiveFolder, AyaBizUtils.GlobalSettings, "globalsettings", objectExcludeProperties, new TypeAndID(RootObjectTypes.Global, Address.GlobalAddressID)); } @@ -230,7 +231,7 @@ namespace AyaNova.PlugIn.V8 #region locales private void ExportLocales(ProgressForm progress) { - List objectExcludeProperties = new List(standardExcludePropertiesList); + // List objectExcludeProperties = new List(standardExcludePropertiesList); //Skip stock locales already handled in Raven List SkipLocales = new List(); @@ -255,9 +256,8 @@ namespace AyaNova.PlugIn.V8 #region REGIONS private void ExportRegions(ProgressForm progress) { - List objectExcludeProperties = new List(standardExcludePropertiesList); - objectExcludeProperties.Add("ContractName"); - objectExcludeProperties.Add("uiHasTechNotes"); + // List objectExcludeProperties = new List(standardExcludePropertiesList); + RegionList l = RegionList.GetList(string.Empty); progress.Append("Dumping " + l.Count.ToString() + " Regions"); foreach (RegionList.RegionListInfo i in l) @@ -281,7 +281,7 @@ namespace AyaNova.PlugIn.V8 } private void ExportSeedNumbers(ProgressForm progress) { - List objectExcludeProperties = new List(standardExcludePropertiesList); + // List objectExcludeProperties = new List(standardExcludePropertiesList); progress.Append("Dumping seeds"); //create a new object with the id numbers in it and then dump it WorkorderPMList pml = WorkorderPMList.GetList(" \r\n" + @@ -309,9 +309,6 @@ namespace AyaNova.PlugIn.V8 #region clients private void ExportClients(ProgressForm progress) { - List objectExcludeProperties = new List(standardExcludePropertiesList); - objectExcludeProperties.Add("ContractName"); - objectExcludeProperties.Add("uiHasTechNotes"); ClientPickList pl = ClientPickList.GetList(); progress.Append("Dumping " + pl.Count.ToString() + " Clients"); foreach (ClientPickList.ClientPickListInfo i in pl) @@ -326,9 +323,7 @@ namespace AyaNova.PlugIn.V8 #region headoffices private void ExportHeadOffices(ProgressForm progress) { - List excludes = new List(standardExcludePropertiesList); - //excludes.Add("ContractInEffect"); - //excludes.Add("uiHasTechNotes"); + PickListAutoComplete pl = PickListAutoComplete.GetList("**", "headoffice"); progress.Append("Dumping " + pl.Count.ToString() + " Head offices"); @@ -341,7 +336,7 @@ namespace AyaNova.PlugIn.V8 #endregion clients #region users - private void ExportUsers(ProgressForm progress) + private async void ExportUsers(ProgressForm progress) { //List objectExcludeProperties = new List(standardExcludePropertiesList); @@ -388,7 +383,7 @@ namespace AyaNova.PlugIn.V8 Tagit(c.DispatchZoneID, tags); SetTags(d, tags); - util.PostAsync(" + var a=await util.PostAsync("User", d.ToString()); //JObject xtra = new JObject();