コード例 #1
0
        private void fillCatalogs(int what)
        {
            ICatalogs cts = Engine.db().catalogs();

            _breeds = cts.getBreeds();
            fillList(breed, _breeds, _rab.BreedID);
            _zones = cts.getZones();
            if (_rab.BirthPlace == 0)
            {
                if (_rab.Zone != 0)
                {
                    fillList(cbZone, _zones, _rab.Zone);
                }
#if !DEMO
            }
            else    //если кролик импортирован
            {
                ClientsList cl = Engine.db().GetClients();
                cbZone.Items.Add(cl.GetName(_rab.BirthPlace));
                cbZone.SelectedIndex = 0;
#endif
            }

            int    sx  = 0;
            String end = "";
            if (_rab.Sex == Rabbit.SexType.MALE)
            {
                sx = 1;
            }
            if (_rab.Sex == Rabbit.SexType.FEMALE)
            {
                end = "а";
                sx  = 2;
            }
            if (_rab.Group > 1)
            {
                end = "ы";
            }
            _surnames = cts.getSurNames(2, end);
            _secnames = cts.getSurNames(1, end);
            fillList(surname, _surnames, _rab.SurnameID);
            fillList(secname, _secnames, _rab.SecnameID);
            fillNames(sx);
        }