Esempio n. 1
0
        private void btnHobiAta_Click(object sender, EventArgs e)
        {
            HobbyDTO hobbyDTO = new HobbyDTO();

            hobbyDTO.HobbyName = lstCocukHobiler.GetItemText(lstCocukHobiler.SelectedItem);

            int hobbyID   = (int)lstCocukHobiler.SelectedValue;
            int haveHobby = _hc.HaveUserHobby(hobbyID);

            if (haveHobby > 0)
            {
                KisininHobileriniGuncelle();
                MessageBox.Show("Kayıt başarılı");
                return;
            }

            ArrayList arraylist = _uc.AddHobbytoUser(hobbyDTO, _userDTO);

            if ((bool)arraylist[0])
            {
                MessageBox.Show(arraylist[1].ToString());
                KisininHobileriniGuncelle();
            }
            else
            {
                MessageBox.Show(arraylist[1].ToString());
            }
        }