private void NotificationMessageReceived(Casher casher)
        {
            MainView mainView = new MainView(casher);

            mainView.Show();
            this.Close();
        }
        protected override EntityBase Map(IDataRecord record)
        {
            Casher casher = new Casher((int)record["casher_id"]);

            casher.Name    = record["casher_name"] as string;
            casher.Surname = record["casher_surname"] as string;
            return(casher);
        }
 public MainViewModel(Casher casher)
 {
     _casher     = casher;
     CasherInfo  = $"{_casher.Name} {casher.Surname}";
     _viewModels = new List <ViewModelBase>()
     {
         new OrderViewModel(this), new MenuViewModel(), new ReportViewModel()
     };
     CurrentViewModel = _viewModels[0];
 }
        protected override EntityBase Map(IDataRecord record)
        {
            Order order = new Order((int)record["order_id"]);

            var waiter = new Casher((int)record["waiter"]);

            waiter.Name    = record["casher_name"].ToString();
            waiter.Surname = record["casher_surname"].ToString();
            order.Waiter   = waiter;

            order.TableNumber = (int)record["table_number"];
            order.Date        = (DateTime)record["order_date"];

            return(order);
        }
Exemplo n.º 5
0
 public MainView(Casher casher)
 {
     InitializeComponent();
     this.DataContext = new ViewModel.MainViewModel(casher);
     Messenger.Default.Register <NotificationMessage>(this, MessageNotification);
 }