From c45aa862b2d3d4bbc115abf4e70ff82c96beb1d6 Mon Sep 17 00:00:00 2001 From: =?utf8?q?V=C3=A1s=C3=A1ry=20D=C3=A1niel?= Date: Fri, 20 Oct 2017 11:28:54 +0000 Subject: [PATCH] git-tfs-id: [http://tfs.userrendszerhaz.hu:8080/tfs/DefaultCollection]$/MediaCube;C30654 --- client/AudioRecorder/AudioRecorder.csproj | 18 +++ client/AudioRecorder/MainForm.Designer.cs | 5 +- .../Resources/configuration.json | 2 +- .../IntegrationTests/IntegrationTests.csproj | 18 +++ client/IntegrationTests/PlanAIRTests.cs | 4 +- .../Maestro/ArchiveMetadataForm.Designer.cs | 114 +++++++++--------- client/Maestro/ArchiveMetadataForm.cs | 30 ++--- client/Maestro/Maestro.csproj | 19 +++ client/Maestro/MaestroForm.Designer.cs | 2 - client/Maestro/MaestroForm.Metadata.cs | 18 +-- client/Maestro/MaestroForm.Target.cs | 2 +- client/Maestro/MaestroForm.cs | 16 +-- .../ArchiveMetadataForm.datasource | 10 ++ client/Maestro/StringResources.Designer.cs | 8 +- client/Maestro/StringResources.resx | 6 +- client/Maestro/Targets/UNCTargetProcessor.cs | 14 +-- client/MediaCube.sln | 27 +++-- client/MediaCubeClient/MediaCubeClient.csproj | 18 +++ client/OctopusClient/OctopusClient.csproj | 18 +++ .../OctopusIDSelector.Designer.cs | 1 + client/OctopusClient/OctopusIDSelector.cs | 75 +++++++----- .../PasswordEncrypter.csproj | 20 +++ client/PlanAIRClient/SearchResult.cs | 6 +- client/PlanAIRClient/TrafficAPI.cs | 12 +- client/PlanAIRClient/TrafficClient.csproj | 18 +++ .../TrafficIDSelector.Designer.cs | 2 +- client/PlanAIRClient/TrafficIDSelector.cs | 78 +++++++----- .../Workers/AdvertisementWorker.cs | 20 +-- .../PlanAIRClient/Workers/BroadcastWorker.cs | 20 +-- .../Workers/PromotionalWorker.cs | 20 +-- 30 files changed, 402 insertions(+), 219 deletions(-) create mode 100644 client/Maestro/Properties/DataSources/ArchiveMetadataForm.datasource diff --git a/client/AudioRecorder/AudioRecorder.csproj b/client/AudioRecorder/AudioRecorder.csproj index 145dd2e1..db864e29 100644 --- a/client/AudioRecorder/AudioRecorder.csproj +++ b/client/AudioRecorder/AudioRecorder.csproj @@ -58,6 +58,24 @@ MinimumRecommendedRules.ruleset false + + true + bin\x64\Debug\ + DEBUG;TRACE + full + x64 + prompt + MinimumRecommendedRules.ruleset + + + bin\x64\Release\ + TRACE + true + pdbonly + x64 + prompt + MinimumRecommendedRules.ruleset + diff --git a/client/AudioRecorder/MainForm.Designer.cs b/client/AudioRecorder/MainForm.Designer.cs index b3ee30fc..49a53749 100644 --- a/client/AudioRecorder/MainForm.Designer.cs +++ b/client/AudioRecorder/MainForm.Designer.cs @@ -208,9 +208,12 @@ namespace AudioRecorder { this.Controls.Add(this.groupBox3); this.Controls.Add(this.groupBox2); this.Controls.Add(this.groupBox1); - this.FormBorderStyle = System.Windows.Forms.FormBorderStyle.FixedToolWindow; + this.FormBorderStyle = System.Windows.Forms.FormBorderStyle.FixedDialog; this.Icon = ((System.Drawing.Icon)(resources.GetObject("$this.Icon"))); + this.MaximizeBox = false; + this.MinimizeBox = false; this.Name = "MainForm"; + this.StartPosition = System.Windows.Forms.FormStartPosition.CenterScreen; this.Text = "AudioRecorder"; this.FormClosing += new System.Windows.Forms.FormClosingEventHandler(this.MainForm_FormClosing); this.Load += new System.EventHandler(this.Form1_Load); diff --git a/client/AudioRecorder/Resources/configuration.json b/client/AudioRecorder/Resources/configuration.json index e3f8f050..d3415703 100644 --- a/client/AudioRecorder/Resources/configuration.json +++ b/client/AudioRecorder/Resources/configuration.json @@ -3,7 +3,7 @@ "unc_path": "\\\\store.in.user.hu\\upload", "working_dir": "C:\\temp", "loud_percent": 30, - "address": "http://localhost:8080/services/rest/octopus/", + "address": "http://10.10.1.28/services/rest/octopus/", "userName": "dani", "password": "dani", "timeout": 1000 diff --git a/client/IntegrationTests/IntegrationTests.csproj b/client/IntegrationTests/IntegrationTests.csproj index d507334a..11bd4bf8 100644 --- a/client/IntegrationTests/IntegrationTests.csproj +++ b/client/IntegrationTests/IntegrationTests.csproj @@ -59,6 +59,24 @@ prompt MinimumRecommendedRules.ruleset + + true + bin\x64\Debug\ + DEBUG;TRACE + full + x64 + prompt + MinimumRecommendedRules.ruleset + + + bin\x64\Release\ + TRACE + true + pdbonly + x64 + prompt + MinimumRecommendedRules.ruleset + ..\packages\MSTest.TestFramework.1.1.11\lib\net45\Microsoft.VisualStudio.TestPlatform.TestFramework.dll diff --git a/client/IntegrationTests/PlanAIRTests.cs b/client/IntegrationTests/PlanAIRTests.cs index dec97aff..d162cb62 100644 --- a/client/IntegrationTests/PlanAIRTests.cs +++ b/client/IntegrationTests/PlanAIRTests.cs @@ -61,7 +61,7 @@ namespace IntegrationTests { const string STR_PARAM = ""; //Exercise - List actual = sut.GetPromotionals(STR_PARAM); + List actual = sut.GetPromotionals(STR_PARAM); } [TestMethod] @@ -70,7 +70,7 @@ namespace IntegrationTests { const string STR_PARAM = ""; //Exercise - List actual = sut.GetAdvertisements(STR_PARAM); + List actual = sut.GetAdvertisements(STR_PARAM); } [TestMethod] diff --git a/client/Maestro/ArchiveMetadataForm.Designer.cs b/client/Maestro/ArchiveMetadataForm.Designer.cs index e316a623..99f8a5d9 100644 --- a/client/Maestro/ArchiveMetadataForm.Designer.cs +++ b/client/Maestro/ArchiveMetadataForm.Designer.cs @@ -29,16 +29,16 @@ this.label_mediaID = new System.Windows.Forms.Label(); this.label_mediaTitle = new System.Windows.Forms.Label(); this.label_mediaDescription = new System.Windows.Forms.Label(); - this.textBox_stuffID = new System.Windows.Forms.TextBox(); - this.textBox_stuffTitle = new System.Windows.Forms.TextBox(); - this.textBox_stuffDescription = new System.Windows.Forms.TextBox(); + this.textBox_itemID = new System.Windows.Forms.TextBox(); + this.textBox_itemTitle = new System.Windows.Forms.TextBox(); + this.textBox_itemDescription = new System.Windows.Forms.TextBox(); this.textBox_mediaID = new System.Windows.Forms.TextBox(); this.textBox_mediaTitle = new System.Windows.Forms.TextBox(); this.textBox_mediaDescription = new System.Windows.Forms.TextBox(); this.label_stuffTitle = new System.Windows.Forms.Label(); this.groupBox1 = new System.Windows.Forms.GroupBox(); - this.button_Ok = new System.Windows.Forms.Button(); - this.buttonCancel = new System.Windows.Forms.Button(); + this.btnOk = new System.Windows.Forms.Button(); + this.btnCancel = new System.Windows.Forms.Button(); this.tableLayoutPanel1 = new System.Windows.Forms.TableLayoutPanel(); this.groupBox1.SuspendLayout(); this.tableLayoutPanel1.SuspendLayout(); @@ -74,6 +74,7 @@ // label_mediaTitle // this.label_mediaTitle.Anchor = ((System.Windows.Forms.AnchorStyles)((System.Windows.Forms.AnchorStyles.Bottom | System.Windows.Forms.AnchorStyles.Left))); + this.label_mediaTitle.Font = new System.Drawing.Font("Microsoft Sans Serif", 8.25F, System.Drawing.FontStyle.Bold, System.Drawing.GraphicsUnit.Point, ((byte)(238))); this.label_mediaTitle.Location = new System.Drawing.Point(8, 206); this.label_mediaTitle.Name = "label_mediaTitle"; this.label_mediaTitle.Size = new System.Drawing.Size(57, 13); @@ -90,37 +91,39 @@ this.label_mediaDescription.TabIndex = 5; this.label_mediaDescription.Text = "Média leírás"; // - // textBox_stuffID + // textBox_itemID // - this.textBox_stuffID.Dock = System.Windows.Forms.DockStyle.Fill; - this.textBox_stuffID.Location = new System.Drawing.Point(8, 28); - this.textBox_stuffID.Name = "textBox_stuffID"; - this.textBox_stuffID.Size = new System.Drawing.Size(549, 20); - this.textBox_stuffID.TabIndex = 6; + this.textBox_itemID.Dock = System.Windows.Forms.DockStyle.Fill; + this.textBox_itemID.Location = new System.Drawing.Point(8, 28); + this.textBox_itemID.Name = "textBox_itemID"; + this.textBox_itemID.ReadOnly = true; + this.textBox_itemID.Size = new System.Drawing.Size(549, 20); + this.textBox_itemID.TabIndex = 6; // - // textBox_stuffTitle + // textBox_itemTitle // - this.textBox_stuffTitle.Dock = System.Windows.Forms.DockStyle.Fill; - this.textBox_stuffTitle.Location = new System.Drawing.Point(8, 68); - this.textBox_stuffTitle.Name = "textBox_stuffTitle"; - this.textBox_stuffTitle.Size = new System.Drawing.Size(549, 20); - this.textBox_stuffTitle.TabIndex = 7; + this.textBox_itemTitle.Dock = System.Windows.Forms.DockStyle.Fill; + this.textBox_itemTitle.Location = new System.Drawing.Point(8, 68); + this.textBox_itemTitle.Name = "textBox_itemTitle"; + this.textBox_itemTitle.Size = new System.Drawing.Size(549, 20); + this.textBox_itemTitle.TabIndex = 7; // - // textBox_stuffDescription + // textBox_itemDescription // - this.textBox_stuffDescription.Dock = System.Windows.Forms.DockStyle.Fill; - this.textBox_stuffDescription.Location = new System.Drawing.Point(8, 108); - this.textBox_stuffDescription.Multiline = true; - this.textBox_stuffDescription.Name = "textBox_stuffDescription"; - this.textBox_stuffDescription.ScrollBars = System.Windows.Forms.ScrollBars.Both; - this.textBox_stuffDescription.Size = new System.Drawing.Size(549, 48); - this.textBox_stuffDescription.TabIndex = 8; + this.textBox_itemDescription.Dock = System.Windows.Forms.DockStyle.Fill; + this.textBox_itemDescription.Location = new System.Drawing.Point(8, 108); + this.textBox_itemDescription.Multiline = true; + this.textBox_itemDescription.Name = "textBox_itemDescription"; + this.textBox_itemDescription.ScrollBars = System.Windows.Forms.ScrollBars.Both; + this.textBox_itemDescription.Size = new System.Drawing.Size(549, 48); + this.textBox_itemDescription.TabIndex = 8; // // textBox_mediaID // this.textBox_mediaID.Dock = System.Windows.Forms.DockStyle.Fill; this.textBox_mediaID.Location = new System.Drawing.Point(8, 182); this.textBox_mediaID.Name = "textBox_mediaID"; + this.textBox_mediaID.ReadOnly = true; this.textBox_mediaID.Size = new System.Drawing.Size(549, 20); this.textBox_mediaID.TabIndex = 9; // @@ -145,6 +148,7 @@ // label_stuffTitle // this.label_stuffTitle.Anchor = ((System.Windows.Forms.AnchorStyles)((System.Windows.Forms.AnchorStyles.Bottom | System.Windows.Forms.AnchorStyles.Left))); + this.label_stuffTitle.Font = new System.Drawing.Font("Microsoft Sans Serif", 8.25F, System.Drawing.FontStyle.Bold, System.Drawing.GraphicsUnit.Point, ((byte)(238))); this.label_stuffTitle.Location = new System.Drawing.Point(8, 52); this.label_stuffTitle.Name = "label_stuffTitle"; this.label_stuffTitle.Size = new System.Drawing.Size(58, 13); @@ -153,8 +157,8 @@ // // groupBox1 // - this.groupBox1.Controls.Add(this.button_Ok); - this.groupBox1.Controls.Add(this.buttonCancel); + this.groupBox1.Controls.Add(this.btnOk); + this.groupBox1.Controls.Add(this.btnCancel); this.groupBox1.Dock = System.Windows.Forms.DockStyle.Bottom; this.groupBox1.Location = new System.Drawing.Point(0, 357); this.groupBox1.Name = "groupBox1"; @@ -162,27 +166,27 @@ this.groupBox1.TabIndex = 1; this.groupBox1.TabStop = false; // - // button_Ok + // btnOk // - this.button_Ok.Anchor = System.Windows.Forms.AnchorStyles.Right; - this.button_Ok.Location = new System.Drawing.Point(488, 19); - this.button_Ok.Name = "button_Ok"; - this.button_Ok.Size = new System.Drawing.Size(75, 23); - this.button_Ok.TabIndex = 1; - this.button_Ok.Text = "Rendben"; - this.button_Ok.UseVisualStyleBackColor = true; - this.button_Ok.Click += new System.EventHandler(this.button_Ok_Click_1); + this.btnOk.Anchor = System.Windows.Forms.AnchorStyles.Right; + this.btnOk.Location = new System.Drawing.Point(488, 19); + this.btnOk.Name = "btnOk"; + this.btnOk.Size = new System.Drawing.Size(75, 23); + this.btnOk.TabIndex = 1; + this.btnOk.Text = "Rendben"; + this.btnOk.UseVisualStyleBackColor = true; + this.btnOk.Click += new System.EventHandler(this.OnOkClick); // - // buttonCancel + // btnCancel // - this.buttonCancel.Anchor = System.Windows.Forms.AnchorStyles.Right; - this.buttonCancel.Location = new System.Drawing.Point(409, 19); - this.buttonCancel.Name = "buttonCancel"; - this.buttonCancel.Size = new System.Drawing.Size(75, 23); - this.buttonCancel.TabIndex = 0; - this.buttonCancel.Text = "Mégse"; - this.buttonCancel.UseVisualStyleBackColor = true; - this.buttonCancel.Click += new System.EventHandler(this.buttonCancel_Click); + this.btnCancel.Anchor = System.Windows.Forms.AnchorStyles.Right; + this.btnCancel.Location = new System.Drawing.Point(409, 19); + this.btnCancel.Name = "btnCancel"; + this.btnCancel.Size = new System.Drawing.Size(75, 23); + this.btnCancel.TabIndex = 0; + this.btnCancel.Text = "Mégsem"; + this.btnCancel.UseVisualStyleBackColor = true; + this.btnCancel.Click += new System.EventHandler(this.OnCancelClick); // // tableLayoutPanel1 // @@ -193,9 +197,9 @@ this.tableLayoutPanel1.Controls.Add(this.label_mediaTitle, 0, 8); this.tableLayoutPanel1.Controls.Add(this.textBox_mediaID, 0, 7); this.tableLayoutPanel1.Controls.Add(this.label_mediaID, 0, 6); - this.tableLayoutPanel1.Controls.Add(this.textBox_stuffDescription, 0, 5); - this.tableLayoutPanel1.Controls.Add(this.textBox_stuffTitle, 0, 3); - this.tableLayoutPanel1.Controls.Add(this.textBox_stuffID, 0, 1); + this.tableLayoutPanel1.Controls.Add(this.textBox_itemDescription, 0, 5); + this.tableLayoutPanel1.Controls.Add(this.textBox_itemTitle, 0, 3); + this.tableLayoutPanel1.Controls.Add(this.textBox_itemID, 0, 1); this.tableLayoutPanel1.Controls.Add(this.label_stuffID, 0, 0); this.tableLayoutPanel1.Controls.Add(this.label_mediaDescription, 0, 10); this.tableLayoutPanel1.Controls.Add(this.label_stuffDescription, 0, 4); @@ -222,15 +226,17 @@ // // ArchiveMetadataForm // + this.AcceptButton = this.btnOk; this.AutoScaleDimensions = new System.Drawing.SizeF(6F, 13F); this.AutoScaleMode = System.Windows.Forms.AutoScaleMode.Font; + this.CancelButton = this.btnCancel; this.ClientSize = new System.Drawing.Size(565, 405); this.Controls.Add(this.tableLayoutPanel1); this.Controls.Add(this.groupBox1); this.Icon = global::Maestro.Properties.Resources.AppIcon; this.Name = "ArchiveMetadataForm"; this.StartPosition = System.Windows.Forms.FormStartPosition.CenterParent; - this.Text = "Archive metaadatok módosítása"; + this.Text = "Archiv adatok"; this.groupBox1.ResumeLayout(false); this.tableLayoutPanel1.ResumeLayout(false); this.tableLayoutPanel1.PerformLayout(); @@ -246,15 +252,15 @@ private System.Windows.Forms.Label label_mediaID; private System.Windows.Forms.Label label_mediaTitle; private System.Windows.Forms.Label label_mediaDescription; - private System.Windows.Forms.TextBox textBox_stuffID; - private System.Windows.Forms.TextBox textBox_stuffTitle; - private System.Windows.Forms.TextBox textBox_stuffDescription; + private System.Windows.Forms.TextBox textBox_itemID; + private System.Windows.Forms.TextBox textBox_itemTitle; + private System.Windows.Forms.TextBox textBox_itemDescription; private System.Windows.Forms.TextBox textBox_mediaID; private System.Windows.Forms.TextBox textBox_mediaTitle; private System.Windows.Forms.TextBox textBox_mediaDescription; private System.Windows.Forms.GroupBox groupBox1; - private System.Windows.Forms.Button button_Ok; - private System.Windows.Forms.Button buttonCancel; + private System.Windows.Forms.Button btnOk; + private System.Windows.Forms.Button btnCancel; private System.Windows.Forms.TableLayoutPanel tableLayoutPanel1; } } \ No newline at end of file diff --git a/client/Maestro/ArchiveMetadataForm.cs b/client/Maestro/ArchiveMetadataForm.cs index be7ce9da..4a174c13 100644 --- a/client/Maestro/ArchiveMetadataForm.cs +++ b/client/Maestro/ArchiveMetadataForm.cs @@ -8,34 +8,30 @@ namespace Maestro { public ArchiveMetadataForm(ArchiveMetadata model) : this() { this.model = model; - FillTheTextBoxes(); + textBox_itemID.Text = model.itemHouseId; + textBox_itemTitle.Text = model.itemTitle; + textBox_itemDescription.Text = model.itemDescription; + textBox_mediaID.Text = model.mediaHouseId; + textBox_mediaTitle.Text = model.mediaTitle; + textBox_mediaDescription.Text = model.mediaDescription; } public ArchiveMetadataForm() { InitializeComponent(); } - private void FillTheTextBoxes() { - textBox_stuffID.Text = model.itemHouseId; - textBox_stuffTitle.Text = model.itemTitle; - textBox_stuffDescription.Text = model.itemDescription; - textBox_mediaID.Text = model.mediaHouseId; - textBox_mediaTitle.Text = model.mediaTitle; - textBox_mediaDescription.Text = model.mediaDescription; - } - - private void button_Ok_Click_1(object sender, System.EventArgs e) { - model.itemHouseId = textBox_stuffID.Text; - model.itemTitle = textBox_stuffTitle.Text; - model.itemDescription = textBox_stuffDescription.Text; + private void OnOkClick(object sender, System.EventArgs e) { + model.itemHouseId = textBox_itemID.Text; + model.itemTitle = textBox_itemTitle.Text; + model.itemDescription = textBox_itemDescription.Text; model.mediaHouseId = textBox_mediaID.Text; model.mediaTitle = textBox_mediaTitle.Text; model.mediaDescription = textBox_mediaDescription.Text; - Dispose(); + Close(); } - private void buttonCancel_Click(object sender, System.EventArgs e) { - Dispose(); + private void OnCancelClick(object sender, System.EventArgs e) { + Close(); } } } diff --git a/client/Maestro/Maestro.csproj b/client/Maestro/Maestro.csproj index bd8ea185..ec0469fe 100644 --- a/client/Maestro/Maestro.csproj +++ b/client/Maestro/Maestro.csproj @@ -101,6 +101,24 @@ Properties\app.manifest + + true + bin\x64\Debug\ + DEBUG;TRACE + full + x64 + prompt + MinimumRecommendedRules.ruleset + + + bin\x64\Release\ + TRACE + true + pdbonly + x64 + prompt + MinimumRecommendedRules.ruleset + ..\packages\FluentFTP.19.1.1\lib\net45\FluentFTP.dll @@ -275,6 +293,7 @@ + diff --git a/client/Maestro/MaestroForm.Designer.cs b/client/Maestro/MaestroForm.Designer.cs index 6315d164..e24f81d7 100644 --- a/client/Maestro/MaestroForm.Designer.cs +++ b/client/Maestro/MaestroForm.Designer.cs @@ -393,7 +393,6 @@ namespace Maestro { // octopusIDSelector // this.octopusIDSelector.BackColor = System.Drawing.Color.White; - this.octopusIDSelector.ClearCheckBox = null; this.octopusIDSelector.Disposeabel = false; this.octopusIDSelector.Dock = System.Windows.Forms.DockStyle.Fill; this.octopusIDSelector.ErrorReporter = null; @@ -422,7 +421,6 @@ namespace Maestro { // this.trafficIDSelector.AutoSize = true; this.trafficIDSelector.BackColor = System.Drawing.Color.White; - this.trafficIDSelector.clearCheckBox = null; this.trafficIDSelector.Dock = System.Windows.Forms.DockStyle.Fill; this.trafficIDSelector.ErrorReporter = null; this.trafficIDSelector.IDChangedEvent = null; diff --git a/client/Maestro/MaestroForm.Metadata.cs b/client/Maestro/MaestroForm.Metadata.cs index 4ca59e98..14177048 100644 --- a/client/Maestro/MaestroForm.Metadata.cs +++ b/client/Maestro/MaestroForm.Metadata.cs @@ -147,7 +147,9 @@ namespace Maestro { if (String.IsNullOrEmpty(id)) return null; TrafficAPI api = trafficIDSelector.trafficAPI; - List trafficResult = null; + List trafficResult = null; + MetadataType metadataType = GetTrafficMetadataType(id); + if (id.StartsWith("M")) trafficResult = api.GetBroadcastArchiveMetadata(id); else if (id.StartsWith("P")) @@ -157,7 +159,7 @@ namespace Maestro { if (trafficResult == null) return null; ArchiveMetadata result = new ArchiveMetadata(); - ArchiveMatadataWrapper actualResult = trafficResult[0]; + TrafficClient.TrafficItemMetadata actualResult = trafficResult[0]; result.itemHouseId = actualResult.ProgID; result.itemTitle = actualResult.ProgTitle; result.itemDescription = actualResult.ProgDescription; @@ -230,6 +232,8 @@ namespace Maestro { } private void OnOctopusIDSelected(string selectedID) { + trafficIDSelector.ClearSelection(); + archiveMetadata = null; if (selectedID == null) { SelectedMetadata = null; return; @@ -239,11 +243,13 @@ namespace Maestro { Tooltip = "Story ID", ID = selectedID }; - EnableArchiveMetadataButtonAndCreateMetadataModel(); + UpdateEditArchiveMetadataEnabled(); UpdateDefineSegmentEnabled(); } private void OnTrafficIDSelected(string selectedID, int variantID) { + octopusIDSelector.ClearSelection(); + archiveMetadata = null; if (selectedID == null) { SelectedMetadata = null; return; @@ -254,14 +260,12 @@ namespace Maestro { ID = selectedID, VariantID = variantID }; - EnableArchiveMetadataButtonAndCreateMetadataModel(); + UpdateEditArchiveMetadataEnabled(); UpdateDefineSegmentEnabled(); } - private void EnableArchiveMetadataButtonAndCreateMetadataModel() { + private void UpdateEditArchiveMetadataEnabled() { ctxiModifyArchiveMetadata.Enabled = selectedMetadata != null; - if (!ctxiModifyArchiveMetadata.Enabled) - archiveMetadata = null; } private void UpdateDefineSegmentEnabled() { diff --git a/client/Maestro/MaestroForm.Target.cs b/client/Maestro/MaestroForm.Target.cs index 033bdf34..81893c5c 100644 --- a/client/Maestro/MaestroForm.Target.cs +++ b/client/Maestro/MaestroForm.Target.cs @@ -218,7 +218,7 @@ namespace Maestro { } UpdateDefineSegmentEnabled(); - EnableArchiveMetadataButtonAndCreateMetadataModel(); + UpdateEditArchiveMetadataEnabled(); } public void OnTargetPanelsMouseClick(object sender, MouseEventArgs e) { diff --git a/client/Maestro/MaestroForm.cs b/client/Maestro/MaestroForm.cs index 5829c36b..f2a7315a 100644 --- a/client/Maestro/MaestroForm.cs +++ b/client/Maestro/MaestroForm.cs @@ -42,8 +42,8 @@ namespace Maestro { public MaestroForm() { InitializeComponent(); - trafficIDSelector.clearCheckBox = octopusIDSelector.ClearEveryCheckBox; - octopusIDSelector.ClearCheckBox = trafficIDSelector.ClearSelectionSource; + //trafficIDSelector.clearCheckBox = octopusIDSelector.ClearEveryCheckBox; + //octopusIDSelector.ClearCheckBox = trafficIDSelector.ClearSelection; octopusIDSelector.ErrorReporter = ReportError; groups = new GroupBox[] { groupSource, groupMetadata, groupTarget, groupActions }; trafficMetadataSelected = OnTrafficIDSelected; @@ -67,7 +67,7 @@ namespace Maestro { columnStatus.HeaderText = StringResources.STATUSZ; columnLabel.HeaderText = StringResources.CIM; ctxiDefineSegments.Text = StringResources.SZEGMENS_LETREHOZASA; - ctxiModifyArchiveMetadata.Text = StringResources.ARCHÍV_METAADATOK_MODOSITASA; + ctxiModifyArchiveMetadata.Text = StringResources.ARCHIV_METAADATOK; } private void InitializeComponents() { @@ -194,7 +194,7 @@ namespace Maestro { } List list = stories.ToList(); if (list.Count == 1) { - EnableArchiveMetadataButtonAndCreateMetadataModel(); + UpdateEditArchiveMetadataEnabled(); textSelectedMetadata.Text = list[0].ID; octopusMetadataSelected?.Invoke(list[0].ID); //octopusIDSelector.IDSelectedFromOutside(list[0].ID); @@ -216,7 +216,7 @@ namespace Maestro { return; } if (list.Count == 1) { - EnableArchiveMetadataButtonAndCreateMetadataModel(); + UpdateEditArchiveMetadataEnabled(); textSelectedMetadata.Text = list[0].ID; octopusMetadataSelected?.Invoke(list[0].ID); //octopusIDSelector.IDSelectedFromOutside(list[0].ID); @@ -229,7 +229,7 @@ namespace Maestro { private void SetTrafficIDToMetadataText() { TrafficAPI api = trafficIDSelector.trafficAPI; Cursor.Current = Cursors.WaitCursor; - List result = null; + List result = null; if (startingName.StartsWith("M")) result = api.GetBroadcasts(startingName, null, null, true); else if (startingName.StartsWith("P")) @@ -240,14 +240,14 @@ namespace Maestro { Cursor.Current = Cursors.Default; } - private void ProcessMamResults(List result) { + private void ProcessMamResults(List result) { if (result == null || result.Count == 0) { MessageBox.Show(this, StringResources.NINCS_TALALAT); return; } if (result.Count == 1) { trafficMetadataSelected?.Invoke(result[0].MediaID, result[0].VariantID); - EnableArchiveMetadataButtonAndCreateMetadataModel(); + UpdateEditArchiveMetadataEnabled(); textSelectedMetadata.Text = result[0].MediaID; return; } diff --git a/client/Maestro/Properties/DataSources/ArchiveMetadataForm.datasource b/client/Maestro/Properties/DataSources/ArchiveMetadataForm.datasource new file mode 100644 index 00000000..61f0aa7d --- /dev/null +++ b/client/Maestro/Properties/DataSources/ArchiveMetadataForm.datasource @@ -0,0 +1,10 @@ + + + + Maestro.ArchiveMetadataForm, Maestro, Version=1.9.0.0, Culture=neutral, PublicKeyToken=null + \ No newline at end of file diff --git a/client/Maestro/StringResources.Designer.cs b/client/Maestro/StringResources.Designer.cs index c482b46d..f9070afa 100644 --- a/client/Maestro/StringResources.Designer.cs +++ b/client/Maestro/StringResources.Designer.cs @@ -88,11 +88,11 @@ namespace Maestro { } /// - /// Looks up a localized string similar to Archív metaadatok módosítása. + /// Looks up a localized string similar to Archív adatok. /// - internal static string ARCHÍV_METAADATOK_MODOSITASA { + internal static string ARCHIV_METAADATOK { get { - return ResourceManager.GetString("ARCHÍV_METAADATOK_MODOSITASA", resourceCulture); + return ResourceManager.GetString("ARCHIV_METAADATOK", resourceCulture); } } @@ -295,7 +295,7 @@ namespace Maestro { } /// - /// Looks up a localized string similar to Szegmens létrehozása. + /// Looks up a localized string similar to Szegmensek. /// internal static string SZEGMENS_LETREHOZASA { get { diff --git a/client/Maestro/StringResources.resx b/client/Maestro/StringResources.resx index d7a78709..d0cfc282 100644 --- a/client/Maestro/StringResources.resx +++ b/client/Maestro/StringResources.resx @@ -129,8 +129,8 @@ Archive - - Archív metaadatok módosítása + + Archív adatok Befejezés @@ -196,7 +196,7 @@ Státusz - Szegmens létrehozása + Szegmensek Törlés diff --git a/client/Maestro/Targets/UNCTargetProcessor.cs b/client/Maestro/Targets/UNCTargetProcessor.cs index 6120be7e..f300eb45 100644 --- a/client/Maestro/Targets/UNCTargetProcessor.cs +++ b/client/Maestro/Targets/UNCTargetProcessor.cs @@ -8,6 +8,7 @@ using Model; using System.Text; using Maestro.Commons; using Commons; +using Maestro.Metadata; namespace Maestro.Targets { @@ -103,17 +104,16 @@ namespace Maestro.Targets { CreateMetadata(); if (parameters.TargetConfig.SaveSegments && parameters.Segments != null) { switch (parameters.MetadataKind) { - case Metadata.MetadataType.TrafficMaterial: { + case MetadataType.TrafficMaterial: SaveMaterialSegments(); - break; } - case Metadata.MetadataType.TrafficAD: { + break; + case MetadataType.TrafficAD: SaveADSegments(); - break; } - case Metadata.MetadataType.TrafficPromo: { + break; + case MetadataType.TrafficPromo: SavePromoSegments(); - break; } + break; } - } if (parameters.TargetConfig.SendEmailOnSuccess && !String.IsNullOrEmpty(parameters.TargetConfig.SuccessEmailRecipient) && !String.IsNullOrEmpty(parameters.TargetConfig.SuccessEmailPattern)) SendEmail(parameters.TargetConfig.SuccessEmailRecipient, parameters.TargetConfig.SuccessEmailPattern); diff --git a/client/MediaCube.sln b/client/MediaCube.sln index f7e2b958..6553be06 100644 --- a/client/MediaCube.sln +++ b/client/MediaCube.sln @@ -42,8 +42,8 @@ Global {0B44B3D7-52D7-4C0E-9B1C-F48CEEDA36FE}.Release|x86.Build.0 = Release|Any CPU {BAF3E174-5D82-40FA-9E62-8C76ADBEA1E4}.Debug|Any CPU.ActiveCfg = Debug|Any CPU {BAF3E174-5D82-40FA-9E62-8C76ADBEA1E4}.Debug|Any CPU.Build.0 = Debug|Any CPU - {BAF3E174-5D82-40FA-9E62-8C76ADBEA1E4}.Debug|x64.ActiveCfg = Debug|Any CPU - {BAF3E174-5D82-40FA-9E62-8C76ADBEA1E4}.Debug|x64.Build.0 = Debug|Any CPU + {BAF3E174-5D82-40FA-9E62-8C76ADBEA1E4}.Debug|x64.ActiveCfg = Debug|x64 + {BAF3E174-5D82-40FA-9E62-8C76ADBEA1E4}.Debug|x64.Build.0 = Debug|x64 {BAF3E174-5D82-40FA-9E62-8C76ADBEA1E4}.Debug|x86.ActiveCfg = Debug|x86 {BAF3E174-5D82-40FA-9E62-8C76ADBEA1E4}.Debug|x86.Build.0 = Debug|x86 {BAF3E174-5D82-40FA-9E62-8C76ADBEA1E4}.Release|Any CPU.ActiveCfg = Release|Any CPU @@ -54,8 +54,8 @@ Global {BAF3E174-5D82-40FA-9E62-8C76ADBEA1E4}.Release|x86.Build.0 = Release|Any CPU {CEFD0348-DED4-453E-BF3A-0B52F8890AB3}.Debug|Any CPU.ActiveCfg = Debug|Any CPU {CEFD0348-DED4-453E-BF3A-0B52F8890AB3}.Debug|Any CPU.Build.0 = Debug|Any CPU - {CEFD0348-DED4-453E-BF3A-0B52F8890AB3}.Debug|x64.ActiveCfg = Debug|Any CPU - {CEFD0348-DED4-453E-BF3A-0B52F8890AB3}.Debug|x64.Build.0 = Debug|Any CPU + {CEFD0348-DED4-453E-BF3A-0B52F8890AB3}.Debug|x64.ActiveCfg = Debug|x64 + {CEFD0348-DED4-453E-BF3A-0B52F8890AB3}.Debug|x64.Build.0 = Debug|x64 {CEFD0348-DED4-453E-BF3A-0B52F8890AB3}.Debug|x86.ActiveCfg = Debug|x86 {CEFD0348-DED4-453E-BF3A-0B52F8890AB3}.Debug|x86.Build.0 = Debug|x86 {CEFD0348-DED4-453E-BF3A-0B52F8890AB3}.Release|Any CPU.ActiveCfg = Release|Any CPU @@ -66,8 +66,8 @@ Global {CEFD0348-DED4-453E-BF3A-0B52F8890AB3}.Release|x86.Build.0 = Release|Any CPU {8CC7C930-9DBF-487B-AED5-776937A649D5}.Debug|Any CPU.ActiveCfg = Debug|Any CPU {8CC7C930-9DBF-487B-AED5-776937A649D5}.Debug|Any CPU.Build.0 = Debug|Any CPU - {8CC7C930-9DBF-487B-AED5-776937A649D5}.Debug|x64.ActiveCfg = Debug|Any CPU - {8CC7C930-9DBF-487B-AED5-776937A649D5}.Debug|x64.Build.0 = Debug|Any CPU + {8CC7C930-9DBF-487B-AED5-776937A649D5}.Debug|x64.ActiveCfg = Debug|x64 + {8CC7C930-9DBF-487B-AED5-776937A649D5}.Debug|x64.Build.0 = Debug|x64 {8CC7C930-9DBF-487B-AED5-776937A649D5}.Debug|x86.ActiveCfg = Debug|x86 {8CC7C930-9DBF-487B-AED5-776937A649D5}.Debug|x86.Build.0 = Debug|x86 {8CC7C930-9DBF-487B-AED5-776937A649D5}.Release|Any CPU.ActiveCfg = Release|Any CPU @@ -78,8 +78,8 @@ Global {8CC7C930-9DBF-487B-AED5-776937A649D5}.Release|x86.Build.0 = Release|Any CPU {4A61E975-F8DB-4BBF-BEFF-72FE67B2C08B}.Debug|Any CPU.ActiveCfg = Debug|Any CPU {4A61E975-F8DB-4BBF-BEFF-72FE67B2C08B}.Debug|Any CPU.Build.0 = Debug|Any CPU - {4A61E975-F8DB-4BBF-BEFF-72FE67B2C08B}.Debug|x64.ActiveCfg = Debug|Any CPU - {4A61E975-F8DB-4BBF-BEFF-72FE67B2C08B}.Debug|x64.Build.0 = Debug|Any CPU + {4A61E975-F8DB-4BBF-BEFF-72FE67B2C08B}.Debug|x64.ActiveCfg = Debug|x64 + {4A61E975-F8DB-4BBF-BEFF-72FE67B2C08B}.Debug|x64.Build.0 = Debug|x64 {4A61E975-F8DB-4BBF-BEFF-72FE67B2C08B}.Debug|x86.ActiveCfg = Debug|x86 {4A61E975-F8DB-4BBF-BEFF-72FE67B2C08B}.Debug|x86.Build.0 = Debug|x86 {4A61E975-F8DB-4BBF-BEFF-72FE67B2C08B}.Release|Any CPU.ActiveCfg = Release|Any CPU @@ -90,7 +90,8 @@ Global {4A61E975-F8DB-4BBF-BEFF-72FE67B2C08B}.Release|x86.Build.0 = Release|Any CPU {616D8912-16A4-493B-BC45-53BF2A5D9B92}.Debug|Any CPU.ActiveCfg = Debug|Any CPU {616D8912-16A4-493B-BC45-53BF2A5D9B92}.Debug|Any CPU.Build.0 = Debug|Any CPU - {616D8912-16A4-493B-BC45-53BF2A5D9B92}.Debug|x64.ActiveCfg = Debug|Any CPU + {616D8912-16A4-493B-BC45-53BF2A5D9B92}.Debug|x64.ActiveCfg = Debug|x64 + {616D8912-16A4-493B-BC45-53BF2A5D9B92}.Debug|x64.Build.0 = Debug|x64 {616D8912-16A4-493B-BC45-53BF2A5D9B92}.Debug|x86.ActiveCfg = Debug|x86 {616D8912-16A4-493B-BC45-53BF2A5D9B92}.Debug|x86.Build.0 = Debug|x86 {616D8912-16A4-493B-BC45-53BF2A5D9B92}.Release|Any CPU.ActiveCfg = Release|Any CPU @@ -100,8 +101,8 @@ Global {616D8912-16A4-493B-BC45-53BF2A5D9B92}.Release|x86.Build.0 = Release|x86 {A7A21311-CB0E-465F-8AD6-829FAF093F00}.Debug|Any CPU.ActiveCfg = Debug|Any CPU {A7A21311-CB0E-465F-8AD6-829FAF093F00}.Debug|Any CPU.Build.0 = Debug|Any CPU - {A7A21311-CB0E-465F-8AD6-829FAF093F00}.Debug|x64.ActiveCfg = Debug|Any CPU - {A7A21311-CB0E-465F-8AD6-829FAF093F00}.Debug|x64.Build.0 = Debug|Any CPU + {A7A21311-CB0E-465F-8AD6-829FAF093F00}.Debug|x64.ActiveCfg = Debug|x64 + {A7A21311-CB0E-465F-8AD6-829FAF093F00}.Debug|x64.Build.0 = Debug|x64 {A7A21311-CB0E-465F-8AD6-829FAF093F00}.Debug|x86.ActiveCfg = Debug|x86 {A7A21311-CB0E-465F-8AD6-829FAF093F00}.Debug|x86.Build.0 = Debug|x86 {A7A21311-CB0E-465F-8AD6-829FAF093F00}.Release|Any CPU.ActiveCfg = Release|Any CPU @@ -112,8 +113,8 @@ Global {A7A21311-CB0E-465F-8AD6-829FAF093F00}.Release|x86.Build.0 = Release|Any CPU {8C51D508-1759-4C10-84A4-80965FD074FF}.Debug|Any CPU.ActiveCfg = Debug|Any CPU {8C51D508-1759-4C10-84A4-80965FD074FF}.Debug|Any CPU.Build.0 = Debug|Any CPU - {8C51D508-1759-4C10-84A4-80965FD074FF}.Debug|x64.ActiveCfg = Debug|Any CPU - {8C51D508-1759-4C10-84A4-80965FD074FF}.Debug|x64.Build.0 = Debug|Any CPU + {8C51D508-1759-4C10-84A4-80965FD074FF}.Debug|x64.ActiveCfg = Debug|x64 + {8C51D508-1759-4C10-84A4-80965FD074FF}.Debug|x64.Build.0 = Debug|x64 {8C51D508-1759-4C10-84A4-80965FD074FF}.Debug|x86.ActiveCfg = Debug|Any CPU {8C51D508-1759-4C10-84A4-80965FD074FF}.Debug|x86.Build.0 = Debug|Any CPU {8C51D508-1759-4C10-84A4-80965FD074FF}.Release|Any CPU.ActiveCfg = Release|Any CPU diff --git a/client/MediaCubeClient/MediaCubeClient.csproj b/client/MediaCubeClient/MediaCubeClient.csproj index 6d1f5737..52b170f5 100644 --- a/client/MediaCubeClient/MediaCubeClient.csproj +++ b/client/MediaCubeClient/MediaCubeClient.csproj @@ -58,6 +58,24 @@ prompt MinimumRecommendedRules.ruleset + + true + bin\x64\Debug\ + DEBUG;TRACE + full + x64 + prompt + MinimumRecommendedRules.ruleset + + + bin\x64\Release\ + TRACE + true + pdbonly + x64 + prompt + MinimumRecommendedRules.ruleset + diff --git a/client/OctopusClient/OctopusClient.csproj b/client/OctopusClient/OctopusClient.csproj index a649b628..bafecb03 100644 --- a/client/OctopusClient/OctopusClient.csproj +++ b/client/OctopusClient/OctopusClient.csproj @@ -54,6 +54,24 @@ prompt MinimumRecommendedRules.ruleset + + true + bin\x64\Debug\ + DEBUG;TRACE + full + x64 + prompt + MinimumRecommendedRules.ruleset + + + bin\x64\Release\ + TRACE + true + pdbonly + x64 + prompt + MinimumRecommendedRules.ruleset + ..\packages\Newtonsoft.Json.10.0.3\lib\net45\Newtonsoft.Json.dll diff --git a/client/OctopusClient/OctopusIDSelector.Designer.cs b/client/OctopusClient/OctopusIDSelector.Designer.cs index ed60ce29..34e0a253 100644 --- a/client/OctopusClient/OctopusIDSelector.Designer.cs +++ b/client/OctopusClient/OctopusIDSelector.Designer.cs @@ -70,6 +70,7 @@ this.treeContent.BorderStyle = System.Windows.Forms.BorderStyle.None; this.treeContent.CheckBoxes = true; this.treeContent.Dock = System.Windows.Forms.DockStyle.Fill; + this.treeContent.FullRowSelect = true; this.treeContent.Location = new System.Drawing.Point(10, 70); this.treeContent.Name = "treeContent"; this.treeContent.Size = new System.Drawing.Size(251, 273); diff --git a/client/OctopusClient/OctopusIDSelector.cs b/client/OctopusClient/OctopusIDSelector.cs index bdf326d4..eac0c3d7 100644 --- a/client/OctopusClient/OctopusIDSelector.cs +++ b/client/OctopusClient/OctopusIDSelector.cs @@ -14,9 +14,11 @@ namespace OctopusClient { public partial class OctopusIDSelector : UserControl { private string id; - public ClearCheckBox ClearCheckBox { get; set; } + //TODO! + //public ClearCheckBox ClearCheckBox { get; set; } public OctopusErrorReporterDelegate ErrorReporter { get; set; } + private TreeNode selectedNode; public bool Disposeabel { get; set; } @@ -25,7 +27,7 @@ namespace OctopusClient { private int selectedRundownIndex = -1; private int selectedStoryFolderIndex = -1; public TreeNode previousSelectedNode = null; - private bool checkFromCode; + //private bool checkFromCode; public OnSelectedIDChanged IDChangedEvent { get; set; } @@ -96,6 +98,7 @@ namespace OctopusClient { } private void refreshRundowns() { + ClearSelection(); Cursor.Current = Cursors.WaitCursor; IEnumerable rundowns = client.GetRundowns(dateScheduled.Value)?.ToArray(); if (rundowns == null) { @@ -118,6 +121,7 @@ namespace OctopusClient { } private void refreshStoryFolders() { + ClearSelection(); Cursor.Current = Cursors.WaitCursor; IEnumerable storyFolders = client.getStoryFolders()?.ToArray(); if (storyFolders == null) { @@ -149,9 +153,17 @@ namespace OctopusClient { private void treeContent_NodeMouseDoubleClick(object sender, TreeNodeMouseClickEventArgs e) { if (String.IsNullOrEmpty(e.Node.Name)) return; - TreeNode node = e.Node; + + //meghívódik az InnerAfterCheck - e.Node.Checked = !e.Node.Checked; + //selectedNode.Checked = !e.Node.Checked; + } + + public void ClearSelection() { + if (selectedNode == null) + return; + selectedNode.Checked = false; + selectedNode = null; } //public void IDChangeEventCalledFromOutside(string id) { @@ -213,10 +225,13 @@ namespace OctopusClient { } private void treeContent_AfterCheck(object sender, TreeViewEventArgs e) { - if (checkFromCode) - return; - TreeNode node = e.Node; - InnerAfterCheck(node); + if (!e.Node.Equals(selectedNode)) { + ClearSelection(); + selectedNode = e.Node; + treeContent.SelectedNode = selectedNode; + } + id = selectedNode.Checked ? selectedNode.Name : null; + IDChangedEvent?.Invoke(id); } public void IDSelectedFromOutside(string id) { @@ -231,30 +246,30 @@ namespace OctopusClient { //InitCheckID(treeContent.Nodes); } - private void InnerAfterCheck(TreeNode node) { - string text = node.Name; - checkFromCode = false; - ClearCheckBox?.Invoke(); - ClearSelectionSource(node, treeContent.Nodes); - id = node.Checked ? text : null; - IDChangedEvent?.Invoke(id); - checkFromCode = false; - } + //private void HandleCheck(TreeNode node) { + // string text = node.Name; + // checkFromCode = false; + // //ClearCheckBox?.Invoke(); + // ClearSelectionSource(node, treeContent.Nodes); + // id = node.Checked ? text : null; + // IDChangedEvent?.Invoke(id); + // checkFromCode = false; + //} - private void ClearSelectionSource(TreeNode actualNode, TreeNodeCollection nodes) { - foreach (TreeNode actual in nodes) { - if (!actual.Equals(actualNode)) { - checkFromCode = true; - actual.Checked = false; - ClearSelectionSource(actualNode, actual.Nodes); - } - } - checkFromCode = false; - } + //private void ClearSelectionSource(TreeNode actualNode, TreeNodeCollection nodes) { + // foreach (TreeNode actual in nodes) { + // if (!actual.Equals(actualNode)) { + // checkFromCode = true; + // actual.Checked = false; + // ClearSelectionSource(actualNode, actual.Nodes); + // } + // } + // checkFromCode = false; + //} - public void ClearEveryCheckBox() { - ClearSelectionSource(null, treeContent.Nodes); - } + //public void ClearEveryCheckBox() { + // ClearSelectionSource(null, treeContent.Nodes); + //} public OctopusAPI GetClient() { return client; diff --git a/client/PasswordEncrypter/PasswordEncrypter.csproj b/client/PasswordEncrypter/PasswordEncrypter.csproj index 0d11f917..7feb5536 100644 --- a/client/PasswordEncrypter/PasswordEncrypter.csproj +++ b/client/PasswordEncrypter/PasswordEncrypter.csproj @@ -35,6 +35,26 @@ prompt 4 + + true + bin\x64\Debug\ + DEBUG;TRACE + full + x64 + prompt + MinimumRecommendedRules.ruleset + true + + + bin\x64\Release\ + TRACE + true + pdbonly + x64 + prompt + MinimumRecommendedRules.ruleset + true + diff --git a/client/PlanAIRClient/SearchResult.cs b/client/PlanAIRClient/SearchResult.cs index c4bf0629..d9017b27 100644 --- a/client/PlanAIRClient/SearchResult.cs +++ b/client/PlanAIRClient/SearchResult.cs @@ -14,10 +14,10 @@ namespace TrafficClient { public partial class SearchResult : Form { - private List elements = new List(); + private List elements = new List(); public TraficMetadataSelected metadataSelected { get; set; } - public SearchResult(List elements, TraficMetadataSelected metadataSelected) : this() { + public SearchResult(List elements, TraficMetadataSelected metadataSelected) : this() { this.elements = elements; this.metadataSelected = metadataSelected; this.Text = Resources.KERESES_EREDMENYE; @@ -60,7 +60,7 @@ namespace TrafficClient { private void FillDataGridView() { List displayedElements = new List(); - foreach (MamResultWrapper actual in elements) { + foreach (TrafficItem actual in elements) { MamDisplay displayed = new MamDisplay() { EpisodeNumber = actual.EpisodeNumber, EpisodeTitle = actual.EpisodeTitle, diff --git a/client/PlanAIRClient/TrafficAPI.cs b/client/PlanAIRClient/TrafficAPI.cs index 9ba4108d..1a13c3ef 100644 --- a/client/PlanAIRClient/TrafficAPI.cs +++ b/client/PlanAIRClient/TrafficAPI.cs @@ -27,11 +27,11 @@ namespace TrafficClient { segmentWorker = new SegmentWorker(connection, cliFSPReader, errorReporter); } - public List GetBroadcasts(string strParam, DateTime? from, DateTime? to, bool missingCopia) { + public List GetBroadcasts(string strParam, DateTime? from, DateTime? to, bool missingCopia) { return broadvastWorker.GetBroadcasts(strParam, from, to, missingCopia); } - public List GetBroadcastArchiveMetadata(string strParam) { + public List GetBroadcastArchiveMetadata(string strParam) { return broadvastWorker.GetBroadcastArchiveMetadata(strParam); } @@ -39,11 +39,11 @@ namespace TrafficClient { broadvastWorker.SetBroadcastOKForAir(itemID, ok); } - public List GetPromotionals(string strParam) { + public List GetPromotionals(string strParam) { return promoWorker.GetPromotionals(strParam); } - public List GetPromotionalArchiveMetadata(string strParam) { + public List GetPromotionalArchiveMetadata(string strParam) { return promoWorker.GetPromotionalArchiveMetadata(strParam); } @@ -51,7 +51,7 @@ namespace TrafficClient { promoWorker.SetPromotionalToOkForAir(spotID, ok); } - public List GetAdvertisements(string strParam) { + public List GetAdvertisements(string strParam) { return adWorker.GetAdvertisements(strParam); } @@ -59,7 +59,7 @@ namespace TrafficClient { adWorker.SetAdvertisementToOkForAir(spotID, ok); } - public List GetAdvertisementArchiveMetadata(string strParam) { + public List GetAdvertisementArchiveMetadata(string strParam) { return adWorker.GetAdvertisementArchiveMetadata(strParam); } diff --git a/client/PlanAIRClient/TrafficClient.csproj b/client/PlanAIRClient/TrafficClient.csproj index d51df84a..4367e54a 100644 --- a/client/PlanAIRClient/TrafficClient.csproj +++ b/client/PlanAIRClient/TrafficClient.csproj @@ -51,6 +51,24 @@ prompt MinimumRecommendedRules.ruleset + + true + bin\x64\Debug\ + DEBUG;TRACE + full + x64 + prompt + MinimumRecommendedRules.ruleset + + + bin\x64\Release\ + TRACE + true + pdbonly + x64 + prompt + MinimumRecommendedRules.ruleset + ..\packages\NLog.4.4.11\lib\net45\NLog.dll diff --git a/client/PlanAIRClient/TrafficIDSelector.Designer.cs b/client/PlanAIRClient/TrafficIDSelector.Designer.cs index e0b11d51..6870887d 100644 --- a/client/PlanAIRClient/TrafficIDSelector.Designer.cs +++ b/client/PlanAIRClient/TrafficIDSelector.Designer.cs @@ -106,7 +106,7 @@ this.dataGridView1.TabIndex = 0; this.dataGridView1.CellContentClick += new System.Windows.Forms.DataGridViewCellEventHandler(this.dataGridView1_CellContentClick); this.dataGridView1.CellDoubleClick += new System.Windows.Forms.DataGridViewCellEventHandler(this.dataGridView1_CellDoubleClick); - this.dataGridView1.KeyDown += new System.Windows.Forms.KeyEventHandler(this.dataGridView1_KeyDown); + this.dataGridView1.KeyDown += new System.Windows.Forms.KeyEventHandler(this.OnDataGridKeyDown); // // scheduledDate // diff --git a/client/PlanAIRClient/TrafficIDSelector.cs b/client/PlanAIRClient/TrafficIDSelector.cs index 45ddfc0f..8bbc0c03 100644 --- a/client/PlanAIRClient/TrafficIDSelector.cs +++ b/client/PlanAIRClient/TrafficIDSelector.cs @@ -1,20 +1,23 @@ using System.Windows.Forms; using System; using System.Drawing; -using System.ComponentModel; -using System.Linq; using System.Collections.Generic; +using System.Diagnostics; namespace TrafficClient { public delegate void OnSelectedIDChanged(string ID, int variantID); - public delegate void ClearCheckBox(); + //public delegate void ClearCheckBox(); public delegate void TrafficErrorReporterDelegate(DateTime time, String level, String message, Color color); + public partial class TrafficIDSelector : UserControl { public TrafficAPI trafficAPI { get; private set; } public OnSelectedIDChanged IDChangedEvent { get; set; } - public ClearCheckBox clearCheckBox { get; set; } - + private DataGridViewCheckBoxCell selectedCell; public TrafficErrorReporterDelegate ErrorReporter { get; set; } + + //TODO + //public ClearCheckBox clearCheckBox { get; set; } + public TrafficIDSelector() { InitializeComponent(); InitializeTexts(); @@ -79,6 +82,7 @@ namespace TrafficClient { } public void RefreshDataGridSource() { + ClearSelection(); Cursor.Current = Cursors.WaitCursor; string searchText = textBox1.Text; DateTime? from = null; @@ -87,7 +91,7 @@ namespace TrafficClient { from = scheduledDate.Value; to = scheduledDate.Value.AddDays(1); } - MamResultWrapper[] result = null; + TrafficItem[] result = null; if (radioButtonBroadCast.Checked) result = trafficAPI.GetBroadcasts(searchText, from, to, copiaCheckBox.Checked)?.ToArray(); else if (radioButtonAD.Checked) @@ -99,8 +103,8 @@ namespace TrafficClient { Cursor.Current = Cursors.Default; return; } - List list = new List(); - foreach (MamResultWrapper actual in result) + List list = new List(); + foreach (TrafficItem actual in result) list.Add(actual); if (CanSort(list)) list.Sort((x, y) => DateTime.Compare(x.NextBroadcastDate.Value, y.NextBroadcastDate.Value)); @@ -109,8 +113,8 @@ namespace TrafficClient { Cursor.Current = Cursors.Default; } - private bool CanSort(List list) { - foreach (MamResultWrapper actual in list) + private bool CanSort(List list) { + foreach (TrafficItem actual in list) if (!actual.NextBroadcastDate.HasValue) return false; return true; @@ -123,7 +127,7 @@ namespace TrafficClient { } private void dataGridView1_CellDoubleClick(object sender, DataGridViewCellEventArgs e) { - SetCheckBoxAndInvokeIDChangeEvent(dataGridView1.SelectedRows[0]); + OnSelectionChanged(dataGridView1.SelectedRows[0]); } private void searchButton_Click(object sender, EventArgs e) { @@ -143,37 +147,53 @@ namespace TrafficClient { if (gridView == null) return; //nincs multiselect - SetCheckBoxAndInvokeIDChangeEvent(dataGridView1.SelectedRows[0]); + OnSelectionChanged(dataGridView1.SelectedRows[0]); } - private void SetCheckBoxAndInvokeIDChangeEvent(DataGridViewRow actualRow) { - MamResultWrapper res = actualRow.DataBoundItem as MamResultWrapper; - DataGridViewCheckBoxCell checkBoxCell = actualRow.Cells[0] as DataGridViewCheckBoxCell; - bool beforeClear = checkBoxCell.Value.Equals(true); - ClearSelectionSource(); - checkBoxCell.Value = !beforeClear; - bool selected = checkBoxCell.Value.Equals(true); - clearCheckBox?.Invoke(); + private void OnSelectionChanged(DataGridViewRow actualRow) { + + TrafficItem res = actualRow.DataBoundItem as TrafficItem; + if (String.IsNullOrEmpty(res.MediaID)) + return; + DataGridViewCheckBoxCell actualCell = actualRow.Cells[0] as DataGridViewCheckBoxCell; + if (!actualCell.Equals(selectedCell)) { + ClearSelection(); + selectedCell = actualRow.Cells[0] as DataGridViewCheckBoxCell; + } + selectedCell.Value = !(bool)selectedCell.Value; + bool selected = (bool)selectedCell.Value; + Debug.WriteLine("Selection {0}", selected); + //DataGridViewCheckBoxCell checkBoxCell = actualRow.Cells[0] as DataGridViewCheckBoxCell; + //selectedCell = actualRow.Cells[0] as DataGridViewCheckBoxCell; + //bool beforeClear = checkBoxCell.Value.Equals(true); + //ClearSelectionSource(); + //checkBoxCell.Value = !beforeClear; + //bool selected = checkBoxCell.Value.Equals(true); + //clearCheckBox?.Invoke(); if (selected) { IDChangedEvent?.Invoke(res.MediaID, res.VariantID); } else IDChangedEvent?.Invoke(null, 0); } - public void ClearSelectionSource() { - foreach (DataGridViewRow row in dataGridView1.Rows) { - DataGridViewCheckBoxCell actual = row.Cells[0] as DataGridViewCheckBoxCell; - actual.Value = false; - } + public void ClearSelection() { + if (selectedCell == null) + return; + selectedCell.Value = false; + selectedCell = null; + //foreach (DataGridViewRow row in dataGridView1.Rows) { + // DataGridViewCheckBoxCell actual = row.Cells[0] as DataGridViewCheckBoxCell; + // actual.Value = false; + //} } - private void dataGridView1_KeyDown(object sender, KeyEventArgs e) { + private void OnDataGridKeyDown(object sender, KeyEventArgs e) { if (e.KeyCode == Keys.Space && dataGridView1.CurrentCell.GetType() != typeof(DataGridViewCheckBoxCell)) - SetCheckBoxAndInvokeIDChangeEvent(dataGridView1.SelectedRows[0]); + OnSelectionChanged(dataGridView1.SelectedRows[0]); } } - public class MamResultWrapper { + public class TrafficItem { public bool Selected { get; set; } public string MediaID { get; set; } public string Title { get; set; } @@ -184,7 +204,7 @@ namespace TrafficClient { public DateTime? NextBroadcastDate { get; set; } } - public class ArchiveMatadataWrapper { + public class TrafficItemMetadata { public string ProgTitle { get; set; } public string ProgDescription { get; set; } diff --git a/client/PlanAIRClient/Workers/AdvertisementWorker.cs b/client/PlanAIRClient/Workers/AdvertisementWorker.cs index 36b41b88..692574db 100644 --- a/client/PlanAIRClient/Workers/AdvertisementWorker.cs +++ b/client/PlanAIRClient/Workers/AdvertisementWorker.cs @@ -13,9 +13,9 @@ namespace TrafficClient.Workers { base(connection, cliFSPReader, errorReporter) { } - public List GetAdvertisements(string strParam) { + public List GetAdvertisements(string strParam) { List sqlResult = null; - List result = null; + List result = null; try { TryConnect(); using (SqlCommand cmd = new SqlCommand("dbo.clIFsp_EC_MAM", connection)) { @@ -51,12 +51,12 @@ namespace TrafficClient.Workers { return result; } - private List ProcessMamAdvertismentResult(List sqlResult) { + private List ProcessMamAdvertismentResult(List sqlResult) { if (sqlResult == null) return null; - List result = new List(); + List result = new List(); foreach (clIFsp_EC_MAMAdvertismentResult actual in sqlResult) { - MamResultWrapper actualObject = new MamResultWrapper() { + TrafficItem actualObject = new TrafficItem() { MediaID = actual.t_MediaID, Title = actual.v_Title, VariantID = actual.t_SpotID @@ -87,9 +87,9 @@ namespace TrafficClient.Workers { } } - public List GetAdvertisementArchiveMetadata(string strParam) { + public List GetAdvertisementArchiveMetadata(string strParam) { List sqlResult = null; - List result = null; + List result = null; try { TryConnect(); using (SqlCommand cmd = new SqlCommand("dbo.clIFsp_EC_MAM", connection)) { @@ -112,12 +112,12 @@ namespace TrafficClient.Workers { return result; } - private List ProcessAdvertisementArchiveMetadataResult(List sqlResult) { + private List ProcessAdvertisementArchiveMetadataResult(List sqlResult) { if (sqlResult == null) return null; - List result = new List(); + List result = new List(); foreach (clIFsp_EC_MAMAdvertismentResult actual in sqlResult) { - ArchiveMatadataWrapper actualObject = new ArchiveMatadataWrapper() { + TrafficItemMetadata actualObject = new TrafficItemMetadata() { EpisodeID = actual.t_MediaID, EpisodeTitle = actual.v_Title, ProgID = actual.t_SpotID.ToString(), diff --git a/client/PlanAIRClient/Workers/BroadcastWorker.cs b/client/PlanAIRClient/Workers/BroadcastWorker.cs index 09d97fde..aff803ea 100644 --- a/client/PlanAIRClient/Workers/BroadcastWorker.cs +++ b/client/PlanAIRClient/Workers/BroadcastWorker.cs @@ -14,9 +14,9 @@ namespace TrafficClient.Workers { : base(connection, cliFSPReader, errorReporter){ } - public List GetBroadcasts(string strParam, DateTime? from, DateTime? to, bool missingCopia) { + public List GetBroadcasts(string strParam, DateTime? from, DateTime? to, bool missingCopia) { List sqlResult = null; - List result = null; + List result = null; try { TryConnect(); using (SqlCommand cmd = new SqlCommand("dbo.clIFsp_EC_MAM", connection)) { @@ -51,12 +51,12 @@ namespace TrafficClient.Workers { return result; } - private List ProcessMamBroadcastResult(List sqlResult) { + private List ProcessMamBroadcastResult(List sqlResult) { if (sqlResult == null) return null; - List result = new List(); + List result = new List(); foreach (clIFsp_EC_MAMBradocastResult actual in sqlResult) { - MamResultWrapper actualObject = new MamResultWrapper() { + TrafficItem actualObject = new TrafficItem() { MediaID = actual.v_MediaID, EpisodeTitle = actual.v_EpTitle, Title = actual.v_ProgTitle, @@ -83,9 +83,9 @@ namespace TrafficClient.Workers { return result; } - public List GetBroadcastArchiveMetadata(string strParam) { + public List GetBroadcastArchiveMetadata(string strParam) { List sqlResult = null; - List result = null; + List result = null; try { TryConnect(); using (SqlCommand cmd = new SqlCommand("dbo.clIFsp_EC_MAM", connection)) { @@ -108,12 +108,12 @@ namespace TrafficClient.Workers { return result; } - private List ProcessaBroadcastArchiveMetadatResult(List sqlResult) { + private List ProcessaBroadcastArchiveMetadatResult(List sqlResult) { if (sqlResult == null) return null; - List result = new List(); + List result = new List(); foreach (clIFsp_EC_MAMBradocastResult actual in sqlResult) { - ArchiveMatadataWrapper actualObject = new ArchiveMatadataWrapper() { + TrafficItemMetadata actualObject = new TrafficItemMetadata() { EpisodeID = actual.v_EpisodeID, EpisodeTitle = actual.v_EpTitle, ProgID = actual.v_ProgrammeID.ToString(), diff --git a/client/PlanAIRClient/Workers/PromotionalWorker.cs b/client/PlanAIRClient/Workers/PromotionalWorker.cs index 19f89e94..b6717670 100644 --- a/client/PlanAIRClient/Workers/PromotionalWorker.cs +++ b/client/PlanAIRClient/Workers/PromotionalWorker.cs @@ -13,9 +13,9 @@ namespace TrafficClient.Workers { : base(connection, cliFSPReader, errorReporter) { } - public List GetPromotionals(string strParam) { + public List GetPromotionals(string strParam) { List sqlResult = null; - List result = null; + List result = null; try { TryConnect(); using (SqlCommand cmd = new SqlCommand("dbo.clIFsp_EC_MAM", connection)) { @@ -38,12 +38,12 @@ namespace TrafficClient.Workers { return result; } - private List ProcessMamPromotionalResult(List sqlResult) { + private List ProcessMamPromotionalResult(List sqlResult) { if (sqlResult == null) return null; - List result = new List(); + List result = new List(); foreach (clIFsp_EC_MAMPromotionalResult actual in sqlResult) { - MamResultWrapper actualObject = new MamResultWrapper() { + TrafficItem actualObject = new TrafficItem() { MediaID = actual.t_MediaID, EpisodeTitle = actual.v_Title, Title = actual.v_ProgTitle, @@ -95,9 +95,9 @@ namespace TrafficClient.Workers { } } - public List GetPromotionalArchiveMetadata(string strParam) { + public List GetPromotionalArchiveMetadata(string strParam) { List sqlResult = null; - List result = null; + List result = null; try { TryConnect(); using (SqlCommand cmd = new SqlCommand("dbo.clIFsp_EC_MAM", connection)) { @@ -120,12 +120,12 @@ namespace TrafficClient.Workers { return result; } - private List ProcessPromotionalArchiveMetadataResult(List sqlResult) { + private List ProcessPromotionalArchiveMetadataResult(List sqlResult) { if (sqlResult == null) return null; - List result = new List(); + List result = new List(); foreach (clIFsp_EC_MAMPromotionalResult actual in sqlResult) { - ArchiveMatadataWrapper actualObject = new ArchiveMatadataWrapper() { + TrafficItemMetadata actualObject = new TrafficItemMetadata() { EpisodeID = actual.t_MediaID, ProgID = actual.t_SpotID.ToString(), ProgTitle = actual.v_ProgTitle, -- 2.54.0