Exemple #1
0
        private void txtUserId_KeyUp(object sender, KeyEventArgs e)
        {
            if (e.KeyCode == Keys.Enter)
            {
                LibrarianDS.userRow userRow = findByUserId(Convert.ToInt32(txtUserId.Text));
                // if there is user with given id, show user's attributes in text controls and enable rent button
                if (userRow != null)
                {
                    PopulateUserFields(userRow);
                    txtUserId.SelectAll();

                    btnRent.Enabled = true;
                }
                // clean the text controls for user, disable rent button
                else
                {
                    txtSurname.Text = "";
                    txtName.Text    = "";
                    txtPhone.Text   = "";
                    txtEmail.Text   = "";

                    btnRent.Enabled = false;
                }
            }
        }
Exemple #2
0
 /*
  * Populates user fields with data from userRow
  */
 private void PopulateUserFields(LibrarianDS.userRow userRow)
 {
     txtUserId.Text  = userRow.id.ToString();
     txtSurname.Text = userRow.surname;
     txtName.Text    = userRow.name;
     txtPhone.Text   = userRow.phone;
     txtEmail.Text   = userRow.email;
 }
Exemple #3
0
        public frmRent(LibrarianDS.rentRow rentRow)
        {
            InitializeComponent();

            this.rentRow = rentRow;
            this.bookRow = rentRow.tbl_bookRow;
            this.userRow = rentRow.userRow;

            btnRent.Text    = "Razduži";
            btnRent.Enabled = true;
        }
Exemple #4
0
        public frmRent(LibrarianDS.rentRow rentRow)
        {
            InitializeComponent();

            this.rentRow = rentRow;
            this.bookRow = rentRow.tbl_bookRow;
            this.userRow = rentRow.userRow;

            btnRent.Text = "Razduži";
            btnRent.Enabled = true;
        }