Beispiel #1
0
        void insertGrooming()
        {
            string  name  = string.Empty;
            decimal price = 0;

            name  = txtName.Text;
            price = Decimal.Parse(txtPrice.Text);

            Petsize size = dbController.petsizeMapper.getPetsizeFromName(cbSize.Text);

            if (!checkIfGroomingAlreadyExists(name))
            {
                grooming = new Grooming()
                {
                    Name = name
                };

                if (dbController.insertGrooming(grooming))
                {
                    grooming.Id = dbController.getGroomingIDFromName(grooming.Name);
                    dbController.insertGPP(grooming, size, price);
                }
            }
            else
            {
                dbController.insertGPP(grooming, size, price);
            }
        }