public FormLogin(int port)
 {
     _port = port;
     //RemotingConfiguration.Configure("Client.exe.config", false);
     _market = (IMarket)RemoteNew.New(typeof(IMarket));
     InitializeComponent();
 }
Esempio n. 2
0
        public ChangeOrder(Order order, Boolean message)
        {
            InitializeComponent();

            Order = order;
            r     = (IRegistry)RemoteNew.New(typeof(IRegistry));
            quote = r.GetQuote();

            typeLabel.Text = order.Type.ToString();
            qntlabel.Text  = order.Quantity.ToString();
            if (order.Type == OrderType.PURCHASE)
            {
                newpriceupanddown.Minimum = (decimal)(order.Quantity * quote);
                newpriceupanddown.Maximum = decimal.MaxValue;
            }
            else
            {
                newpriceupanddown.Minimum = 1;
                newpriceupanddown.Maximum = (decimal)(order.Quantity * quote);
            }

            newpriceupanddown.Value = (decimal)(order.Quantity * quote);

            if (message)
            {
                textBox1.Visible = true;
            }
        }
Esempio n. 3
0
        public ConfirmOrders(User user)
        {
            InitializeComponent();
            aTimer           = new System.Timers.Timer();
            aTimer.Interval  = 60000;
            aTimer.Elapsed  += OnTimedEvent;
            aTimer.AutoReset = false;

            r             = (IRegistry)RemoteNew.New(typeof(IRegistry));
            this.user     = user;
            quote         = r.GetQuote();
            pendingOrders = r.GetUserPendingOrders(user);

            foreach (Order order in pendingOrders)
            {
                ListViewItem item = new ListViewItem(order.Type.ToString());
                item.SubItems.Add(order.Quantity.ToString());
                item.SubItems.Add((order.Quantity * quote).ToString());
                confirmView.Items.Add(item);
            }

            r.ChangeAvailabilityOrders(user, false);

            //Start Timer
            aTimer.Enabled = true;
        }
Esempio n. 4
0
        public SignUp()
        {
            InitializeComponent();
            r         = (IRegistry)RemoteNew.New(typeof(IRegistry));
            this.Text = "Sign Up";
            TextBox passwordBox = this.Controls["passwordTextBox"] as TextBox;

            passwordBox.PasswordChar = '*';
        }
Esempio n. 5
0
        public Diginotes()
        {
            this.Text = "Diginotes - Login";
            InitializeComponent();
            r         = (IRegistry)RemoteNew.New(typeof(IRegistry));
            this.Text = "Diginotes";
            TextBox passwordBox = this.Controls["textboxpassword"] as TextBox;

            passwordBox.PasswordChar = '*';
        }
Esempio n. 6
0
        public Form1()
        {
            InitializeComponent();

            r                      = (IRegistry)RemoteNew.New(typeof(IRegistry));
            intermediate           = new EventIntermediate(r);
            intermediate.newQuote += OnQuoteChanged;

            //Set initial quote value
            quoteLabel      = (Label)this.Controls["quoteValueLabel"] as Label;
            quoteLabel.Text = r.GetQuote().ToString();
        }
Esempio n. 7
0
 void InitializeServerConnection()
 {
     try {
         RemotingConfiguration.Configure("Client.exe.config", false);
         _chatServer = (IServer)RemoteNew.New(typeof(IServer));
     }
     catch (Exception e) {
         Console.WriteLine(@"Failed to connect to Server:");
         Console.WriteLine(e.Message);
         LaunchServerError(e.Message);
     }
 }
Esempio n. 8
0
        public CreateDiginote()
        {
            InitializeComponent();

            r     = (IRegistry)RemoteNew.New(typeof(IRegistry));
            users = new List <User>(r.GetAllUsernames());
            guid  = new Guid();

            numericUpDown1.Minimum = 1;

            foreach (User user in users)
            {
                comboBox1.Items.Add(user.Username);
            }
        }
Esempio n. 9
0
        public PurchaseOrder(User user)
        {
            InitializeComponent();
            this.Text = "Buy Diginotes";

            numericUpDown.Minimum = 1;
            numericUpDown.Maximum = decimal.MaxValue;

            User = user;
            r    = (IRegistry)RemoteNew.New(typeof(IRegistry));

            quote            = r.GetQuote();
            quotelabel1.Text = quote.ToString();

            pricelabel4.Text = ((float)numericUpDown.Value * quote).ToString() + " €";
        }
Esempio n. 10
0
        public SellOrder(User user)
        {
            InitializeComponent();
            this.Text = "Sell Diginotes";

            User = user;
            r    = (IRegistry)RemoteNew.New(typeof(IRegistry));

            quote           = r.GetQuote();
            quotelabel.Text = quote.ToString();
            maxQuantity     = r.GetUserDiginotes(User).Count;

            numericUpDown1.Maximum = maxQuantity;
            numericUpDown1.Minimum = 1;

            priceLabel.Text = ((float)numericUpDown1.Value * quote).ToString() + " €";
        }
Esempio n. 11
0
        public Wallet(User user)
        {
            InitializeComponent();

            r = (IRegistry)RemoteNew.New(typeof(IRegistry));
            List <Diginote> diginotes = r.GetUserDiginotes(user);

            foreach (Diginote diginote in diginotes)
            {
                ListViewItem item = new ListViewItem(diginote.SerialNumber);
                listView.Items.Add(item);
            }

            Label totalLabel = this.Controls["totalLabel"] as Label;

            totalLabel.Text   = diginotes.Count.ToString();
            balanceLabel.Text = (diginotes.Count * r.GetQuote()).ToString() + "€";
        }
        public MainForm(string username, bool newU)
        {
            this.username  = username;
            pathToOrdersDB = "orders_" + username + ".db";
            InitializeComponent();
            iop = (IOperation)RemoteNew.New(typeof(IOperation));
            if (newU)
            {
                iop.addDiginotes(username);
            }

            loadOrders();
            nDiginotesLabel.Text = iop.getDiginotes(username).ToString();
            cotacaoLabel.Text    = iop.getCotacao().ToString();

            handlersObj = new Handlers(iop);
            handlersObj.updateOrderEvent += updateOrderHandler;
            handlersObj.blockInterface   += blockInterfaceHandler;

            updateOrderTable();
        }
Esempio n. 13
0
        public Admin()
        {
            InitializeComponent();

            r                      = (IRegistry)RemoteNew.New(typeof(IRegistry));
            intermediate           = new EventIntermediate(r);
            intermediate.newEvent += OnChangeEvent;

            //Init Pending Orders View
            pendingOrders = r.getPendingOrders();
            foreach (Order order in pendingOrders)
            {
                ListViewItem item = new ListViewItem(order.Type.ToString());
                item.SubItems.Add(order.Quantity.ToString());
                item.SubItems.Add(order.Owner.Username);
                listView1.Items.Add(item);
            }

            //Set initial quote
            currentQuote.Text = r.GetQuote().ToString();
        }
Esempio n. 14
0
        public Dashboard(User user)
        {
            this.Text = "Diginotes";
            InitializeComponent();

            UserLogged             = user;
            changedOffer           = false;
            r                      = (IRegistry)RemoteNew.New(typeof(IRegistry));
            intermediate           = new EventIntermediate(r);
            intermediate.newEvent += OnChangeEvent;

            //Set initial quote value
            quoteLabelValue.Text = r.GetQuote().ToString();

            //Set inital pending orders
            pendingOrders = r.GetUserPendingOrders(UserLogged);
            foreach (Order order in pendingOrders)
            {
                ListViewItem item = new ListViewItem(order.Type.ToString());
                item.SubItems.Add(order.Quantity.ToString());
                pendingView.Items.Add(item);
            }
        }
Esempio n. 15
0
 public LoginForm()
 {
     InitializeComponent();
     ul = (IUserList)RemoteNew.New(typeof(IUserList));
 }