git-tfs-id: [http://tfs.userrendszerhaz.hu:8080/tfs/DefaultCollection]$/MediaCube...
authorBellai Ádám <USER\adam.bellai>
Tue, 3 Oct 2017 09:32:42 +0000 (09:32 +0000)
committerBellai Ádám <USER\adam.bellai>
Tue, 3 Oct 2017 09:32:42 +0000 (09:32 +0000)
client/IntegrationTests/PlanAIRTests.cs
client/Maestro/MaestroForm.Target.cs
client/Maestro/MaestroForm.cs
client/PlanAIRClient/Reader.cs
client/PlanAIRClient/TrafficAPI.cs
client/PlanAIRClient/TrafficClasses.designer.cs
client/PlanAIRClient/TrafficClient.csproj
client/PlanAIRClient/TrafficIDSelector.cs
client/PlanAIRClient/clIFsp_EC_MAMAdvertismentsResult.cs [new file with mode: 0644]
client/PlanAIRClient/clIFsp_EC_MAMPromotionalResult.cs [new file with mode: 0644]

index a4e26b69fa533df392710ff2c20a5a5ba433c6b7..fd3382c9b980cdf29e47e5f94c08470be39a24ce 100644 (file)
@@ -46,6 +46,7 @@ namespace IntegrationTests {
 \r
         [TestMethod]\r
         public void DeleteSegmentTest() {\r
+            //Fixture\r
             const int segmentID = 82454;\r
 \r
             //Exercise\r
@@ -53,11 +54,21 @@ namespace IntegrationTests {
         }\r
 \r
         [TestMethod]\r
-        public void TestGetList() {\r
-            //TrafficAPI sut = new TrafficAPI();\r
-            //var result = sut.GetList();\r
-            //Assert.IsNotNull(result);\r
+        public void SearchPromotionalsTest() {\r
+            //Fixture\r
+            const string STR_PARAM = "";\r
+\r
+            //Exercise\r
+            List<MamResultWrapper> actual = sut.SearchPromotional(STR_PARAM);\r
         }\r
 \r
+        [TestMethod]\r
+        public void SearchAdvertisementTest() {\r
+            //Fixture\r
+            const string STR_PARAM = "";\r
+\r
+            //Exercise\r
+            List<MamResultWrapper> actual = sut.SearchAdvertisement(STR_PARAM);\r
+        }\r
     }\r
 }\r
index 8eb4f33cefcf0e054a65cf05b6baef1fe2d4f2fd..5eff6f4a98a5b4dc6db7cd8e1f3d4d1d9dce7546 100644 (file)
@@ -70,7 +70,7 @@ namespace Maestro {
         }\r
 \r
         private void OnInfoTextChanged(object sender, EventArgs e) {\r
-            //ApplyProcessorButtonsLogic();\r
+            ApplyProcessorButtonsLogic();\r
             ApplyMetaDataButtonLogic();\r
         }\r
 \r
@@ -106,6 +106,7 @@ namespace Maestro {
 \r
             if (Configuration.Player != null)\r
                 ctxiDefineSegments.Enabled = SelectedSource?.FileInfo != null && Configuration.Player.SegmentEditor && MetadataType.Traffic.Equals(SelectedMetadata?.Kind);\r
+            //todo\r
             IsSelectedFileAnID();\r
             EnableArchiveMetadataButtonAndCreateMetadataModel();\r
         }\r
index 704c1e0f497410ae3c765aa5474c717039052b15..7886e035696826fdb86f80b77b9e44d49215da50 100644 (file)
@@ -231,7 +231,7 @@ namespace Maestro {
         private void SetTrafficIDToMetadataText() {\r
             TrafficAPI api = trafficIDSelector.trafficAPI;\r
             Cursor.Current = Cursors.WaitCursor;\r
-            List<MamResultWrapper> result = api.Search(startingName, null, null, true);\r
+            List<MamResultWrapper> result = api.SearchBroadcast(startingName, null, null, true);\r
             ProcessMamResults(result);\r
         }\r
 \r
index 64bb0b8b96cb612ff1e6ad9c8ea9309c02d0db44..b7d25a31c30c1f50d02c2c6fe31bf546ebc3b045 100644 (file)
@@ -43,10 +43,9 @@ namespace TrafficClient {
             return result;\r
         }\r
 \r
-        public clIFsp_EC_MAMResult ToclIFsp_MAMResult(SqlDataReader reader) {\r
-            clIFsp_EC_MAMResult item = new clIFsp_EC_MAMResult();\r
+        public clIFsp_EC_MAMBradocastResult ToclIFsp_MAMBroadcastResult(SqlDataReader reader) {\r
+            clIFsp_EC_MAMBradocastResult item = new clIFsp_EC_MAMBradocastResult();\r
             int f = 0;\r
-            //TODO check\r
             item.v_ProgrammeID = (int)ReadInt(reader, ref f);\r
             item.v_Live = (bool)ReadBool(reader, ref f);\r
             item.v_EpisodeID = ReadString(reader, ref f);\r
@@ -69,6 +68,50 @@ namespace TrafficClient {
             return item;\r
         }\r
 \r
+        public clIFsp_EC_MAMPromotionalResult ToclIFsp_MAMPromotionalResult(SqlDataReader reader) {\r
+            clIFsp_EC_MAMPromotionalResult item = new clIFsp_EC_MAMPromotionalResult();\r
+            int f = 0;\r
+            item.t_SpotID = (int)ReadInt(reader, ref f);\r
+            item.t_MediaID = ReadString(reader, ref f);\r
+            item.v_Title = ReadString(reader, ref f);\r
+            item.v_PromoType = ReadString(reader, ref f);\r
+            item.v_ProgTitle = ReadString(reader, ref f);\r
+            item.v_Episode = ReadShort(reader, ref f);\r
+            item.t_PSStart = ReadDateTime(reader, ref f);\r
+            item.t_PSEnd = ReadDateTime(reader, ref f);\r
+            item.v_EstimatedDuration = ReadInt(reader, ref f);\r
+            item.t_TcIn = ReadInt(reader, ref f);\r
+            item.t_TcOut = ReadInt(reader, ref f);\r
+            item.t_Duration = ReadInt(reader, ref f);\r
+            item.v_TcIn = ReadString(reader, ref f);\r
+            item.v_TcOut = ReadString(reader, ref f);\r
+            item.v_Duration = ReadString(reader, ref f);\r
+            item.v_Stations = ReadString(reader, ref f);\r
+            item.t_OkForAir = ReadBool(reader, ref f);\r
+            item.v_OkForAirs = ReadBool(reader, ref f);\r
+            item.v_IsInactive = ReadBool(reader, ref f);\r
+            return item;\r
+        }\r
+\r
+        public clIFsp_EC_MAMAdvertismentResult ToclIFsp_MAMAdvertisementResult(SqlDataReader reader) {\r
+            clIFsp_EC_MAMAdvertismentResult item = new clIFsp_EC_MAMAdvertismentResult();\r
+            int f = 0;\r
+            item.t_SpotID = (int)ReadInt(reader, ref f);\r
+            item.t_MediaID = ReadString(reader, ref f);\r
+            item.v_Title = ReadString(reader, ref f);\r
+            item.t_Advertiser = ReadString(reader, ref f);\r
+            item.v_EstimatedDuration = ReadInt(reader, ref f);\r
+            item.t_TcIn = ReadInt(reader, ref f);\r
+            item.t_TcOut = ReadInt(reader, ref f);\r
+            item.t_Duration = ReadInt(reader, ref f);\r
+            item.v_TcIn = ReadString(reader, ref f);\r
+            item.v_TcOut = ReadString(reader, ref f);\r
+            item.v_Duration = ReadString(reader, ref f);\r
+            item.t_OkForAir = ReadBool(reader, ref f);\r
+            item.v_OkForAirs = ReadBool(reader, ref f);\r
+            return item;\r
+        }\r
+\r
         public clIFsp_EC_SegmentResult ToclIFsp_SegmentResult(SqlDataReader reader) {\r
             clIFsp_EC_SegmentResult item = new clIFsp_EC_SegmentResult();\r
             int f = 0;\r
index 038f2b622ee094714e1ca8e6bfe1af8a168a1b07..63940e5a6d129ff91f26a05fca22f21a75f596ac 100644 (file)
@@ -18,8 +18,8 @@ namespace TrafficClient {
             cliFSPReader = new CliFSPReader();\r
         }\r
 \r
-        public List<MamResultWrapper> Search(string strParam, DateTime? from, DateTime? to, bool missingCopia) {\r
-            List<clIFsp_EC_MAMResult> sqlResult = null;\r
+        public List<MamResultWrapper> SearchBroadcast(string strParam, DateTime? from, DateTime? to, bool missingCopia) {\r
+            List<clIFsp_EC_MAMBradocastResult> sqlResult = null;\r
             List<MamResultWrapper> result = null;\r
             try {\r
                 TryConnect();\r
@@ -40,8 +40,8 @@ namespace TrafficClient {
                             cmd.Parameters.AddWithValue("@@DateParam2", to.Value.Date);\r
                         }\r
                     }\r
-                    sqlResult = ExecuteAndRead(cmd);\r
-                    result = ProcessMamResult(sqlResult);\r
+                    sqlResult = ExecuteAndReadBradcast(cmd);\r
+                    result = ProcessMamBroadcastResult(sqlResult);\r
                 }\r
             }\r
             catch (Exception e) {\r
@@ -61,11 +61,11 @@ namespace TrafficClient {
             }\r
         }\r
 \r
-        private List<MamResultWrapper> ProcessMamResult(List<clIFsp_EC_MAMResult> sqlResult) {\r
+        private List<MamResultWrapper> ProcessMamBroadcastResult(List<clIFsp_EC_MAMBradocastResult> sqlResult) {\r
             if (sqlResult == null)\r
                 return null;\r
             List<MamResultWrapper> result = new List<MamResultWrapper>();\r
-            foreach (clIFsp_EC_MAMResult actual in sqlResult) {\r
+            foreach (clIFsp_EC_MAMBradocastResult actual in sqlResult) {\r
                 MamResultWrapper actualObject = new MamResultWrapper() {\r
                     MediaID = actual.v_MediaID,\r
                     EpisodeTitle = actual.v_EpTitle,\r
@@ -211,13 +211,13 @@ namespace TrafficClient {
             return result;\r
         }\r
 \r
-        private List<clIFsp_EC_MAMResult> ExecuteAndRead(SqlCommand cmd) {\r
-            List<clIFsp_EC_MAMResult> result = null;\r
+        private List<clIFsp_EC_MAMBradocastResult> ExecuteAndReadBradcast(SqlCommand cmd) {\r
+            List<clIFsp_EC_MAMBradocastResult> result = null;\r
             using (SqlDataReader reader = cmd.ExecuteReader()) {\r
                 while (reader.Read()) {\r
                     if (result == null)\r
-                        result = new List<clIFsp_EC_MAMResult>();\r
-                    clIFsp_EC_MAMResult item = cliFSPReader.ToclIFsp_MAMResult(reader);\r
+                        result = new List<clIFsp_EC_MAMBradocastResult>();\r
+                    clIFsp_EC_MAMBradocastResult item = cliFSPReader.ToclIFsp_MAMBroadcastResult(reader);\r
                     result.Add(item);\r
                 }\r
             }\r
@@ -225,7 +225,7 @@ namespace TrafficClient {
         }\r
 \r
         public List<ArchiveMatadataWrapper> SearchArchiveMetadata(string strParam) {\r
-            List<clIFsp_EC_MAMResult> sqlResult = null;\r
+            List<clIFsp_EC_MAMBradocastResult> sqlResult = null;\r
             List<ArchiveMatadataWrapper> result = null;\r
             try {\r
                 TryConnect();\r
@@ -235,7 +235,7 @@ namespace TrafficClient {
                     cmd.Parameters.AddWithValue("@@@Options", 40);\r
                     cmd.Parameters.AddWithValue("@@ItemID", DBNull.Value);\r
                     cmd.Parameters.AddWithValue("@@StrParam1", strParam);\r
-                    sqlResult = ExecuteAndRead(cmd);\r
+                    sqlResult = ExecuteAndReadBradcast(cmd);\r
                     result = ProcessArchiveResult(sqlResult);\r
                 }\r
             }\r
@@ -249,11 +249,11 @@ namespace TrafficClient {
             return result;\r
         }\r
 \r
-        private List<ArchiveMatadataWrapper> ProcessArchiveResult(List<clIFsp_EC_MAMResult> sqlResult) {\r
+        private List<ArchiveMatadataWrapper> ProcessArchiveResult(List<clIFsp_EC_MAMBradocastResult> sqlResult) {\r
             if (sqlResult == null)\r
                 return null;\r
             List<ArchiveMatadataWrapper> result = new List<ArchiveMatadataWrapper>();\r
-            foreach (clIFsp_EC_MAMResult actual in sqlResult) {\r
+            foreach (clIFsp_EC_MAMBradocastResult actual in sqlResult) {\r
                 ArchiveMatadataWrapper actualObject = new ArchiveMatadataWrapper() {\r
                     EpisodeID = actual.v_EpisodeID,\r
                     EpisodeTitle = actual.v_EpTitle,\r
@@ -264,5 +264,119 @@ namespace TrafficClient {
             }\r
             return result;\r
         }\r
+\r
+        public List<MamResultWrapper> SearchPromotional(string strParam) {\r
+            List<clIFsp_EC_MAMPromotionalResult> sqlResult = null;\r
+            List<MamResultWrapper> result = null;\r
+            try {\r
+                TryConnect();\r
+                using (SqlCommand cmd = new SqlCommand("dbo.clIFsp_EC_MAM", connection)) {\r
+                    cmd.CommandType = CommandType.StoredProcedure;\r
+                    cmd.Parameters.AddWithValue("@Operation", 2001);\r
+                    cmd.Parameters.AddWithValue("@@@Options", 40);\r
+                    cmd.Parameters.AddWithValue("@@ItemID", DBNull.Value);\r
+                    cmd.Parameters.AddWithValue("@@StrParam1", strParam);\r
+                    sqlResult = ExecuteAndReadPromotionals(cmd);\r
+                    result = ProcessMamPromotionalResult(sqlResult);\r
+                }\r
+            }\r
+            catch (Exception e) {\r
+                logger.Error(e.Message);\r
+                throw e;\r
+            }\r
+            finally {\r
+                connection.Close();\r
+            }\r
+            return result;\r
+        }\r
+\r
+        private List<clIFsp_EC_MAMPromotionalResult> ExecuteAndReadPromotionals(SqlCommand cmd) {\r
+            List<clIFsp_EC_MAMPromotionalResult> result = null;\r
+            using (SqlDataReader reader = cmd.ExecuteReader()) {\r
+                while (reader.Read()) {\r
+                    if (result == null)\r
+                        result = new List<clIFsp_EC_MAMPromotionalResult>();\r
+                    clIFsp_EC_MAMPromotionalResult item = cliFSPReader.ToclIFsp_MAMPromotionalResult(reader);\r
+                    result.Add(item);\r
+                }\r
+            }\r
+            return result;\r
+        }\r
+\r
+        private List<MamResultWrapper> ProcessMamPromotionalResult(List<clIFsp_EC_MAMPromotionalResult> sqlResult) {\r
+            if (sqlResult == null)\r
+                return null;\r
+            List<MamResultWrapper> result = new List<MamResultWrapper>();\r
+            foreach (clIFsp_EC_MAMPromotionalResult actual in sqlResult) {\r
+                //MamResultWrapper actualObject = new MamResultWrapper() {\r
+                //    MediaID = actual.v_MediaID,\r
+                //    EpisodeTitle = actual.v_EpTitle,\r
+                //    Title = actual.v_ProgTitle,\r
+                //    EpisodeNumber = actual.v_EpisodeID,\r
+                //    VariantID = actual.v_VariantID.HasValue ? actual.v_VariantID.Value : -1,\r
+                //    Episode = actual.v_Episode.HasValue ? actual.v_Episode.Value : (short)-1,\r
+                //    NextBroadcastDate = actual.v_NextBroadcastDate\r
+                //};\r
+                //result.Add(actualObject);\r
+            }\r
+            return result;\r
+        }\r
+\r
+        public List<MamResultWrapper> SearchAdvertisement(string strParam) {\r
+            List<clIFsp_EC_MAMAdvertismentResult> sqlResult = null;\r
+            List<MamResultWrapper> result = null;\r
+            try {\r
+                TryConnect();\r
+                using (SqlCommand cmd = new SqlCommand("dbo.clIFsp_EC_MAM", connection)) {\r
+                    cmd.CommandType = CommandType.StoredProcedure;\r
+                    cmd.Parameters.AddWithValue("@Operation", 3001);\r
+                    cmd.Parameters.AddWithValue("@@@Options", 40);\r
+                    cmd.Parameters.AddWithValue("@@ItemID", DBNull.Value);\r
+                    cmd.Parameters.AddWithValue("@@StrParam1", strParam);\r
+                    sqlResult = ExecuteAndReadAdvertisement(cmd);\r
+                    result = ProcessMamAdvertismentResult(sqlResult);\r
+                }\r
+            }\r
+            catch (Exception e) {\r
+                logger.Error(e.Message);\r
+                throw e;\r
+            }\r
+            finally {\r
+                connection.Close();\r
+            }\r
+            return result;\r
+        }\r
+\r
+        private List<clIFsp_EC_MAMAdvertismentResult> ExecuteAndReadAdvertisement(SqlCommand cmd) {\r
+            List<clIFsp_EC_MAMAdvertismentResult> result = null;\r
+            using (SqlDataReader reader = cmd.ExecuteReader()) {\r
+                while (reader.Read()) {\r
+                    if (result == null)\r
+                        result = new List<clIFsp_EC_MAMAdvertismentResult>();\r
+                    clIFsp_EC_MAMAdvertismentResult item = cliFSPReader.ToclIFsp_MAMAdvertisementResult(reader);\r
+                    result.Add(item);\r
+                }\r
+            }\r
+            return result;\r
+        }\r
+\r
+        private List<MamResultWrapper> ProcessMamAdvertismentResult(List<clIFsp_EC_MAMAdvertismentResult> sqlResult) {\r
+            if (sqlResult == null)\r
+                return null;\r
+            List<MamResultWrapper> result = new List<MamResultWrapper>();\r
+            foreach (clIFsp_EC_MAMAdvertismentResult actual in sqlResult) {\r
+                //MamResultWrapper actualObject = new MamResultWrapper() {\r
+                //    MediaID = actual.v_MediaID,\r
+                //    EpisodeTitle = actual.v_EpTitle,\r
+                //    Title = actual.v_ProgTitle,\r
+                //    EpisodeNumber = actual.v_EpisodeID,\r
+                //    VariantID = actual.v_VariantID.HasValue ? actual.v_VariantID.Value : -1,\r
+                //    Episode = actual.v_Episode.HasValue ? actual.v_Episode.Value : (short)-1,\r
+                //    NextBroadcastDate = actual.v_NextBroadcastDate\r
+                //};\r
+                //result.Add(actualObject);\r
+            }\r
+            return result;\r
+        }\r
     }\r
 }\r
index a7b3581ffd21f1baaa43419c442d694068daeed3..390d87a97c96229a5a10380eabf0c7ebe32dcfc4 100644 (file)
@@ -63,14 +63,14 @@ namespace TrafficClient
                }\r
                \r
                [global::System.Data.Linq.Mapping.FunctionAttribute(Name="dbo.clIFsp_EC_MAM")]\r
-               public ISingleResult<clIFsp_EC_MAMResult> clIFsp_EC_MAM([global::System.Data.Linq.Mapping.ParameterAttribute(Name="Operation", DbType="Int")] System.Nullable<int> operation, [global::System.Data.Linq.Mapping.ParameterAttribute(Name="@@Options", DbType="Int")] System.Nullable<int> @__Options, [global::System.Data.Linq.Mapping.ParameterAttribute(Name="@ItemID", DbType="Int")] System.Nullable<int> _ItemID, [global::System.Data.Linq.Mapping.ParameterAttribute(Name="@IntParam1", DbType="Int")] System.Nullable<int> _IntParam1, [global::System.Data.Linq.Mapping.ParameterAttribute(Name="@IntParam2", DbType="Int")] System.Nullable<int> _IntParam2, [global::System.Data.Linq.Mapping.ParameterAttribute(Name="@IntParam3", DbType="Int")] System.Nullable<int> _IntParam3, [global::System.Data.Linq.Mapping.ParameterAttribute(Name="@StrParam1", DbType="VarChar(200)")] string _StrParam1, [global::System.Data.Linq.Mapping.ParameterAttribute(Name="@StrParam2", DbType="VarChar(MAX)")] string _StrParam2, [global::System.Data.Linq.Mapping.ParameterAttribute(Name="@DateParam1", DbType="DateTime")] System.Nullable<System.DateTime> _DateParam1, [global::System.Data.Linq.Mapping.ParameterAttribute(Name="@DateParam2", DbType="DateTime")] System.Nullable<System.DateTime> _DateParam2)\r
+               public ISingleResult<clIFsp_EC_MAMBradocastResult> clIFsp_EC_MAM([global::System.Data.Linq.Mapping.ParameterAttribute(Name="Operation", DbType="Int")] System.Nullable<int> operation, [global::System.Data.Linq.Mapping.ParameterAttribute(Name="@@Options", DbType="Int")] System.Nullable<int> @__Options, [global::System.Data.Linq.Mapping.ParameterAttribute(Name="@ItemID", DbType="Int")] System.Nullable<int> _ItemID, [global::System.Data.Linq.Mapping.ParameterAttribute(Name="@IntParam1", DbType="Int")] System.Nullable<int> _IntParam1, [global::System.Data.Linq.Mapping.ParameterAttribute(Name="@IntParam2", DbType="Int")] System.Nullable<int> _IntParam2, [global::System.Data.Linq.Mapping.ParameterAttribute(Name="@IntParam3", DbType="Int")] System.Nullable<int> _IntParam3, [global::System.Data.Linq.Mapping.ParameterAttribute(Name="@StrParam1", DbType="VarChar(200)")] string _StrParam1, [global::System.Data.Linq.Mapping.ParameterAttribute(Name="@StrParam2", DbType="VarChar(MAX)")] string _StrParam2, [global::System.Data.Linq.Mapping.ParameterAttribute(Name="@DateParam1", DbType="DateTime")] System.Nullable<System.DateTime> _DateParam1, [global::System.Data.Linq.Mapping.ParameterAttribute(Name="@DateParam2", DbType="DateTime")] System.Nullable<System.DateTime> _DateParam2)\r
                {\r
                        IExecuteResult result = this.ExecuteMethodCall(this, ((MethodInfo)(MethodInfo.GetCurrentMethod())), operation, @__Options, _ItemID, _IntParam1, _IntParam2, _IntParam3, _StrParam1, _StrParam2, _DateParam1, _DateParam2);\r
-                       return ((ISingleResult<clIFsp_EC_MAMResult>)(result.ReturnValue));\r
+                       return ((ISingleResult<clIFsp_EC_MAMBradocastResult>)(result.ReturnValue));\r
                }\r
        }\r
        \r
-       public partial class clIFsp_EC_MAMResult\r
+       public partial class clIFsp_EC_MAMBradocastResult\r
        {\r
                \r
                private int _v_ProgrammeID;\r
@@ -109,7 +109,7 @@ namespace TrafficClient
 \r
         private string _v_MediaID;\r
                \r
-               public clIFsp_EC_MAMResult()\r
+               public clIFsp_EC_MAMBradocastResult()\r
                {\r
                }\r
                \r
index 50e66513f2925991638379132f4b37cd4cafa95d..f152a4c02d7964c4bb784daaf0655a12541ac3a1 100644 (file)
@@ -50,6 +50,8 @@
     <Reference Include="System.Xml" />\r
   </ItemGroup>\r
   <ItemGroup>\r
+    <Compile Include="clIFsp_EC_MAMAdvertismentsResult.cs" />\r
+    <Compile Include="clIFsp_EC_MAMPromotionalResult.cs" />\r
     <Compile Include="clIFsp_EC_SegmentResult.cs" />\r
     <Compile Include="CustomDataGridView.cs">\r
       <SubType>Component</SubType>\r
index acc44da097a2397bac864769fc458e2920251133..4d2937987c6d1b4941a9c4a67cc2e96ecce25135 100644 (file)
@@ -41,7 +41,7 @@ namespace TrafficClient {
                             AutoSizeMode = DataGridViewAutoSizeColumnMode.DisplayedCells,\r
                             DataPropertyName = "MediaID",\r
                             HeaderText = Resources.TRAFFIC_ID,\r
-                            \r
+\r
                     },\r
                     new DataGridViewTextBoxColumn() {\r
                         AutoSizeMode = DataGridViewAutoSizeColumnMode.DisplayedCells,\r
@@ -85,8 +85,13 @@ namespace TrafficClient {
                 from = scheduledDate.Value;\r
                 to = scheduledDate.Value.AddDays(1);\r
             }\r
-            var result = trafficAPI.Search(searchText, from, to, copiaCheckBox.Checked)?.ToArray();\r
-\r
+            MamResultWrapper[] result = null;\r
+            if (radioButtonBroadCast.Checked)\r
+                result = trafficAPI.SearchBroadcast(searchText, from, to, copiaCheckBox.Checked)?.ToArray();\r
+            else if(radioButtonAD.Checked)\r
+                result = trafficAPI.SearchAdvertisement(searchText)?.ToArray();\r
+            else if(radioButtonPromo.Checked)\r
+                result = trafficAPI.SearchPromotional(searchText)?.ToArray();\r
             if (result == null) {\r
                 dataGridView1.DataSource = null;\r
                 return;\r
diff --git a/client/PlanAIRClient/clIFsp_EC_MAMAdvertismentsResult.cs b/client/PlanAIRClient/clIFsp_EC_MAMAdvertismentsResult.cs
new file mode 100644 (file)
index 0000000..00cee67
--- /dev/null
@@ -0,0 +1,195 @@
+using System;\r
+using System.Collections.Generic;\r
+using System.Linq;\r
+using System.Text;\r
+using System.Threading.Tasks;\r
+\r
+namespace TrafficClient {\r
+    public partial class clIFsp_EC_MAMAdvertismentResult {\r
+\r
+        private int _t_SpotID;\r
+\r
+        private string _t_MediaID;\r
+\r
+        private string _v_Title;\r
+\r
+        private string _t_Advertiser;\r
+\r
+        private System.Nullable<int> _v_EstimatedDuration;\r
+\r
+        private System.Nullable<int> _t_TcIn;\r
+\r
+        private System.Nullable<int> _t_TcOut;\r
+\r
+        private System.Nullable<int> _t_Duration;\r
+\r
+        private string _v_TcIn;\r
+\r
+        private string _v_TcOut;\r
+\r
+        private string _v_Duration;\r
+\r
+        private System.Nullable<bool> _t_OkForAir;\r
+\r
+        private System.Nullable<bool> _v_OkForAirs;\r
+\r
+        public clIFsp_EC_MAMAdvertismentResult() {\r
+        }\r
+\r
+        [global::System.Data.Linq.Mapping.ColumnAttribute(Storage = "_t_SpotID", DbType = "Int NOT NULL")]\r
+        public int t_SpotID {\r
+            get {\r
+                return this._t_SpotID;\r
+            }\r
+            set {\r
+                if ((this._t_SpotID != value)) {\r
+                    this._t_SpotID = value;\r
+                }\r
+            }\r
+        }\r
+\r
+        [global::System.Data.Linq.Mapping.ColumnAttribute(Storage = "_t_MediaID", DbType = "VarChar(8) NOT NULL")]\r
+        public string t_MediaID {\r
+            get {\r
+                return this._t_MediaID;\r
+            }\r
+            set {\r
+                if ((this._t_MediaID != value)) {\r
+                    this._t_MediaID = value;\r
+                }\r
+            }\r
+        }\r
+\r
+        [global::System.Data.Linq.Mapping.ColumnAttribute(Storage = "_v_Title", DbType = "NVarChar(60)", CanBeNull = false)]\r
+        public string v_Title {\r
+            get {\r
+                return this._v_Title;\r
+            }\r
+            set {\r
+                if ((this._v_Title != value)) {\r
+                    this._v_Title = value;\r
+                }\r
+            }\r
+        }\r
+\r
+        [global::System.Data.Linq.Mapping.ColumnAttribute(Storage = "_t_Advertiser", DbType = "NvarChar(60)")]\r
+        public string t_Advertiser {\r
+            get {\r
+                return this._t_Advertiser;\r
+            }\r
+            set {\r
+                if ((this._t_Advertiser != value)) {\r
+                    this._t_Advertiser = value;\r
+                }\r
+            }\r
+        }\r
+\r
+        [global::System.Data.Linq.Mapping.ColumnAttribute(Storage = "_v_EstimatedDuration", DbType = "Int")]\r
+        public System.Nullable<int> v_EstimatedDuration {\r
+            get {\r
+                return this._v_EstimatedDuration;\r
+            }\r
+            set {\r
+                if ((this._v_EstimatedDuration != value)) {\r
+                    this._v_EstimatedDuration = value;\r
+                }\r
+            }\r
+        }\r
+\r
+        [global::System.Data.Linq.Mapping.ColumnAttribute(Storage = "_t_TcIn", DbType = "Int")]\r
+        public System.Nullable<int> t_TcIn {\r
+            get {\r
+                return this._t_TcIn;\r
+            }\r
+            set {\r
+                if ((this._t_TcIn != value)) {\r
+                    this._t_TcIn = value;\r
+                }\r
+            }\r
+        }\r
+\r
+        [global::System.Data.Linq.Mapping.ColumnAttribute(Storage = "_t_TcOut", DbType = "Int")]\r
+        public System.Nullable<int> t_TcOut {\r
+            get {\r
+                return this._t_TcOut;\r
+            }\r
+            set {\r
+                if ((this._t_TcOut != value)) {\r
+                    this._t_TcOut = value;\r
+                }\r
+            }\r
+        }\r
+\r
+        [global::System.Data.Linq.Mapping.ColumnAttribute(Storage = "_t_Duration", DbType = "Int")]\r
+        public System.Nullable<int> t_Duration {\r
+            get {\r
+                return this._t_Duration;\r
+            }\r
+            set {\r
+                if ((this._t_Duration != value)) {\r
+                    this._t_Duration = value;\r
+                }\r
+            }\r
+        }\r
+\r
+        [global::System.Data.Linq.Mapping.ColumnAttribute(Storage = "_v_TcIn", DbType = "Varchar(40)")]\r
+        public string v_TcIn {\r
+            get {\r
+                return this._v_TcIn;\r
+            }\r
+            set {\r
+                if ((this._v_TcIn != value)) {\r
+                    this._v_TcIn = value;\r
+                }\r
+            }\r
+        }\r
+\r
+        [global::System.Data.Linq.Mapping.ColumnAttribute(Storage = "_v_TcOut", DbType = "Varchar(40)")]\r
+        public string v_TcOut {\r
+            get {\r
+                return this._v_TcOut;\r
+            }\r
+            set {\r
+                if ((this._v_TcOut != value)) {\r
+                    this._v_TcOut = value;\r
+                }\r
+            }\r
+        }\r
+\r
+        [global::System.Data.Linq.Mapping.ColumnAttribute(Storage = "_v_Duration", DbType = "Varchar(40)")]\r
+        public string v_Duration {\r
+            get {\r
+                return this._v_Duration;\r
+            }\r
+            set {\r
+                if ((this._v_Duration != value)) {\r
+                    this._v_Duration = value;\r
+                }\r
+            }\r
+        }\r
+\r
+        [global::System.Data.Linq.Mapping.ColumnAttribute(Storage = "_t_OkForAir", DbType = "Bit")]\r
+        public System.Nullable<bool> t_OkForAir {\r
+            get {\r
+                return this._t_OkForAir;\r
+            }\r
+            set {\r
+                if ((this._t_OkForAir != value)) {\r
+                    this._t_OkForAir = value;\r
+                }\r
+            }\r
+        }\r
+\r
+        [global::System.Data.Linq.Mapping.ColumnAttribute(Storage = "_v_OkForAirs", DbType = "Bit")]\r
+        public System.Nullable<bool> v_OkForAirs {\r
+            get {\r
+                return this._v_OkForAirs;\r
+            }\r
+            set {\r
+                if ((this._v_OkForAirs != value)) {\r
+                    this._v_OkForAirs = value;\r
+                }\r
+            }\r
+        }\r
+    }\r
+}\r
diff --git a/client/PlanAIRClient/clIFsp_EC_MAMPromotionalResult.cs b/client/PlanAIRClient/clIFsp_EC_MAMPromotionalResult.cs
new file mode 100644 (file)
index 0000000..2a94fe3
--- /dev/null
@@ -0,0 +1,273 @@
+namespace TrafficClient {\r
+    public partial class clIFsp_EC_MAMPromotionalResult {\r
+\r
+        private int _t_SpotID;\r
+\r
+        private string _t_MediaID;\r
+\r
+        private string _v_Title;\r
+\r
+        private string _v_PromoType;\r
+\r
+        private string _v_ProgTitle;\r
+\r
+        private System.Nullable<short> _v_Episode;\r
+\r
+        private System.Nullable<System.DateTime> _t_PSStart;\r
+\r
+        private System.Nullable<System.DateTime> _t_PSEnd;\r
+\r
+        private System.Nullable<int> _v_EstimatedDuration;\r
+\r
+        private System.Nullable<int> _t_TcIn;\r
+\r
+        private System.Nullable<int> _t_TcOut;\r
+\r
+        private System.Nullable<int> _t_Duration;\r
+\r
+        private string _v_TcIn;\r
+\r
+        private string _v_TcOut;\r
+\r
+        private string _v_Duration;\r
+\r
+        private string _v_Stations;\r
+\r
+        private System.Nullable<bool> _t_OkForAir;\r
+\r
+        private System.Nullable<bool> _v_OkForAirs;\r
+\r
+        private System.Nullable<bool> _v_IsInactive;\r
+\r
+        public clIFsp_EC_MAMPromotionalResult() {\r
+        }\r
+\r
+        [global::System.Data.Linq.Mapping.ColumnAttribute(Storage = "_t_SpotID", DbType = "Int NOT NULL")]\r
+        public int t_SpotID {\r
+            get {\r
+                return this._t_SpotID;\r
+            }\r
+            set {\r
+                if ((this._t_SpotID != value)) {\r
+                    this._t_SpotID = value;\r
+                }\r
+            }\r
+        }\r
+\r
+        [global::System.Data.Linq.Mapping.ColumnAttribute(Storage = "_t_MediaID", DbType = "VarChar(8) NOT NULL")]\r
+        public string t_MediaID {\r
+            get {\r
+                return this._t_MediaID;\r
+            }\r
+            set {\r
+                if ((this._t_MediaID != value)) {\r
+                    this._t_MediaID = value;\r
+                }\r
+            }\r
+        }\r
+\r
+        [global::System.Data.Linq.Mapping.ColumnAttribute(Storage = "_v_Title", DbType = "NVarChar(60)", CanBeNull = false)]\r
+        public string v_Title {\r
+            get {\r
+                return this._v_Title;\r
+            }\r
+            set {\r
+                if ((this._v_Title != value)) {\r
+                    this._v_Title = value;\r
+                }\r
+            }\r
+        }\r
+\r
+        [global::System.Data.Linq.Mapping.ColumnAttribute(Storage = "_v_PromoType", DbType = "NvarChar(60)")]\r
+        public string v_PromoType {\r
+            get {\r
+                return this._v_PromoType;\r
+            }\r
+            set {\r
+                if ((this._v_PromoType != value)) {\r
+                    this._v_PromoType = value;\r
+                }\r
+            }\r
+        }\r
+\r
+        [global::System.Data.Linq.Mapping.ColumnAttribute(Storage = "_v_ProgTitle", DbType = "NVarChar(60)")]\r
+        public string v_ProgTitle {\r
+            get {\r
+                return this._v_ProgTitle;\r
+            }\r
+            set {\r
+                if ((this._v_ProgTitle != value)) {\r
+                    this._v_ProgTitle = value;\r
+                }\r
+            }\r
+        }\r
+\r
+        [global::System.Data.Linq.Mapping.ColumnAttribute(Storage = "_v_Episode", DbType = "SmallInt")]\r
+        public System.Nullable<short> v_Episode {\r
+            get {\r
+                return this._v_Episode;\r
+            }\r
+            set {\r
+                if ((this._v_Episode != value)) {\r
+                    this._v_Episode = value;\r
+                }\r
+            }\r
+        }\r
+\r
+        [global::System.Data.Linq.Mapping.ColumnAttribute(Storage = "_t_PSStart", DbType = "DateTime")]\r
+        public System.Nullable<System.DateTime> t_PSStart {\r
+            get {\r
+                return this._t_PSStart;\r
+            }\r
+            set {\r
+                if ((this._t_PSStart != value)) {\r
+                    this._t_PSStart = value;\r
+                }\r
+            }\r
+        }\r
+\r
+        [global::System.Data.Linq.Mapping.ColumnAttribute(Storage = "_t_PSEnd", DbType = "DateTime")]\r
+        public System.Nullable<System.DateTime> t_PSEnd {\r
+            get {\r
+                return this._t_PSEnd;\r
+            }\r
+            set {\r
+                if ((this._t_PSEnd != value)) {\r
+                    this._t_PSEnd = value;\r
+                }\r
+            }\r
+        }\r
+\r
+        [global::System.Data.Linq.Mapping.ColumnAttribute(Storage = "_v_EstimatedDuration", DbType = "Int")]\r
+        public System.Nullable<int> v_EstimatedDuration {\r
+            get {\r
+                return this._v_EstimatedDuration;\r
+            }\r
+            set {\r
+                if ((this._v_EstimatedDuration != value)) {\r
+                    this._v_EstimatedDuration = value;\r
+                }\r
+            }\r
+        }\r
+\r
+        [global::System.Data.Linq.Mapping.ColumnAttribute(Storage = "_t_TcIn", DbType = "Int")]\r
+        public System.Nullable<int> t_TcIn {\r
+            get {\r
+                return this._t_TcIn;\r
+            }\r
+            set {\r
+                if ((this._t_TcIn != value)) {\r
+                    this._t_TcIn = value;\r
+                }\r
+            }\r
+        }\r
+\r
+        [global::System.Data.Linq.Mapping.ColumnAttribute(Storage = "_t_TcOut", DbType = "Int")]\r
+        public System.Nullable<int> t_TcOut {\r
+            get {\r
+                return this._t_TcOut;\r
+            }\r
+            set {\r
+                if ((this._t_TcOut != value)) {\r
+                    this._t_TcOut = value;\r
+                }\r
+            }\r
+        }\r
+\r
+        [global::System.Data.Linq.Mapping.ColumnAttribute(Storage = "_t_Duration", DbType = "Int")]\r
+        public System.Nullable<int> t_Duration {\r
+            get {\r
+                return this._t_Duration;\r
+            }\r
+            set {\r
+                if ((this._t_Duration != value)) {\r
+                    this._t_Duration = value;\r
+                }\r
+            }\r
+        }\r
+\r
+        [global::System.Data.Linq.Mapping.ColumnAttribute(Storage = "_v_TcIn", DbType = "Varchar(40)")]\r
+        public string v_TcIn {\r
+            get {\r
+                return this._v_TcIn;\r
+            }\r
+            set {\r
+                if ((this._v_TcIn != value)) {\r
+                    this._v_TcIn = value;\r
+                }\r
+            }\r
+        }\r
+\r
+        [global::System.Data.Linq.Mapping.ColumnAttribute(Storage = "_v_TcOut", DbType = "Varchar(40)")]\r
+        public string v_TcOut {\r
+            get {\r
+                return this._v_TcOut;\r
+            }\r
+            set {\r
+                if ((this._v_TcOut != value)) {\r
+                    this._v_TcOut = value;\r
+                }\r
+            }\r
+        }\r
+\r
+        [global::System.Data.Linq.Mapping.ColumnAttribute(Storage = "_v_Duration", DbType = "Varchar(40)")]\r
+        public string v_Duration {\r
+            get {\r
+                return this._v_Duration;\r
+            }\r
+            set {\r
+                if ((this._v_Duration != value)) {\r
+                    this._v_Duration = value;\r
+                }\r
+            }\r
+        }\r
+\r
+        [global::System.Data.Linq.Mapping.ColumnAttribute(Storage = "_v_Stations", DbType = "VarChar(100)")]\r
+        public string v_Stations {\r
+            get {\r
+                return this._v_Stations;\r
+            }\r
+            set {\r
+                if ((this._v_Stations != value)) {\r
+                    this._v_Stations = value;\r
+                }\r
+            }\r
+        }\r
+\r
+        [global::System.Data.Linq.Mapping.ColumnAttribute(Storage = "_t_OkForAir", DbType = "Bit")]\r
+        public System.Nullable<bool> t_OkForAir {\r
+            get {\r
+                return this._t_OkForAir;\r
+            }\r
+            set {\r
+                if ((this._t_OkForAir != value)) {\r
+                    this._t_OkForAir = value;\r
+                }\r
+            }\r
+        }\r
+\r
+        [global::System.Data.Linq.Mapping.ColumnAttribute(Storage = "_v_OkForAirs", DbType = "Bit")]\r
+        public System.Nullable<bool> v_OkForAirs {\r
+            get {\r
+                return this._v_OkForAirs;\r
+            }\r
+            set {\r
+                if ((this._v_OkForAirs != value)) {\r
+                    this._v_OkForAirs = value;\r
+                }\r
+            }\r
+        }\r
+\r
+        [global::System.Data.Linq.Mapping.ColumnAttribute(Storage = "_v_IsInactive", DbType = "Bit")]\r
+        public System.Nullable<bool> v_IsInactive {\r
+            get {\r
+                return this._v_IsInactive;\r
+            }\r
+            set {\r
+                if ((this._v_IsInactive != value)) {\r
+                    this._v_IsInactive = value;\r
+                }\r
+            }\r
+        }\r
+    }\r
+}\r