public TraderEditVM()
 {
     IndividualOrder     = new IndividualOrder();
     IndividualBlock     = new IndividualBlock();
     OrderInBlock        = new ObservableCollection <Order>();
     SaveDelegateCommand = new DelegateCommand(o => true, SaveData);
     Order = db.Orders.ToList();
     Block = db.Blocks.ToList();
     DashBoardPageCommand = new DelegateCommand((obj) => true, TradersDashBoardAction);
 }
Esempio n. 2
0
        /// <summary>
        /// Gets individual order URL
        /// </summary>
        /// <param name="product">Product</param>
        /// <returns>Product URL</returns>
        public static string GetIndividualOrderURL(IndividualOrder indOrder)
        {
            if (indOrder == null)
            {
                throw new ArgumentNullException("indOrder");
            }

            string url = string.Format("{0}IndividualOrder.aspx?orderID={1}",
                                       CommonHelper.GetStoreLocation(), indOrder.IndividualOrderID);

            return(url);
        }
Esempio n. 3
0
        public async Task <IActionResult> Individual(string order)
        {
            var client = _context.Clients.First(x => x.UserGuid == this.User.FindFirst(ClaimTypes.NameIdentifier).Value);

            var indOrder = new IndividualOrder()
            {
                ClientGuid = this.User.FindFirst(ClaimTypes.NameIdentifier).Value, EmployeeGuid = null, OrderDescription = order, OrderingTime = DateTimeOffset.Now, ClientName = client.FullName, isCompleted = 0, PhoneNumber = client.PhoneNumber
            };

            _context.IndividualOrders.Add(indOrder);
            await _context.SaveChangesAsync();

            return(View("menu"));
        }
 public TraderDashboardVM()
 {
     IndividualOrder = new IndividualOrder();
     IndividualBlock = new IndividualBlock();
     OrderInBlock    = new ObservableCollection <Order>();
     Order           = new ObservableCollection <CheckedOpenOrder>(CheckedOpenOrderToOrderMapper.ToCheckedOrderList(db.Orders.Where(o => o.BlockID == null).ToList()));
     // OrderInBlock = db.Orders.ToList().Where(o => o.BlockID == 8);
     Block = new ObservableCollection <CheckedBlock>(BlockToCheckedBlockMapper.ToCheckedBlockList(db.Blocks.ToList()));
     ViewBlockOrdersCommand   = new DelegateCommand(ViewBlockOrdersPredicate, ViewBlockOrdersAction);
     CreateNewBlockCommand    = new DelegateCommand(CreaetNewBlockPredicte, CreateNewBlockAction);
     AddToExistingCommand     = new DelegateCommand(AddToExistingPredicate, AddToExistingAction);
     EditBlockOrdersCommand   = new DelegateCommand((obj) => true, EditBlockOrdersAction);
     CancelBlockOrdersCommand = new DelegateCommand((obj) => true, CancelBlockOrdersAction);
     ViewBlockCommand         = new DelegateCommand((obj) => true, ViewBlockAction);
     SendToExchangeCommand    = new DelegateCommand(SendToExchangePredicate, SendToExchangeAction);
 }
Esempio n. 5
0
        public IActionResult AddInd(IndividualOrder order)
        {
            var master = _context.Masters.First(x => x.UserGuid == this.User.FindFirst(ClaimTypes.NameIdentifier).Value);

            var indOrder = _context.IndividualOrders.First(x => x.OrderDescription.Equals(order.OrderDescription));


            var rnd = new Random();

            indOrder.MasterName   = master.FullName;
            indOrder.EmployeeGuid = master.UserGuid;

            indOrder.Cost = order.Cost;
            _context.IndividualOrders.Update(indOrder);
            _context.SaveChanges();

            return(RedirectToAction("menu"));
        }