private void DgvManagers_RowHeaderMouseClick(object sender, DataGridViewCellMouseEventArgs e)//select the manager to updating or deactiving
        {
            BtnAdd.Hide();
            BtnUpdate.Show();
            BtnDeactive.Show();
            BtnCancel.Show();
            TxtPassword.Hide();
            LblPassword.Text = "New Password";
            LblComment.Show();
            TxtNewPassword.Show();
            int Id = Convert.ToInt32(DgvManagers.Rows[e.RowIndex].Cells[0].Value);

            _selectedManager = _managerService.Find(Id);

            //index of selected manager on datagridview
            _selectedIndex = e.RowIndex;
            //fill the selected manager information to the textboxes
            TxtName.Text     = _selectedManager.Name;
            TxtSurname.Text  = _selectedManager.Surname;
            TxtPhone.Text    = _selectedManager.Phone;
            TxtUsername.Text = _selectedManager.Username;
            if (_selectedManager.IsAdmin == true)
            {
                CmbPosition.SelectedIndex = 0;
                return;
            }
            CmbPosition.SelectedIndex = 1;
        }
 private void Reset()//reset the all changes on textboxes
 {
     TxtFullname.Text = string.Empty;
     TxtPhone.Text    = string.Empty;
     BtnAdd.Show();
     BtnDeactive.Hide();
     BtnUpdate.Hide();
     BtnCancel.Hide();
 }
 private void Reset()//reset the all changes on textboxes and numericupdown
 {
     TxtTitle.Text   = string.Empty;
     NumPrice.Value  = 0;
     TxtAuthor.Text  = string.Empty;
     NmrcCount.Value = 0;
     BtnAdd.Show();
     BtnDeactive.Hide();
     BtnUpdate.Hide();
     BtnCancel.Hide();
 }
        private void DgvClients_RowHeaderMouseClick(object sender, DataGridViewCellMouseEventArgs e)//select the client to updating or deactiving
        {
            BtnAdd.Hide();
            BtnUpdate.Show();
            BtnDeactive.Show();
            BtnCancel.Show();
            int Id = Convert.ToInt32(DgvClients.Rows[e.RowIndex].Cells[0].Value);

            //index of selected client on datagridview
            _selectedIndex  = e.RowIndex;
            _selectedClient = _clientService.Find(Id);
            //fill the selected client information to the textboxes
            TxtFullname.Text = _selectedClient.Fullname;
            TxtPhone.Text    = _selectedClient.Phone;
        }
        private void DgvBooks_RowHeaderMouseClick(object sender, DataGridViewCellMouseEventArgs e)//select the book to updating or deactiving
        {
            BtnAdd.Hide();
            BtnUpdate.Show();
            BtnDeactive.Show();
            BtnCancel.Show();
            int Id = Convert.ToInt32(DgvBooks.Rows[e.RowIndex].Cells[0].Value);

            _selectedBook = _bookService.Find(Id);
            //index of selected book on datagridview
            _SelectedIndex = e.RowIndex;
            //fill the selected book information to the textboxes
            TxtTitle.Text   = _selectedBook.Title;
            NumPrice.Value  = _selectedBook.Price;
            TxtAuthor.Text  = _selectedBook.Author;
            NmrcCount.Value = _selectedBook.Count;
        }
 private void Reset()//reset the all changes on textboxes
 {
     TxtName.Text             = string.Empty;
     TxtSurname.Text          = string.Empty;
     TxtPhone.Text            = string.Empty;
     TxtUsername.Text         = string.Empty;
     TxtPassword.Text         = string.Empty;
     TxtNewPassword.Text      = string.Empty;
     CmbPosition.SelectedItem = null;
     BtnAdd.Show();
     BtnDeactive.Hide();
     BtnUpdate.Hide();
     BtnCancel.Hide();
     TxtNewPassword.Hide();
     LblPassword.Text = "password";
     TxtPassword.Show();
     LblComment.Hide();
 }