示例#1
0
        public Order CreateOrder(Order newOrder, string userId)
        {
            var cart = DownloadCart();

            newOrder.DateAdded = DateTime.Now;
            newOrder.UserId    = userId;

            db.Orders.Add(newOrder);

            if (newOrder.PositionsOrder == null)
            {
                newOrder.PositionsOrder = new List <PositionOrder>();
            }

            decimal cartValue = 0;

            foreach (var elementCart in cart)
            {
                var newPositionOrder = new PositionOrder()
                {
                    AudiobookId = elementCart.Audiobook.AudiobookId,
                    Amount      = elementCart.Amount,
                    TotalPrice  = elementCart.Audiobook.PriceAudiobook
                };

                cartValue += (elementCart.Amount * elementCart.Audiobook.PriceAudiobook);
                newOrder.PositionsOrder.Add(newPositionOrder);
            }

            newOrder.OrderValue = cartValue;
            db.SaveChanges();
            return(newOrder);
        }
示例#2
0
 public ControllerPosition(
     string callsign,
     string rtfCallsign,
     string frequency,
     string identifier,
     string middleLetter,
     string prefix,
     string suffix,
     string squawkRangeStart,
     string squawkRangeEnd,
     List <Coordinate> visCentres,
     PositionOrder positionOrder,
     Definition definition,
     Docblock docblock,
     Comment inlineComment
     ) : base(definition, docblock, inlineComment)
 {
     Callsign         = callsign;
     RtfCallsign      = rtfCallsign;
     Frequency        = frequency;
     Identifier       = identifier;
     MiddleLetter     = middleLetter;
     Prefix           = prefix;
     Suffix           = suffix;
     SquawkRangeStart = squawkRangeStart;
     SquawkRangeEnd   = squawkRangeEnd;
     VisCentres       = visCentres;
     PositionOrder    = positionOrder;
 }
示例#3
0
 public ApptToolTip(Appointment appointment, FrameworkElement control)
     : base(control)
 {
     InitializeComponent();
     Owner         = GetWindow(control);
     PositionOrder = new PositionOrder(Location.Right, Location.Left, Location.Top, Location.Bottom, Location.Right);
     _appointment  = appointment;
     InitializeDisplay();
     Show();
 }
        public HiddenTabsFlyout(UIElement ownerControl, IEnumerable tabsSource)
            : base(ownerControl)
        {
            InitializeComponent();

            PositionOrder = new PositionOrder(Location.Bottom, Location.Left, Location.Top, Location.Right, Location.Right);
            Owner         = Window.GetWindow(ownerControl);

            ownerControl.MouseEnter += ownerControl_MouseEnter;
            ownerControl.MouseLeave += ownerControl_MouseLeave;

            listBox.ItemsSource = tabsSource;
            Show();
        }
        public BackgroundSyncDialog(UIElement ownerControl, SyncHelper syncHelper)
            : base(ownerControl)
        {
            InitializeComponent();
            LastUsedSyncDialog = this;

            _syncHelper = syncHelper;

            PositionOrder = new PositionOrder(Location.Top, Location.Bottom, Location.Right, Location.Left, Location.Top);

            syncHelper.OnStatusChangedEvent   += syncHelper_OnStatusChangedEvent;
            syncHelper.OnProgressChangedEvent += syncHelper_OnProgressChangedEvent;
            syncHelper.OnCompletedEvent       += syncHelper_OnCompletedEvent;

            Unloaded += BackgroundSyncDialog_Unloaded;

            InitializeDisplay();
        }
示例#6
0
 protected NavigationRadio(double PreviewPaneOffset, PositionOrder PreviewPanePositionOrder)
 {
     this.PreviewPaneOffset        = PreviewPaneOffset;
     this.PreviewPanePositionOrder = PreviewPanePositionOrder;
 }