Exemplo n.º 1
0
        public OrdersMainViewModel(IRegionManager regionManager, IUserSettingsRepository userSettingsRepository, TitleUpdater changeDashboardTitleService)
        {
            this.regionManager               = regionManager;
            this.userSettingsRepository      = userSettingsRepository;
            this.changeDashboardTitleService = changeDashboardTitleService;

            string ordersMainView = (string)userSettingsRepository.ReadSetting("OrdersMainView");

            SwitchViewCommand = new DelegateCommand(SwitchViewCommandExecute);

            switch (ordersMainView)
            {
            case "Journal View":
                ordersCurrentView   = OrdersViews.Journal;
                SwitchButtonContent = "To Creation";
                NameOfCurrentView   = "Journal";
                break;

            case "Create View":
                ordersCurrentView   = OrdersViews.Create;
                SwitchButtonContent = "To Journal";
                NameOfCurrentView   = "Create";
                break;
            }
        }
Exemplo n.º 2
0
        public ActionResult DialogUpdate([FromBody] CRUDModel <OrdersViews> myObject)
        {
            var         ord = myObject.Value;
            OrdersViews val = orderdata.Where(or => or.OrderID == ord.OrderID).FirstOrDefault();

            val.OrderID    = ord.OrderID;
            val.EmployeeID = ord.EmployeeID;
            val.CustomerID = ord.CustomerID;
            val.Freight    = ord.Freight;
            val.OrderDate  = ord.OrderDate;
            val.ShipCity   = ord.ShipCity;
            return(Json(myObject.Value));
        }
Exemplo n.º 3
0
        private void SwitchViewCommandExecute()
        {
            switch (ordersCurrentView)
            {
            case OrdersViews.Create:
                regionManager.RequestNavigate("OrdersCreateJournalRegion", "JournalView");
                ordersCurrentView   = OrdersViews.Journal;
                SwitchButtonContent = "To Create";
                NameOfCurrentView   = "Journal";
                break;

            case OrdersViews.Journal:
                regionManager.RequestNavigate("OrdersCreateJournalRegion", "CreateView");
                ordersCurrentView   = OrdersViews.Create;
                SwitchButtonContent = "To Journal";
                NameOfCurrentView   = "Create";
                break;
            }
        }