private void svidMenuItem_Click(object sender, EventArgs e) { if (listView1.SelectedItems.Count != 1) { return; } XmlDocument[] docs = ReportHelperExt.GetRabbitPlem((listView1.SelectedItems[0].Tag as AdultRabbit).ID); ReportViewForm rf = new ReportViewForm(myReportType.RABBIT, docs); rf.ShowDialog(); if (rf.IsPrinted) { int num = Engine.opt().getIntOption(Options.OPT_ID.NEXT_SVID); Engine.opt().setOption(Options.OPT_ID.NEXT_SVID, num + 1); } }
private void plemMenuItem_Click(object sender, EventArgs e) { if (listView1.SelectedItems.Count < 1) { return; } try { XmlDocument doc = new XmlDocument(); doc.AppendChild(doc.CreateElement("Rows")); int cnt = 0; string brd = ""; foreach (ListViewItem li in listView1.SelectedItems) { RabNetEngRabbit r = Engine.get().getRabbit((li.Tag as AdultRabbit).ID); cnt += r.Group; if (brd == "") { brd = r.BreedName; } if (r.BreedName != brd) { brd = "none"; } ReportHelperExt.rabToXml(r, null, doc); } XmlDocument doc2 = new XmlDocument(); XmlElement rw = (XmlElement)doc2.AppendChild(doc2.CreateElement("Rows")).AppendChild(doc2.CreateElement("Row")); ReportHelper.Append(rw, doc2, "date", DateTime.Now.Date.ToShortDateString() + " " + DateTime.Now.ToLongTimeString()); ReportHelper.Append(rw, doc2, "breed", brd); ReportHelper.Append(rw, doc2, "count", cnt.ToString()); //rw.AppendChild(doc2.CreateElement("date")).AppendChild(doc2.CreateTextNode(DateTime.Now.Date.ToShortDateString()+" "+DateTime.Now.ToLongTimeString())); //rw.AppendChild(doc2.CreateElement("breed")).AppendChild(doc2.CreateTextNode(brd)); //rw.AppendChild(doc2.CreateElement("count")).AppendChild(doc2.CreateTextNode(cnt.ToString())); new ReportViewForm(myReportType.PRIDE, new XmlDocument[] { doc, doc2 }).ShowDialog(); } catch (Exception exc) { MessageBox.Show(exc.Message); _logger.Warn(exc); _rsb.Run(); } }