Ejemplo n.º 1
0
        internal static XmlDocument[] GetRabbitPlem(int rId)
        {
            XmlDocument[]   docs = new XmlDocument[7];
            RabNetEngRabbit r    = Engine.get().getRabbit(rId);

            docs[0] = ReportHelperExt.rabToXml(r, null);
            OneRabbit[] p1 = Engine.db().getParents(r.ID, r.Age);
            docs[1] = ReportHelperExt.rabToXml(null, p1[0]);
            docs[2] = ReportHelperExt.rabToXml(null, p1[1]);
            OneRabbit[] p2;
            if (p1[0] != null)
            {
                p2 = Engine.db().getParents(p1[0].ID, p1[0].Age);
            }
            else
            {
                p2 = new OneRabbit[] { null, null };
            }

            docs[3] = ReportHelperExt.rabToXml(null, p2[0]);
            docs[4] = ReportHelperExt.rabToXml(null, p2[1]);
            if (p1[1] != null)
            {
                p2 = Engine.db().getParents(p1[1].ID, p1[1].Age);
            }
            else
            {
                p2 = new OneRabbit[] { null, null };
            }

            docs[5] = ReportHelperExt.rabToXml(null, p2[0]);
            docs[6] = ReportHelperExt.rabToXml(null, p2[1]);

            return(docs);
        }
Ejemplo n.º 2
0
        public void PlaceSuckerTo(int mother)
        {
            RabNetEngRabbit mom_to = Engine.get().getRabbit(mother);

            _eng.logs().log(LogType.PLACE_SUCK, _id, mother, "", mom_to.AddressSmall);
            _eng.db().placeSucker(_id, mother);
        }
Ejemplo n.º 3
0
        /// <summary>
        /// Обьединить с группой
        /// </summary>
        /// <param name="rabto">ID кролика с которым объединить</param>
        public void CombineWidth(int rabto)
        {
            RabNetEngRabbit rab = Engine.get().getRabbit(rabto);    //+gambit

            _eng.logs().log(LogType.COMBINE, _id, rabto, AddressSmall, rab.AddressSmall, rab.FullName);
            _eng.db().combineGroups(_id, rabto);
        }
Ejemplo n.º 4
0
        /// <summary>
        /// Отделяет несколько кроликов от Текущей группы и создает новую группу
        /// </summary>
        /// <param name="count">Сколько кроликов в новой группе</param>
        /// <param name="farm">ID фермы</param>
        /// <param name="tier">Ярус</param>
        /// <param name="sec">Клетка</param>
        /// <returns></returns>
        public int Clone(int count, int farm, int tier, int sec)
        {
            if (Group <= count)
            {
                throw new ExBadCount();                 //todo вставил проверку на = , надо попроверять
            }
            int             nid = _eng.db().CloneRabbit(this.ID, count, this.Sex, this.ParentID);
            RabNetEngRabbit rab = Engine.get().getRabbit(nid);       //+gambit

            rab.ReplaceRabbit(farm, tier, sec, "");
            _eng.logs().log(LogType.CLONE_GROUP, _id, nid, AddressSmall, rab.AddressSmall, String.Format("{0:d} и {1:d}", Group - count, count));
            return(nid);
        }
Ejemplo n.º 5
0
        private void changeFucker_Click(object sender, EventArgs e)
        {
            if (lvFucks.SelectedItems.Count != 1)
            {
                return;
            }
            F**k     f  = lvFucks.SelectedItems[0].Tag as F**k;
            FuckForm mf = new FuckForm(_rab, f.PartnerId, false);

            if (mf.ShowDialog() == DialogResult.OK && mf.SelectedFucker != f.Id)
            {
                Engine.get().ChangeFucker(f, mf.SelectedFucker, mf.FuckDate);
            }
            cancelUnable();
            updateData();
        }
Ejemplo n.º 6
0
        public override void MakeReport()
        {
#if RELEASE || DEBUG
            PeriodForm dlg = new PeriodForm(this.MenuText);
            if (dlg.ShowDialog() == DialogResult.Cancel)
            {
                return;
            }

            Filters f = new Filters(Filters.MAKE_CANDIDATE, Engine.get().candidateAge(),
                                    Filters.MAKE_BRIDE, Engine.get().brideAge(),
                                    Filters.DATE_PERIOD, dlg.PeriodChar,
                                    Filters.DATE_VALUE, dlg.PeriodValue);
            string      s   = getSQL(f);
            XmlDocument doc = Engine.db().makeReport(s);

            ReportViewForm rvf = new ReportViewForm(MenuText, FileName, new XmlDocument[] { doc, dlg.GetXml() });
            rvf.ExcelEnabled = false;
            rvf.Show();
#endif
        }