Exemple #1
0
        public void Create(DeliveryMethods item)
        {
            var Data = deliveryMethodsRepository.FindLastDeliveryMethodID() + 1;

            item.DeliveryMethodID = Data;
            deliveryMethodsRepository.Create(item);
        }
 public void Update(DeliveryMethods model)
 {
     using (var connection = new SqlConnection(SqlConnectionString.ConnectionString()))
     {
         connection.Execute(
             "UPDATE DeliveryMethods SET DeliveryMethod = @DeliveryMethod , Freight = @Freight WHERE DeliveryMethodID = @id",
             new
         {
             id             = model.DeliveryMethodID,
             DeliveryMethod = model.DeliveryMethod,
             Freight        = model.Freight
         });
     }
 }
 public void Create(DeliveryMethods model)
 {
     using (var connection = new SqlConnection(SqlConnectionString.ConnectionString()))
     {
         connection.Execute(
             "INSERT INTO DeliveryMethods VALUES(@DeliveryMethodID, @DeliveryMethod, @Freight)",
             new
         {
             DeliveryMethodID = model.DeliveryMethodID,
             DeliveryMethod   = model.DeliveryMethod,
             Freight          = model.Freight
         });
     }
 }
        public void Show()
        {
            DataTarget = Spheris.Billing.Data.BillingDataFactory.NewInstance().CreateInvoiceGroupRepository();

            Specialists = DataTarget.GetSpecialists();
            BillingSpecialist allSpecialists = new Spheris.Billing.Core.Domain.BillingSpecialist("*", 0);

            Specialists.Insert(0, allSpecialists);
            SelectedSpecialist = allSpecialists;

            DeliveryMethods = DataTarget.GetDeliveryMethods();
            DeliveryMethod allDeliverys = new DeliveryMethod("*", "*");

            DeliveryMethods.Insert(0, allDeliverys);
            SelectedDeliveryMethod = allDeliverys;

            //ViewCore.Show();

            OnPropertyChanged("IsExpanded");
            OnPropertyChanged("IGroups");
            OnPropertyChanged("DeliveryMethods");
            OnPropertyChanged("Specialists");
        }
        public DeliveryMethods FindById(int DeliveryMethodID)
        {
            DeliveryMethods deliveryMethod = null;

            using (var connection = new SqlConnection(SqlConnectionString.ConnectionString()))
            {
                var deliveryMethods = connection.Query <DeliveryMethods>(
                    "SELECT * FROM DeliveryMethods WHERE DeliveryMethodID = @id",
                    new
                {
                    id = DeliveryMethodID
                });

                foreach (var item in deliveryMethods)
                {
                    if (item.DeliveryMethodID != 0)
                    {
                        deliveryMethod = item;
                    }
                }
            }
            return(deliveryMethod);
        }
        public void SetItemDetails()
        {
            if (currentGroupItem == null || currentGroupItem.IsSpoof)
            {
                SelectedBrand          = null;
                SelectedFreq           = null;
                SelectedDeliveryMethod = null;
                SelectedPlatform       = null;
                SelectedSpecialist     = null;
                ContractName           = null;
                if (ReportTypes != null)
                {
                    ReportTypes.ForEach((thislist, thisreport) => RemoveWeakEventListener(thisreport, ReportListener));
                    ReportTypes = new ObservableReportTypes(safeReportTypes, true);
                    ReportTypes.ForEach((thislist, thisreport) => AddWeakEventListener(thisreport, ReportListener));
                }
                ClientLocations = null;

                RaisePropertyChanged("ReportTypes");
                ReportText = "Select Report Types...";
                return;
            }

            if (/*DB.Connnected &&*/ ReportTypes == null)
            {
                ReportTypes     = new ObservableReportTypes(ReportTypesTarget.GetReportTypesAsList());
                safeReportTypes = new ObservableReportTypes(ReportTypes, true);
            }

            if (CurrentGroupItem.ContractID == null)
            {
                ContractName = "No Contract assigned.";
            }
            else
            {
                Contract contract = ContractTarget.GetByContractID((int)CurrentGroupItem.ContractID);
                if (contract == null)
                {
                    ContractName = "No contract found for this Group.";
                }
                else
                {
                    ContractName = contract.DESCR;
                }
            }
            AddWeakEventListener(CurrentGroupItem, EncryptListener);

            IgReports = InvoiceGrpReportsTarget.GetById(currentGroupItem.InvoiceGrpId);

            foreach (ReportType reportType in ReportTypes)
            {
                foreach (InvoiceGrpReport igr in IgReports)
                {
                    if (igr.REPORT_TYPE_ID == reportType.REPORT_TYPE_ID)
                    {
                        reportType.IsSelected = true;
                    }
                    else
                    {
                        reportType.IsSelected = false;
                    }
                }
            }
            RaisePropertyChanged("ReportTypes");
            base.ViewCore.UpdateCB();

            SelectedSpecialist       = (Specialists.First(ss => ss.Id == currentGroupItem.BillingSpecialistID) as BillingSpecialist);
            SelectedFreq             = (Freqs.First(f => f.FREQ == currentGroupItem.BillingFrequency) as Freq);
            SelectedPlatform         = (Platforms.First(p => p.PLATFORM == currentGroupItem.PrimaryPlatform) as Platform);
            SelectedDeliveryMethod   = (DeliveryMethods.First(dm => dm.TheDeliveryMethod == currentGroupItem.DeliveryMethod) as DeliveryMethod);
            SelectedBrand            = (Brands.FirstOrDefault(b => b.BRAND == currentGroupItem.Brand) as Brand);
            SelectedRemitTo          = (RemitTos.First(r => r.REMIT_TO_ID == currentGroupItem.RemitToID) as RemitTo);
            SelectedInvoiceStyle     = (InvoiceStyles.First(i => i.INVOICE_STYLE == currentGroupItem.InvoiceStyle) as InvoiceStyle);
            SelectedInvoiceGrpStatus = (InvoiceGrpStatuss.First(i => i.INVOICE_GRP_STATUS == currentGroupItem.InvoiceGroupStatus) as InvoiceGrpStatus);

            if (ClientLocations != null)
            {
                ClientLocations.CollectionChanged -= ClientLocCollectionChanged;
            }
            ClientLocations = ExtClientTarget.FetchLocations(CurrentGroupItem.InvoiceGrpId, true);
            ClientLocations.CollectionChanged += ClientLocCollectionChanged;

            currentGroupItem.Modified = false;
            GroupVM.EnablePicker      = true;
        }
 /// <summary>
 /// Schedules an ad to be played by this plugin.
 /// </summary>
 /// <param name="adSource">The source of the ad content.</param>
 /// <param name="deliveryMethod">The delivery method of the ad content.</param>
 /// <param name="duration">The duration of the ad content that should be played.  If ommitted the plugin will play the full duration of the ad content.</param>
 /// <param name="startTime">The position within the media where this ad should be played.  If ommited ad will begin playing immediately.</param>
 /// <param name="clickThrough">The URL where the user should be directed when they click the ad.</param>
 /// <param name="pauseTimeline">Indicates if the timeline of the currently playing media should be paused while the ad is playing.</param>
 /// <param name="appendToAd">Another scheduled ad that this ad should be appended to.  If ommitted this ad will be scheduled independently.</param>
 /// <param name="data">User data.</param>
 /// <returns>A reference to the IAdContext that contains information about the scheduled ad.</returns>
 public IAdContext ScheduleAd(Uri adSource, DeliveryMethods deliveryMethod, TimeSpan? duration = null,
                              TimeSpan? startTime = null, TimeSpan? startOffset = null, Uri clickThrough = null, bool pauseTimeline = true,
                              IAdContext appendToAd = null, object data = null)
 {
     throw new NotImplementedException();
 }
Exemple #8
0
 public ActionResult CheckOutStep3(DeliveryMethods delivery)
 {
     var cart = GetCart();
     cart.Delivery = delivery;
     SaveCart(cart);
     return View();
 }
 public ActionResult UpdateDelivery(DeliveryMethods model)
 {
     deliveryService.UpdateDelivery(model);
     TempData["message"] = "成功修改運送方式";
     return(RedirectToRoute(new { Controlller = "Admin", Action = "Delivery" }));
 }
 /// <summary>
 /// Schedules an ad to be played by this plugin.
 /// </summary>
 /// <param name="adSource">The source of the ad content.</param>
 /// <param name="deliveryMethod">The delivery method of the ad content.</param>
 /// <param name="duration">The duration of the ad content that should be played.  If ommitted the plugin will play the full duration of the ad content.</param>
 /// <param name="startTime">The position within the media where this ad should be played.  If ommited ad will begin playing immediately.</param>
 /// <param name="clickThrough">The URL where the user should be directed when they click the ad.</param>
 /// <param name="pauseTimeline">Indicates if the timeline of the currently playing media should be paused while the ad is playing.</param>
 /// <param name="appendToAd">Another scheduled ad that this ad should be appended to.  If ommitted this ad will be scheduled independently.</param>
 /// <param name="data">User data.</param>
 /// <returns>A reference to the IAdContext that contains information about the scheduled ad.</returns>
 public IAdContext ScheduleAdvertisement(Uri adSource, DeliveryMethods deliveryMethod, TimeSpan? startTime, TimeSpan? startOffset,
                                         Uri clickThrough = null, TimeSpan? duration = null,
                                         bool pauseTimeline = true, IAdContext appendToAd = null, object data = null, bool isLinearClip = false)
 {
     IAdContext adContext = null;
     if (ActiveMediaPlugin != null && ActiveMediaPlugin.SupportsAdScheduling)
     {
         if (deliveryMethod == DeliveryMethods.NotSpecified ||
             (ActiveMediaPlugin.SupportedDeliveryMethods & deliveryMethod) != DeliveryMethods.NotSpecified)
         {
             adContext = ActiveMediaPlugin.ScheduleAd(adSource, deliveryMethod, duration, startTime, startOffset, clickThrough,
                                                      pauseTimeline, appendToAd, data, isLinearClip);
         }
         else
         {
             string message =
                 string.Format(SilverlightMediaFrameworkResources.UnsupportedAdDeliveryMethodExceptionMessage,
                               deliveryMethod);
             SendLogEntry(KnownLogEntryTypes.ScheduleAdvertisement, LogLevel.Warning, message);
             throw new ArgumentException(message, "deliveryMethod");
         }
     }
     return adContext;
 }
 /// <summary>
 /// Sets <see cref="IAdvertisement.DeliveryMethod"/> property of caller <see cref="IAdvertisement"/> instance to given <see cref="DeliveryMethods"/> value.
 /// </summary>
 /// <param name="advertisement">Caller <see cref="IAdvertisement"/> instance.</param>
 /// <param name="deliveryMethod">Given <see cref="DeliveryMethods"/> value.</param>
 /// <returns>The caller <see cref="IAdvertisement"/> instance with <see cref="IAdvertisement.DeliveryMethod"/> property setted to given <see cref="DeliveryMethods"/> value.</returns>
 public static IAdvertisement WithDeliveryMethod(this IAdvertisement advertisement, DeliveryMethods deliveryMethod)
 {
     advertisement.DeliveryMethod = deliveryMethod;
     return advertisement;
 }
        /// <summary>
        /// Schedules an ad to be played by this plugin.
        /// </summary>
        /// <param name="adSource">The source of the ad content.</param>
        /// <param name="deliveryMethod">The delivery method of the ad content.</param>
        /// <param name="duration">The duration of the ad content that should be played.  If ommitted the plugin will play the full duration of the ad content.</param>
        /// <param name="startTime">The position within the media where this ad should be played.  If ommited ad will begin playing immediately.</param>
        /// <param name="clickThrough">The URL where the user should be directed when they click the ad.</param>
        /// <param name="pauseTimeline">Indicates if the timeline of the currently playing media should be paused while the ad is playing.</param>
        /// <param name="appendToAd">Another scheduled ad that this ad should be appended to.  If ommitted this ad will be scheduled independently.</param>
        /// <param name="data">User data.</param>
        /// <param name="isLinearClip">Indicates that SSME.ScheduleLinearClip should be called instead of ScheduleClip. pauseTimeline must be false.</param>
        /// <returns>A reference to the IAdContext that contains information about the scheduled ad.</returns>
        public IAdContext ScheduleAd(Uri adSource, DeliveryMethods deliveryMethod, TimeSpan? duration = null,
                                     TimeSpan? startTime = null, TimeSpan? startOffset = null, Uri clickThrough = null, bool pauseTimeline = true,
                                     IAdContext appendToAd = null, object data = null, bool isLinearClip = false)
        {
#if !WINDOWS_PHONE
            if (adSource == null) throw new ArgumentNullException("adSource");

            Duration clipDuration = duration.HasValue
                                        ? new Duration(duration.Value)
                                        : TimeSpan.MaxValue;
            var adContext = appendToAd as AdContext;
            bool isSmoothStreamingSource = deliveryMethod == DeliveryMethods.AdaptiveStreaming;
            var clipInformation = new ClipInformation(isSmoothStreamingSource, adSource, clickThrough, clipDuration);

            var scheduledAd = new ScheduledAd
                                  {
                                      IsLinearClip = isLinearClip,
                                      ClipInformation = clipInformation,
                                      StartTime = startTime,
                                      StartOffset = startOffset,
                                      PauseTimeline = pauseTimeline,
                                      Data = data,
                                      AppendToAd = appendToAd != null
                                                       ? adContext.ScheduledAd
                                                       : null
                                  };

            if (CurrentState == MediaPluginState.Closed)
            {
                //Queue the ads until ManifestReady fires
                _scheduledAds.Add(scheduledAd);
            }
            else
            {
                ScheduleAd(scheduledAd);
            }

            if (isLinearClip)
            {
                return new LinearAdContext(scheduledAd, MediaElement, data);
            }
            else
            {
                return new AdContext(scheduledAd, data);
            }
#else
            throw new NotImplementedException();
#endif
        }
 /// <summary>
 /// Schedules an ad to be played by this plugin.
 /// </summary>
 /// <param name="adSource">The source of the ad content.</param>
 /// <param name="deliveryMethod">The delivery method of the ad content.</param>
 /// <param name="duration">The duration of the ad content that should be played.  If ommitted the plugin will play the full duration of the ad content.</param>
 /// <param name="startTime">The position within the media where this ad should be played.  If ommited ad will begin playing immediately.</param>
 /// <param name="clickThrough">The URL where the user should be directed when they click the ad.</param>
 /// <param name="pauseTimeline">Indicates if the timeline of the currently playing media should be paused while the ad is playing.</param>
 /// <param name="appendToAd">Another scheduled ad that this ad should be appended to.  If ommitted this ad will be scheduled independently.</param>
 /// <param name="data">User data.</param>
 /// <returns>A reference to the IAdContext that contains information about the scheduled ad.</returns>
 public IAdContext ScheduleAd(Uri adSource, DeliveryMethods deliveryMethod, TimeSpan?duration = null,
                              TimeSpan?startTime    = null, TimeSpan?startOffset = null, Uri clickThrough  = null, bool pauseTimeline = true,
                              IAdContext appendToAd = null, object data          = null, bool isLinearClip = false)
 {
     throw new NotImplementedException();
 }
 public IAdContext ScheduleAd(Uri adSource, DeliveryMethods deliveryMethod, TimeSpan?duration, TimeSpan?startTime, TimeSpan?startOffset, Uri clickThrough, bool pauseTimeline, IAdContext appendToAd, object data)
 {
     throw new NotImplementedException();
 }
 /// <summary>
 /// Add a piece of content with an ad stream to the smf player's playlist
 /// </summary>
 /// <param name="player">The smf player to add the content to</param>
 /// <param name="contentUrl">The url to the content</param>
 /// <param name="method">The delivery method for the content (adaptive or progressive)</param>
 /// <param name="adUrl">The stream to the ad schedule</param>
 public static void AddContentWithAdToPlaylist(SMFPlayer player, string contentUrl, DeliveryMethods method, Stream adStream)
 {
     AddContentWithAdToPlaylistInternal(player, contentUrl, method, adStream, TimeSpan.Zero, "assetID");
 }
 IAdContext IPlayer.PlayLinearAd(Uri adSource, DeliveryMethods deliveryMethod, TimeSpan? startTime, TimeSpan? startOffset, Uri clickThrough, TimeSpan? duration, bool pauseTimeline, IAdContext appendToAd, object data)
 {
     return this.ScheduleAdvertisement(adSource, deliveryMethod, startTime, startOffset, clickThrough, duration, pauseTimeline, appendToAd, data);
 }
 /// <summary>
 /// Add a piece of content with an ad url to the smf player's playlist
 /// </summary>
 /// <param name="player">The smf player to add the content to</param>
 /// <param name="contentUrl">The url to the content</param>
 /// <param name="method">The delivery method for the content (adaptive or progressive)</param>
 /// <param name="adUrl">The url to the ad schedule</param>
 /// <param name="startTime">The time in the content where playback will begin</param>
 /// <param name="assetID">The asset ID of the content that is being played</param>
 public static void AddContentWithAdToPlaylist(SMFPlayer player, string contentUrl, DeliveryMethods method, string adUrl, TimeSpan startTime, string assetID)
 {
     AddContentWithAdToPlaylistInternal(player, contentUrl, method, adUrl, startTime, assetID);
 }
 IAdContext IPlayer.PlayLinearAd(Uri adSource, DeliveryMethods deliveryMethod, TimeSpan?startTime, TimeSpan?startOffset, Uri clickThrough, TimeSpan?duration, bool pauseTimeline, IAdContext appendToAd, object data)
 {
     return(this.ScheduleAdvertisement(adSource, deliveryMethod, startTime, startOffset, clickThrough, duration, pauseTimeline, appendToAd, data));
 }
        /// <summary>
        /// Add a piece of content with an ad stream or url to the smf player's playlist; internal.
        /// </summary>
        /// <param name="player">The smf player to add the content to</param>
        /// <param name="contentUrl">The url to the content</param>
        /// <param name="method">The delivery method for the content (adaptive or progressive)</param>
        /// <param name="adSchedule">The stream to the ad schedule</param>
        /// <param name="startTime">The time in the content where playback will begin</param>
        /// <param name="assetID">The asset ID of the content that is being played</param>
        internal static void AddContentWithAdToPlaylistInternal(SMFPlayer player, string contentUrl, DeliveryMethods method, object adSchedule, TimeSpan startTime, string assetID)
        {
            PlaylistItem item = new PlaylistItem()
            {
                StartPosition = startTime,
                MediaAssetId = assetID,
                DeliveryMethod = method,
                MediaSource = new Uri(contentUrl),
                CustomMetadata = new Utilities.Metadata.MetadataCollection()
                {
                    new Utilities.Metadata.MetadataItem() { Key = Key_AdUrl, Value = adSchedule }
                }
            };

            player.Playlist.Add(item);
        }
Exemple #20
0
 public void UpdateDelivery(DeliveryMethods item)
 {
     deliveryMethodsRepository.Update(item);
 }
 /// <summary>
 /// Sets <see cref="IPlaylistItem.DeliveryMethod"/> property of caller <see cref="IPlaylistItem"/> instance to given <see cref="DeliveryMethods"/> value.
 /// </summary>
 /// <param name="playlistItem">Caller <see cref="IPlaylistItem"/> instance.</param>
 /// <param name="deliveryMethod">Given <see cref="DeliveryMethods"/> value.</param>
 /// <returns>The caller <see cref="IPlaylistItem"/> instance with <see cref="IPlaylistItem.DeliveryMethod"/> property setted to given <see cref="DeliveryMethods"/> value.</returns>
 public static IPlaylistItem WithDeliveryMethod(this IPlaylistItem playlistItem, DeliveryMethods deliveryMethod)
 {
     playlistItem.DeliveryMethod = deliveryMethod;
     return playlistItem;
 }