Пример #1
0
        private void tileView1_ItemDoubleClick(object sender, TileViewItemClickEventArgs e)
        {
            //  tileview에 있는 데이터를 가져온다.
            TileView view = e.Item.View;
            Pet      pet  = view.GetFocusedRow() as Pet;

            // as :  캐스팅 하는건데 대신에 얘가 값이 안맞으면 null을 반환해줘 맞으면 캐스팅 해줘 대신에 값타입은 안돼용
            if (pet == null)
            {
                return;
            }



            // 클릭히먄 옆에 디테일에 데이터 이동
            pictureEdit1.Image = ByteArrayToImage(pet.Picture);
            txeName.Text       = pet.Name;
            txeSpecies.Text    = pet.Species;
            txeAge.Text        = pet.Age.ToString();
            cbbeGender.Text    = pet.Gender;
            txbSize.Text       = pet.Size;
            txbWeight.Text     = pet.Weight.ToString();
            txbEtc.Text        = pet.ETC;

            if (pet.HasNeutralized == true)
            {
                cbHasNeutralized.CheckState = CheckState.Checked;
            }
            else
            {
                cbHasNeutralized.CheckState = CheckState.Unchecked;
            }


            if (pet.HasVaccinated == true)
            {
                cbHasVaccinated.CheckState = CheckState.Checked;
            }
            else
            {
                cbHasVaccinated.CheckState = CheckState.Unchecked;
            }
        }
Пример #2
0
        private void tileView2_ItemDoubleClick(object sender, TileViewItemClickEventArgs e)
        {
            TileView view = e.Item.View;

            Pet pet = view.GetFocusedRow() as Pet;

            if (pet == null)
            {
                return;
            }

            MessageBox.Show(pet.PetID.ToString());

            int petId = pet.PetID;

            ChangingPetInformationForm changingPetInformationForm = new ChangingPetInformationForm(petId);

            changingPetInformationForm.Show();
        }