Exemplo n.º 1
0
        private void frmSupply_Load(object sender, EventArgs e)
        {
            LoadingData data = new LoadingData();

            data.LoadItems(items);

            BindingSource bs = new BindingSource(data.itemsList, null);

            dgvItemsList.DataSource = bs;
        }
Exemplo n.º 2
0
        private void frmAdminView_Load(object sender, EventArgs e)
        {
            LoadingData data = new LoadingData();

            data.LoadUsers(users);
            data.LoadItems(items);
            data.LoadOrders(orders);

            BindingSource bs1 = new BindingSource(data.usersList, null);
            BindingSource bs2 = new BindingSource(data.itemsList, null);
            BindingSource bs3 = new BindingSource(data.ordersList, null);

            dgvUsers.DataSource  = bs1;
            dgvItems.DataSource  = bs2;
            dgvOrders.DataSource = bs3;
        }
Exemplo n.º 3
0
        private void btnLogin_Click(object sender, EventArgs e)
        {
            LoadingData data = new LoadingData();

            data.LoadUsers(users);
            foreach (var item in data.usersList)
            {
                if (txtUserName.Text == item.UserName && txtPassword.Text == item.Password)
                {
                    frmSupply supply = new frmSupply(users, items, orders, item.UserName);
                    supply.Show();
                }
                else if (txtUserName.Text == "user" && txtPassword.Text == "0000")
                {
                    frmAdminView admin = new frmAdminView(users, items, orders);
                    admin.Show();
                }
                else
                {
                    lblError.Text = "User name or password is not correct!";
                }
            }
        }