Exemple #1
0
        private void RFIDanimalSearching_Tag(object sender, RFIDTagEventArgs e)
        {
            if (e.Tag != "")
            {
                myAnimal = myShelter.GetAnimal(e.Tag);
                if (myShelter.GetAnimal(e.Tag) != null)
                {
                    lbNoticeAnimalSearching.Visible = false;
                    gbAnimalInfo.Enabled            = true;
                    gbOwnerInfo.Enabled             = true;
                    btnAdopt.Enabled            = true;
                    btnClaim.Enabled            = true;
                    DateTimePicker_ACpn.Visible = true;

                    Animal a = myShelter.GetAnimal(e.Tag);
                    tbDescription_ACpn.Text       = a.Description;
                    tbLocationOfFinding_ACpn.Text = a.FoundLocation;
                    DateTimePicker_ACpn.Value     = a.BroughtInDate;
                    if (a is Cat)
                    {
                        lbExtraInfoTitle.Visible        = true;
                        tbExtraInfo_ACpn.Visible        = true;
                        rbCat_ACpn.Checked              = true;
                        btnUpdateExtraInfo_ACpn.Enabled = true;

                        tbExtraInfo_ACpn.Text = ((Cat)a).ExtraInfo;
                    }
                    else if (a is Dog)
                    {
                        lbLastWalkingDate_ACpn.Visible = true;
                        lbLastWDateTitle.Visible       = true;
                        rbDog_ACpn.Checked             = true;
                        btnWalk.Enabled = true;

                        lbLastWalkingDate_ACpn.Text = ((Dog)a).LastWalkingDate.ToString();
                    }
                }
                else
                {
                    MessageBox.Show("This animal is not existed!");
                }
                RFIDanimalSearching.Close();
            }
        }