示例#1
0
 public void SelectWindows(UserWindows userWindows)
 {
     using (var db = new InsideDBEntities())
     {
         var selectedUser = db.Users.Find(userWindows.Login);
         selectedUser.Alerts       = userWindows.Alerts;
         selectedUser.AllTrades    = userWindows.AllTrades;
         selectedUser.AllTradesPro = userWindows.AllTradesPro;
         selectedUser.Chart        = userWindows.Chart;
         selectedUser.Counter      = userWindows.Counter;
         selectedUser.L2           = userWindows.L2;
         selectedUser.Logbook      = userWindows.Logbook;
         selectedUser.Trading      = userWindows.Trading;
         selectedUser.FastOrder    = userWindows.FastOrder;
         db.SaveChanges();
         Clients.Client(selectedUser.ConnectionID).SelectWindows(userWindows);
     }
     GetUsers();
 }
示例#2
0
        private void SelectWindows()
        {
            var window = new AdminAvailableWindows
            {
                Login        = { Content = SelectedUser.Login },
                Level2       = { IsChecked = SelectedUser.L2 },
                AllTrades    = { IsChecked = SelectedUser.AllTrades },
                AllTradesPro = { IsChecked = SelectedUser.AllTradesPro },
                Chart        = { IsChecked = SelectedUser.Chart },
                Trading      = { IsChecked = SelectedUser.Trading },
                FastOrder    = { IsChecked = SelectedUser.FastOrder },
                Logbook      = { IsChecked = SelectedUser.Logbook },
                Counter      = { IsChecked = SelectedUser.Counter },
                Alerts       = { IsChecked = SelectedUser.Alerts }
            };

            window.ShowDialog();
            if (!window.Confirmed)
            {
                return;
            }
            var userWindows = new UserWindows
            {
                L2           = window.Level2.IsChecked.Value,
                AllTrades    = window.AllTrades.IsChecked.Value,
                AllTradesPro = window.AllTradesPro.IsChecked.Value,
                Chart        = window.Chart.IsChecked.Value,
                Trading      = window.Trading.IsChecked.Value,
                FastOrder    = window.FastOrder.IsChecked.Value,
                Counter      = window.Counter.IsChecked.Value,
                Logbook      = window.Logbook.IsChecked.Value,
                Alerts       = window.Alerts.IsChecked.Value,
                Login        = SelectedUser.Login
            };

            _hub.Invoke("SelectWindows", userWindows);
        }