943 lines
58 KiB
C#
943 lines
58 KiB
C#
using System;
|
|
using System.Collections.Generic;
|
|
using System.ComponentModel;
|
|
using System.Data;
|
|
using System.Drawing;
|
|
using System.Drawing.Printing;
|
|
using System.Linq;
|
|
using System.Security.Cryptography.X509Certificates;
|
|
using System.Security.Policy;
|
|
using System.Text;
|
|
using System.Threading.Tasks;
|
|
using System.Windows.Forms;
|
|
using System.Windows.Forms.VisualStyles;
|
|
using Newtonsoft.Json;
|
|
|
|
namespace Kindlebox
|
|
{
|
|
public partial class ViewPedigree : Form
|
|
{
|
|
|
|
//Rabbit IDs
|
|
public static Guid rootID, sireID, ssireID, sdamID, sssireID, ssdamID, sdsireID, sddamID, damID, dsireID, ddamID, dssireID, dsdamID, ddsireID, dddamID;
|
|
|
|
Rabbit root, sire, ssire, sdam, sssire, ssdam, sdsire, sddam, dam, dsire, ddam, dssire, dsdam, ddsire, dddam;
|
|
|
|
public bool unsavedChanges = false;
|
|
public static bool rabbitExists = false;
|
|
|
|
Bitmap memoryImage;
|
|
|
|
public ViewPedigree(Guid rabbitID)
|
|
{
|
|
InitializeComponent();
|
|
|
|
rootID = rabbitID;
|
|
|
|
}
|
|
|
|
private void ViewPedigree_Load(object sender, EventArgs e)
|
|
{
|
|
//Farm Info
|
|
lblFarmName.Text = Properties.Settings.Default.FarmName;
|
|
|
|
lblFarmAddress.Text = Properties.Settings.Default.FarmStreet + "\n" + Properties.Settings.Default.FarmCity + ", " + Properties.Settings.Default.FarmState + " " + Properties.Settings.Default.FarmZIP;
|
|
|
|
lblFarmPhone.Text = "Phone # " + Properties.Settings.Default.FarmPhone;
|
|
|
|
lblFarmWWW.Text = "Find us on the web: " + Properties.Settings.Default.FarmWWW;
|
|
|
|
// Start Pedigree
|
|
foreach (Rabbit r in RabbitList.rabbits)
|
|
{
|
|
if (r.RabbitID == rootID)
|
|
{
|
|
root = r.getRabbit(r.RabbitID);
|
|
|
|
sire = r.getSire(r.SireID);
|
|
dam = r.getDam(r.DamID);
|
|
|
|
sireID = r.SireID;
|
|
damID = r.DamID;
|
|
}
|
|
|
|
}
|
|
|
|
foreach (Rabbit r in RabbitList.rabbits)
|
|
{
|
|
if (r.RabbitID == sireID)
|
|
{
|
|
ssire = r.getSire(r.SireID);
|
|
sdam = r.getDam(r.DamID);
|
|
|
|
ssireID = r.SireID;
|
|
sdamID = r.DamID;
|
|
}
|
|
|
|
}
|
|
|
|
foreach (Rabbit r in RabbitList.rabbits)
|
|
{
|
|
if (r.RabbitID == ssireID)
|
|
{
|
|
sssire = r.getSire(r.SireID);
|
|
ssdam = r.getDam(r.DamID);
|
|
|
|
sssireID = r.SireID;
|
|
ssdamID = r.DamID;
|
|
}
|
|
|
|
}
|
|
|
|
foreach (Rabbit r in RabbitList.rabbits)
|
|
{
|
|
if (r.RabbitID == sdamID)
|
|
{
|
|
sdsire = r.getSire(r.SireID);
|
|
sddam = r.getDam(r.DamID);
|
|
|
|
sdsireID = r.SireID;
|
|
sddamID = r.DamID;
|
|
}
|
|
|
|
}
|
|
|
|
|
|
foreach (Rabbit r in RabbitList.rabbits)
|
|
{
|
|
if (r.RabbitID == damID)
|
|
{
|
|
dsire = r.getSire(r.SireID);
|
|
ddam = r.getDam(r.DamID);
|
|
|
|
dsireID = r.SireID;
|
|
ddamID = r.DamID;
|
|
}
|
|
|
|
}
|
|
|
|
foreach (Rabbit r in RabbitList.rabbits)
|
|
{
|
|
if (r.RabbitID == dsireID)
|
|
{
|
|
dssire = r.getSire(r.SireID);
|
|
dsdam = r.getDam(r.DamID);
|
|
|
|
dssireID = r.SireID;
|
|
dsdamID = r.DamID;
|
|
}
|
|
|
|
}
|
|
|
|
foreach (Rabbit r in RabbitList.rabbits)
|
|
{
|
|
if (r.RabbitID == ddamID)
|
|
{
|
|
ddsire = r.getSire(r.SireID);
|
|
dddam = r.getDam(r.DamID);
|
|
|
|
ddsireID = r.SireID;
|
|
dddamID = r.DamID;
|
|
}
|
|
|
|
}
|
|
|
|
/* -- fill in pedigree -- */
|
|
lblFarmNameRoot.Text = EscapeFarmName(root.FarmName) + "'s";
|
|
lblRabbitNameRoot.Text = root.RabbitName;
|
|
lblEarNumRoot.Text = "Ear#: " + root.EarNumber;
|
|
lblColorRoot.Text = "Color: " + root.Color;
|
|
lblRegNumRoot.Text = "Reg#: " + root.RegNumber;
|
|
lblGCNumRoot.Text = "GC#: " + root.GCNumber;
|
|
lblSexRoot.Text = root.Sex;
|
|
lblBirthdayRoot.Text = root.Birthday.ToString("MM-dd-yyyy");
|
|
lblWeightRoot.Text = "WT: " + root.Weight + " lbs";
|
|
|
|
lblFarmNameSire.Text = EscapeFarmName(sire.FarmName) + "'s";
|
|
lblRabbitNameSire.Text = sire.RabbitName;
|
|
lblEarNumSire.Text = "Ear#: " + sire.EarNumber;
|
|
lblColorSire.Text = "Color: " + sire.Color;
|
|
lblRegNumSire.Text = "Reg#: " + sire.RegNumber;
|
|
lblGCNumSire.Text = "GC#: " + sire.GCNumber;
|
|
lblSexSire.Text = sire.Sex;
|
|
lblBirthdaySire.Text = sire.Birthday.ToString("MM-dd-yyyy");
|
|
lblWeightSire.Text = "WT: " + sire.Weight + " lbs";
|
|
|
|
lblFarmNameSSire.Text = EscapeFarmName(ssire.FarmName) + "'s";
|
|
lblRabbitNameSSire.Text = ssire.RabbitName;
|
|
lblEarNumSSire.Text = "Ear#: " + ssire.EarNumber;
|
|
lblColorSSire.Text = "Color: " + ssire.Color;
|
|
lblRegNumSSire.Text = "Reg#: " + ssire.RegNumber;
|
|
lblGCNumSSire.Text = "GC#: " + ssire.GCNumber;
|
|
lblSexSSire.Text = ssire.Sex;
|
|
lblBirthdaySSire.Text = ssire.Birthday.ToString("MM-dd-yyyy");
|
|
lblWeightSSire.Text = "WT: " + ssire.Weight + " lbs";
|
|
|
|
lblFarmNameSSSire.Text = EscapeFarmName(sssire.FarmName) + "'s";
|
|
lblRabbitNameSSSire.Text = sssire.RabbitName;
|
|
lblEarNumSSSire.Text = "Ear#: " + sssire.EarNumber;
|
|
lblColorSSSire.Text = "Color: " + sssire.Color;
|
|
lblRegNumSSSire.Text = "Reg#: " + sssire.RegNumber;
|
|
lblGCNumSSSire.Text = "GC#: " + sssire.GCNumber;
|
|
lblSexSSSire.Text = sssire.Sex;
|
|
lblBirthdaySSSire.Text = sssire.Birthday.ToString("MM-dd-yyyy");
|
|
lblWeightSSSire.Text = "WT: " + sssire.Weight + " lbs";
|
|
|
|
lblFarmNameSSDam.Text = EscapeFarmName(ssdam.FarmName) + "'s";
|
|
lblRabbitNameSSDam.Text = ssdam.RabbitName;
|
|
lblEarNumSSDam.Text = "Ear#: " + ssdam.EarNumber;
|
|
lblColorSSDam.Text = "Color: " + ssdam.Color;
|
|
lblRegNumSSDam.Text = "Reg#: " + ssdam.RegNumber;
|
|
lblGCNumSSDam.Text = "GC#: " + ssdam.GCNumber;
|
|
lblSexSSDam.Text = ssdam.Sex;
|
|
lblBirthdaySSDam.Text = ssdam.Birthday.ToString("MM-dd-yyyy");
|
|
lblWeightSSDam.Text = "WT: " + ssdam.Weight + " lbs";
|
|
|
|
lblFarmNameSDam.Text = EscapeFarmName(sdam.FarmName) + "'s";
|
|
lblRabbitNameSDam.Text = sdam.RabbitName;
|
|
lblEarNumSDam.Text = "Ear#: " + sdam.EarNumber;
|
|
lblColorSDam.Text = "Color: " + sdam.Color;
|
|
lblRegNumSDam.Text = "Reg#: " + sdam.RegNumber;
|
|
lblGCNumSDam.Text = "GC#: " + sdam.GCNumber;
|
|
lblSexSDam.Text = sdam.Sex;
|
|
lblBirthdaySDam.Text = sdam.Birthday.ToString("MM-dd-yyyy");
|
|
lblWeightSDam.Text = "WT: " + sdam.Weight + " lbs";
|
|
|
|
lblFarmNameSDSire.Text = EscapeFarmName(sdsire.FarmName) + "'s";
|
|
lblRabbitNameSDSire.Text = sdsire.RabbitName;
|
|
lblEarNumSDSire.Text = "Ear#: " + sdsire.EarNumber;
|
|
lblColorSDSire.Text = "Color: " + sdsire.Color;
|
|
lblRegNumSDSire.Text = "Reg#: " + sdsire.RegNumber;
|
|
lblGCNumSDSire.Text = "GC#: " + sdsire.GCNumber;
|
|
lblSexSDSire.Text = sdsire.Sex;
|
|
lblBirthdaySDSire.Text = sdsire.Birthday.ToString("MM-dd-yyyy");
|
|
lblWeightSDSire.Text = "WT: " + sdsire.Weight + " lbs";
|
|
|
|
lblFarmNameSDDam.Text = EscapeFarmName(sddam.FarmName) + "'s";
|
|
lblRabbitNameSDDam.Text = sddam.RabbitName;
|
|
lblEarNumSDDam.Text = "Ear#: " + sddam.EarNumber;
|
|
lblColorSDDam.Text = "Color: " + sddam.Color;
|
|
lblRegNumSDDam.Text = "Reg#: " + sddam.RegNumber;
|
|
lblGCNumSDDam.Text = "GC#: " + sddam.GCNumber;
|
|
lblSexSDDam.Text = sddam.Sex;
|
|
lblBirthdaySDDam.Text = sddam.Birthday.ToString("MM-dd-yyyy");
|
|
lblWeightSDDam.Text = "WT: " + sddam.Weight + " lbs";
|
|
|
|
|
|
lblFarmNameDam.Text = EscapeFarmName(dam.FarmName) + "'s";
|
|
lblRabbitNameDam.Text = dam.RabbitName;
|
|
lblEarNumDam.Text = "Ear#: " + dam.EarNumber;
|
|
lblColorDam.Text = "Color: " + dam.Color;
|
|
lblRegNumDam.Text = "Reg#: " + dam.RegNumber;
|
|
lblGCNumDam.Text = "GC#: " + dam.GCNumber;
|
|
lblSexDam.Text = dam.Sex;
|
|
lblBirthdayDam.Text = dam.Birthday.ToString("MM-dd-yyyy");
|
|
lblWeightDam.Text = "WT: " + dam.Weight + " lbs";
|
|
|
|
lblFarmNameDSire.Text = EscapeFarmName(dsire.FarmName) + "'s";
|
|
lblRabbitNameDSire.Text = dsire.RabbitName;
|
|
lblEarNumDSire.Text = "Ear#: " + dsire.EarNumber;
|
|
lblColorDSire.Text = "Color: " + dsire.Color;
|
|
lblRegNumDSire.Text = "Reg#: " + dsire.RegNumber;
|
|
lblGCNumDSire.Text = "GC#: " + dsire.GCNumber;
|
|
lblSexDSire.Text = dsire.Sex;
|
|
lblBirthdayDSire.Text = dsire.Birthday.ToString("MM-dd-yyyy");
|
|
lblWeightDSire.Text = "WT: " + dsire.Weight + " lbs";
|
|
|
|
lblFarmNameDSSire.Text = EscapeFarmName(dssire.FarmName) + "'s";
|
|
lblRabbitNameDSSire.Text = dssire.RabbitName;
|
|
lblEarNumDSSire.Text = "Ear#: " + dssire.EarNumber;
|
|
lblColorDSSire.Text = "Color: " + dssire.Color;
|
|
lblRegNumDSSire.Text = "Reg#: " + dssire.RegNumber;
|
|
lblGCNumDSSire.Text = "GC#: " + dssire.GCNumber;
|
|
lblSexDSSire.Text = dssire.Sex;
|
|
lblBirthdayDSSire.Text = dssire.Birthday.ToString("MM-dd-yyyy");
|
|
lblWeightDSSire.Text = "WT: " + dssire.Weight + " lbs";
|
|
|
|
lblFarmNameDSDam.Text = EscapeFarmName(dsdam.FarmName) + "'s";
|
|
lblRabbitNameDSDam.Text = dsdam.RabbitName;
|
|
lblEarNumDSDam.Text = "Ear#: " + dsdam.EarNumber;
|
|
lblColorDSDam.Text = "Color: " + dsdam.Color;
|
|
lblRegNumDSDam.Text = "Reg#: " + dsdam.RegNumber;
|
|
lblGCNumDSDam.Text = "GC#: " + dsdam.GCNumber;
|
|
lblSexDSDam.Text = dsdam.Sex;
|
|
lblBirthdayDSDam.Text = dsdam.Birthday.ToString("MM-dd-yyyy");
|
|
lblWeightDSDam.Text = "WT: " + dsdam.Weight + " lbs";
|
|
|
|
lblFarmNameDDam.Text = EscapeFarmName(ddam.FarmName) + "'s";
|
|
lblRabbitNameDDam.Text = ddam.RabbitName;
|
|
lblEarNumDDam.Text = "Ear#: " + ddam.EarNumber;
|
|
lblColorDDam.Text = "Color: " + ddam.Color;
|
|
lblRegNumDDam.Text = "Reg#: " + ddam.RegNumber;
|
|
lblGCNumDDam.Text = "GC#: " + ddam.GCNumber;
|
|
lblSexDDam.Text = ddam.Sex;
|
|
lblBirthdayDDam.Text = ddam.Birthday.ToString("MM-dd-yyyy");
|
|
lblWeightDDam.Text = "WT: " + ddam.Weight + " lbs";
|
|
|
|
lblFarmNameDDSire.Text = EscapeFarmName(ddsire.FarmName) + "'s";
|
|
lblRabbitNameDDSire.Text = ddsire.RabbitName;
|
|
lblEarNumDDSire.Text = "Ear#: " + ddsire.EarNumber;
|
|
lblColorDDSire.Text = "Color: " + ddsire.Color;
|
|
lblRegNumDDSire.Text = "Reg#: " + ddsire.RegNumber;
|
|
lblGCNumDDSire.Text = "GC#: " + ddsire.GCNumber;
|
|
lblSexDDSire.Text = ddsire.Sex;
|
|
lblBirthdayDDSire.Text = ddsire.Birthday.ToString("MM-dd-yyyy");
|
|
lblWeightDDSire.Text = "WT: " + ddsire.Weight + " lbs";
|
|
|
|
lblFarmNameDDDam.Text = EscapeFarmName(dddam.FarmName) + "'s";
|
|
lblRabbitNameDDDam.Text = dddam.RabbitName;
|
|
lblEarNumDDDam.Text = "Ear#: " + dddam.EarNumber;
|
|
lblColorDDDam.Text = "Color: " + dddam.Color;
|
|
lblRegNumDDDam.Text = "Reg#: " + dddam.RegNumber;
|
|
lblGCNumDDDam.Text = "GC#: " + dddam.GCNumber;
|
|
lblSexDDDam.Text = dddam.Sex;
|
|
lblBirthdayDDDam.Text = dddam.Birthday.ToString("MM-dd-yyyy");
|
|
lblWeightDDDam.Text = "WT: " + dddam.Weight + " lbs";
|
|
|
|
}
|
|
|
|
//Check if there are unsaved changes before closing the window
|
|
private void ViewPedigree_FormClosing(object sender, FormClosingEventArgs e)
|
|
{
|
|
|
|
|
|
}
|
|
|
|
private void groupBox1_Enter(object sender, EventArgs e)
|
|
{
|
|
|
|
}
|
|
|
|
private void printDocument1_PrintPage(object sender, System.Drawing.Printing.PrintPageEventArgs e)
|
|
{
|
|
//e.Graphics.DrawImage(memoryImage, e.MarginBounds);
|
|
|
|
Pen blackPen = new Pen(Color.Black);
|
|
Brush blackBrush = new SolidBrush(Color.Black);
|
|
|
|
Font normal = new Font("Arial", 8.0f, FontStyle.Regular);
|
|
Font normalB = new Font("Arial", 8.0F, FontStyle.Bold);
|
|
Font large = new Font("Arial", 11.0f, FontStyle.Bold);
|
|
Font largeR = new Font("Arial", 11.0f, FontStyle.Regular);
|
|
Font xlarge = new Font("Arial", 14.0f, FontStyle.Bold);
|
|
Font small = new Font("Arial", 6.0f, FontStyle.Regular);
|
|
|
|
int x1 = 100;
|
|
int x1_5 = 150;
|
|
int x2 = 200;
|
|
int x3 = 300;
|
|
int x3_5 = 350;
|
|
|
|
|
|
/* -- Draw the boxes -- */
|
|
e.Graphics.DrawRectangle(blackPen, rabbitBoxViewRoot.Bounds.X, rabbitBoxViewRoot.Bounds.Y, rabbitBoxViewRoot.Bounds.Width - 100, rabbitBoxViewRoot.Bounds.Height - 40);
|
|
e.Graphics.DrawRectangle(blackPen, rabbitBoxViewSire.Bounds.X - 125, rabbitBoxViewSire.Bounds.Y, rabbitBoxViewSire.Bounds.Width - 100, rabbitBoxViewSire.Bounds.Height - 40);
|
|
e.Graphics.DrawRectangle(blackPen, rabbitBoxViewSSire.Bounds.X - 250, rabbitBoxViewSSire.Bounds.Y, rabbitBoxViewSSire.Bounds.Width - 100, rabbitBoxViewSSire.Bounds.Height - 40);
|
|
e.Graphics.DrawRectangle(blackPen, rabbitBoxViewSSSire.Bounds.X - 375, rabbitBoxViewSSSire.Bounds.Y, rabbitBoxViewSSSire.Bounds.Width - 150, rabbitBoxViewSSSire.Bounds.Height - 30);
|
|
e.Graphics.DrawRectangle(blackPen, rabbitBoxViewSSDam.Bounds.X - 375, rabbitBoxViewSSDam.Bounds.Y, rabbitBoxViewSSDam.Bounds.Width - 150, rabbitBoxViewSSDam.Bounds.Height - 30);
|
|
e.Graphics.DrawRectangle(blackPen, rabbitBoxViewSDam.Bounds.X - 250, rabbitBoxViewSDam.Bounds.Y, rabbitBoxViewSDam.Bounds.Width - 100, rabbitBoxViewSDam.Bounds.Height - 40);
|
|
e.Graphics.DrawRectangle(blackPen, rabbitBoxViewSDSire.Bounds.X - 375, rabbitBoxViewSDSire.Bounds.Y, rabbitBoxViewSDSire.Bounds.Width - 150, rabbitBoxViewSDSire.Bounds.Height - 30);
|
|
e.Graphics.DrawRectangle(blackPen, rabbitBoxViewSDDam.Bounds.X - 375, rabbitBoxViewSDDam.Bounds.Y, rabbitBoxViewSDDam.Bounds.Width - 150, rabbitBoxViewSDDam.Bounds.Height - 30);
|
|
|
|
e.Graphics.DrawRectangle(blackPen, rabbitBoxViewDam.Bounds.X - 125, rabbitBoxViewDam.Bounds.Y, rabbitBoxViewDam.Bounds.Width - 100, rabbitBoxViewDam.Bounds.Height - 40);
|
|
e.Graphics.DrawRectangle(blackPen, rabbitBoxViewDSire.Bounds.X - 250, rabbitBoxViewDSire.Bounds.Y, rabbitBoxViewDSire.Bounds.Width - 100, rabbitBoxViewDSire.Bounds.Height - 40);
|
|
e.Graphics.DrawRectangle(blackPen, rabbitBoxViewDSSire.Bounds.X - 375, rabbitBoxViewDSSire.Bounds.Y, rabbitBoxViewDSSire.Bounds.Width - 150, rabbitBoxViewDSSire.Bounds.Height - 30);
|
|
e.Graphics.DrawRectangle(blackPen, rabbitBoxViewDSDam.Bounds.X - 375, rabbitBoxViewDSDam.Bounds.Y, rabbitBoxViewDSDam.Bounds.Width - 150, rabbitBoxViewDSDam.Bounds.Height - 30);
|
|
e.Graphics.DrawRectangle(blackPen, rabbitBoxViewDDam.Bounds.X - 250, rabbitBoxViewDDam.Bounds.Y, rabbitBoxViewDDam.Bounds.Width - 100, rabbitBoxViewDDam.Bounds.Height - 40);
|
|
e.Graphics.DrawRectangle(blackPen, rabbitBoxViewDDSire.Bounds.X - 375, rabbitBoxViewDDSire.Bounds.Y, rabbitBoxViewDDSire.Bounds.Width - 150, rabbitBoxViewDDSire.Bounds.Height - 30);
|
|
e.Graphics.DrawRectangle(blackPen, rabbitBoxViewDDDam.Bounds.X - 375, rabbitBoxViewDDDam.Bounds.Y, rabbitBoxViewDDDam.Bounds.Width - 150, rabbitBoxViewDDDam.Bounds.Height - 30);
|
|
|
|
|
|
/* -- Draw the text -- */
|
|
foreach (Control g in this.Controls)
|
|
{
|
|
Type t = g.GetType();
|
|
|
|
if (t.Name == "GroupBox")
|
|
{
|
|
foreach (Control c in g.Controls)
|
|
{
|
|
|
|
if (c.Name.Contains("Root"))
|
|
{
|
|
switch (c.Name)
|
|
{
|
|
case string a when a.Contains("lblFarmName"):
|
|
e.Graphics.DrawString(EscapeFarmNamePrint(c.Text), normal, blackBrush, g.Bounds.X + c.Bounds.X - 5, g.Bounds.Y + c.Bounds.Y - 15);
|
|
break;
|
|
case string a when a.Contains("lblRabbitName"):
|
|
e.Graphics.DrawString(c.Text, large, blackBrush, g.Bounds.X + c.Bounds.X - 5, g.Bounds.Y + c.Bounds.Y - 20);
|
|
break;
|
|
case string a when a.Contains("lblEarNum"):
|
|
e.Graphics.DrawString(c.Text, normal, blackBrush, g.Bounds.X + c.Bounds.X - 5, g.Bounds.Y + c.Bounds.Y - 30);
|
|
break;
|
|
case string a when a.Contains("lblColor"):
|
|
e.Graphics.DrawString(c.Text, normal, blackBrush, g.Bounds.X + c.Bounds.X - 5, g.Bounds.Y + c.Bounds.Y - 35);
|
|
break;
|
|
case string a when a.Contains("lblRegNum"):
|
|
e.Graphics.DrawString(c.Text, normal, blackBrush, g.Bounds.X + c.Bounds.X - 5, g.Bounds.Y + c.Bounds.Y - 35);
|
|
break;
|
|
case string a when a.Contains("lblGCNum"):
|
|
e.Graphics.DrawString(c.Text, normal, blackBrush, g.Bounds.X + c.Bounds.X - 5, g.Bounds.Y + c.Bounds.Y - 35);
|
|
break;
|
|
case string a when a.Contains("lblSex"):
|
|
e.Graphics.DrawString(c.Text, normal, blackBrush, g.Bounds.X + c.Bounds.X - 60, g.Bounds.Y + c.Bounds.Y - 15);
|
|
break;
|
|
case string a when a.Contains("lblBirthday"):
|
|
e.Graphics.DrawString(c.Text, normal, blackBrush, g.Bounds.X + c.Bounds.X - 55, g.Bounds.Y + c.Bounds.Y - 12);
|
|
break;
|
|
case string a when a.Contains("lblWeight"):
|
|
e.Graphics.DrawString(c.Text, normal, blackBrush, g.Bounds.X + c.Bounds.X - 95, g.Bounds.Y + c.Bounds.Y - 20);
|
|
break;
|
|
}
|
|
}
|
|
else if (c.Name.Contains("DDSire"))
|
|
{
|
|
switch (c.Name)
|
|
{
|
|
case string a when a.Contains("lblFarmName"):
|
|
e.Graphics.DrawString(EscapeFarmNamePrint(c.Text), small, blackBrush, g.Bounds.X + c.Bounds.X - 380, g.Bounds.Y + c.Bounds.Y - 13);
|
|
break;
|
|
case string a when a.Contains("lblRabbitName"):
|
|
e.Graphics.DrawString(c.Text, normalB, blackBrush, g.Bounds.X + c.Bounds.X - 382, g.Bounds.Y + c.Bounds.Y - 20);
|
|
break;
|
|
case string a when a.Contains("lblEarNum"):
|
|
e.Graphics.DrawString(c.Text, small, blackBrush, g.Bounds.X + c.Bounds.X - 380, g.Bounds.Y + c.Bounds.Y - 23);
|
|
break;
|
|
case string a when a.Contains("lblColor"):
|
|
e.Graphics.DrawString(c.Text, small, blackBrush, g.Bounds.X + c.Bounds.X - 380, g.Bounds.Y + c.Bounds.Y - 28);
|
|
break;
|
|
case string a when a.Contains("lblRegNum"):
|
|
e.Graphics.DrawString(c.Text, small, blackBrush, g.Bounds.X + c.Bounds.X - 380, g.Bounds.Y + c.Bounds.Y - 25);
|
|
break;
|
|
case string a when a.Contains("lblGCNum"):
|
|
e.Graphics.DrawString(c.Text, small, blackBrush, g.Bounds.X + c.Bounds.X - 380, g.Bounds.Y + c.Bounds.Y - 25);
|
|
break;
|
|
case string a when a.Contains("lblSex"):
|
|
e.Graphics.DrawString(c.Text, small, blackBrush, g.Bounds.X + c.Bounds.X - 480, g.Bounds.Y + c.Bounds.Y - 8);
|
|
break;
|
|
case string a when a.Contains("lblBirthday"):
|
|
e.Graphics.DrawString(c.Text, small, blackBrush, g.Bounds.X + c.Bounds.X - 465, g.Bounds.Y + c.Bounds.Y - 8);
|
|
break;
|
|
case string a when a.Contains("lblWeight"):
|
|
e.Graphics.DrawString(c.Text, small, blackBrush, g.Bounds.X + c.Bounds.X - 510, g.Bounds.Y + c.Bounds.Y - 20);
|
|
break;
|
|
}
|
|
}
|
|
else if (c.Name.Contains("SDSire"))
|
|
{
|
|
switch (c.Name)
|
|
{
|
|
case string a when a.Contains("lblFarmName"):
|
|
e.Graphics.DrawString(EscapeFarmNamePrint(c.Text), small, blackBrush, g.Bounds.X + c.Bounds.X - 380, g.Bounds.Y + c.Bounds.Y - 13);
|
|
break;
|
|
case string a when a.Contains("lblRabbitName"):
|
|
e.Graphics.DrawString(c.Text, normalB, blackBrush, g.Bounds.X + c.Bounds.X - 382, g.Bounds.Y + c.Bounds.Y - 20);
|
|
break;
|
|
case string a when a.Contains("lblEarNum"):
|
|
e.Graphics.DrawString(c.Text, small, blackBrush, g.Bounds.X + c.Bounds.X - 380, g.Bounds.Y + c.Bounds.Y - 23);
|
|
break;
|
|
case string a when a.Contains("lblColor"):
|
|
e.Graphics.DrawString(c.Text, small, blackBrush, g.Bounds.X + c.Bounds.X - 380, g.Bounds.Y + c.Bounds.Y - 28);
|
|
break;
|
|
case string a when a.Contains("lblRegNum"):
|
|
e.Graphics.DrawString(c.Text, small, blackBrush, g.Bounds.X + c.Bounds.X - 380, g.Bounds.Y + c.Bounds.Y - 25);
|
|
break;
|
|
case string a when a.Contains("lblGCNum"):
|
|
e.Graphics.DrawString(c.Text, small, blackBrush, g.Bounds.X + c.Bounds.X - 380, g.Bounds.Y + c.Bounds.Y - 25);
|
|
break;
|
|
case string a when a.Contains("lblSex"):
|
|
e.Graphics.DrawString(c.Text, small, blackBrush, g.Bounds.X + c.Bounds.X - 480, g.Bounds.Y + c.Bounds.Y - 8);
|
|
break;
|
|
case string a when a.Contains("lblBirthday"):
|
|
e.Graphics.DrawString(c.Text, small, blackBrush, g.Bounds.X + c.Bounds.X - 465, g.Bounds.Y + c.Bounds.Y - 8);
|
|
break;
|
|
case string a when a.Contains("lblWeight"):
|
|
e.Graphics.DrawString(c.Text, small, blackBrush, g.Bounds.X + c.Bounds.X - 510, g.Bounds.Y + c.Bounds.Y - 20);
|
|
break;
|
|
}
|
|
}
|
|
else if (c.Name.Contains("DSire"))
|
|
{
|
|
switch (c.Name)
|
|
{
|
|
case string a when a.Contains("lblFarmName"):
|
|
e.Graphics.DrawString(EscapeFarmNamePrint(c.Text), normal, blackBrush, g.Bounds.X + c.Bounds.X - 254, g.Bounds.Y + c.Bounds.Y - 15);
|
|
break;
|
|
case string a when a.Contains("lblRabbitName"):
|
|
e.Graphics.DrawString(c.Text, large, blackBrush, g.Bounds.X + c.Bounds.X - 254, g.Bounds.Y + c.Bounds.Y - 20);
|
|
break;
|
|
case string a when a.Contains("lblEarNum"):
|
|
e.Graphics.DrawString(c.Text, normal, blackBrush, g.Bounds.X + c.Bounds.X - 254, g.Bounds.Y + c.Bounds.Y - 30);
|
|
break;
|
|
case string a when a.Contains("lblColor"):
|
|
e.Graphics.DrawString(c.Text, normal, blackBrush, g.Bounds.X + c.Bounds.X - 254, g.Bounds.Y + c.Bounds.Y - 35);
|
|
break;
|
|
case string a when a.Contains("lblRegNum"):
|
|
e.Graphics.DrawString(c.Text, normal, blackBrush, g.Bounds.X + c.Bounds.X - 254, g.Bounds.Y + c.Bounds.Y - 35);
|
|
break;
|
|
case string a when a.Contains("lblGCNum"):
|
|
e.Graphics.DrawString(c.Text, normal, blackBrush, g.Bounds.X + c.Bounds.X - 254, g.Bounds.Y + c.Bounds.Y - 35);
|
|
break;
|
|
case string a when a.Contains("lblSex"):
|
|
e.Graphics.DrawString(c.Text, normal, blackBrush, g.Bounds.X + c.Bounds.X - 310, g.Bounds.Y + c.Bounds.Y - 15);
|
|
break;
|
|
case string a when a.Contains("lblBirthday"):
|
|
e.Graphics.DrawString(c.Text, normal, blackBrush, g.Bounds.X + c.Bounds.X - 305, g.Bounds.Y + c.Bounds.Y - 12);
|
|
break;
|
|
case string a when a.Contains("lblWeight"):
|
|
e.Graphics.DrawString(c.Text, normal, blackBrush, g.Bounds.X + c.Bounds.X - 345, g.Bounds.Y + c.Bounds.Y - 20);
|
|
break;
|
|
}
|
|
}
|
|
else if (c.Name.Contains("DSSire"))
|
|
{
|
|
switch (c.Name)
|
|
{
|
|
case string a when a.Contains("lblFarmName"):
|
|
e.Graphics.DrawString(EscapeFarmNamePrint(c.Text), small, blackBrush, g.Bounds.X + c.Bounds.X - 380, g.Bounds.Y + c.Bounds.Y - 13);
|
|
break;
|
|
case string a when a.Contains("lblRabbitName"):
|
|
e.Graphics.DrawString(c.Text, normalB, blackBrush, g.Bounds.X + c.Bounds.X - 382, g.Bounds.Y + c.Bounds.Y - 20);
|
|
break;
|
|
case string a when a.Contains("lblEarNum"):
|
|
e.Graphics.DrawString(c.Text, small, blackBrush, g.Bounds.X + c.Bounds.X - 380, g.Bounds.Y + c.Bounds.Y - 23);
|
|
break;
|
|
case string a when a.Contains("lblColor"):
|
|
e.Graphics.DrawString(c.Text, small, blackBrush, g.Bounds.X + c.Bounds.X - 380, g.Bounds.Y + c.Bounds.Y - 28);
|
|
break;
|
|
case string a when a.Contains("lblRegNum"):
|
|
e.Graphics.DrawString(c.Text, small, blackBrush, g.Bounds.X + c.Bounds.X - 380, g.Bounds.Y + c.Bounds.Y - 25);
|
|
break;
|
|
case string a when a.Contains("lblGCNum"):
|
|
e.Graphics.DrawString(c.Text, small, blackBrush, g.Bounds.X + c.Bounds.X - 380, g.Bounds.Y + c.Bounds.Y - 25);
|
|
break;
|
|
case string a when a.Contains("lblSex"):
|
|
e.Graphics.DrawString(c.Text, small, blackBrush, g.Bounds.X + c.Bounds.X - 480, g.Bounds.Y + c.Bounds.Y - 8);
|
|
break;
|
|
case string a when a.Contains("lblBirthday"):
|
|
e.Graphics.DrawString(c.Text, small, blackBrush, g.Bounds.X + c.Bounds.X - 465, g.Bounds.Y + c.Bounds.Y - 8);
|
|
break;
|
|
case string a when a.Contains("lblWeight"):
|
|
e.Graphics.DrawString(c.Text, small, blackBrush, g.Bounds.X + c.Bounds.X - 510, g.Bounds.Y + c.Bounds.Y - 20);
|
|
break;
|
|
}
|
|
}
|
|
else if (c.Name.Contains("SSSire"))
|
|
{
|
|
switch (c.Name)
|
|
{
|
|
case string a when a.Contains("lblFarmName"):
|
|
e.Graphics.DrawString(EscapeFarmNamePrint(c.Text), small, blackBrush, g.Bounds.X + c.Bounds.X - 380, g.Bounds.Y + c.Bounds.Y - 13);
|
|
break;
|
|
case string a when a.Contains("lblRabbitName"):
|
|
e.Graphics.DrawString(c.Text, normalB, blackBrush, g.Bounds.X + c.Bounds.X - 382, g.Bounds.Y + c.Bounds.Y - 20);
|
|
break;
|
|
case string a when a.Contains("lblEarNum"):
|
|
e.Graphics.DrawString(c.Text, small, blackBrush, g.Bounds.X + c.Bounds.X - 380, g.Bounds.Y + c.Bounds.Y - 23);
|
|
break;
|
|
case string a when a.Contains("lblColor"):
|
|
e.Graphics.DrawString(c.Text, small, blackBrush, g.Bounds.X + c.Bounds.X - 380, g.Bounds.Y + c.Bounds.Y - 28);
|
|
break;
|
|
case string a when a.Contains("lblRegNum"):
|
|
e.Graphics.DrawString(c.Text, small, blackBrush, g.Bounds.X + c.Bounds.X - 380, g.Bounds.Y + c.Bounds.Y - 25);
|
|
break;
|
|
case string a when a.Contains("lblGCNum"):
|
|
e.Graphics.DrawString(c.Text, small, blackBrush, g.Bounds.X + c.Bounds.X - 380, g.Bounds.Y + c.Bounds.Y - 25);
|
|
break;
|
|
case string a when a.Contains("lblSex"):
|
|
e.Graphics.DrawString(c.Text, small, blackBrush, g.Bounds.X + c.Bounds.X - 480, g.Bounds.Y + c.Bounds.Y - 8);
|
|
break;
|
|
case string a when a.Contains("lblBirthday"):
|
|
e.Graphics.DrawString(c.Text, small, blackBrush, g.Bounds.X + c.Bounds.X - 465, g.Bounds.Y + c.Bounds.Y - 8);
|
|
break;
|
|
case string a when a.Contains("lblWeight"):
|
|
e.Graphics.DrawString(c.Text, small, blackBrush, g.Bounds.X + c.Bounds.X - 510, g.Bounds.Y + c.Bounds.Y - 20);
|
|
break;
|
|
}
|
|
}
|
|
else if (c.Name.Contains("SSire"))
|
|
{
|
|
switch (c.Name)
|
|
{
|
|
case string a when a.Contains("lblFarmName"):
|
|
e.Graphics.DrawString(EscapeFarmNamePrint(c.Text), normal, blackBrush, g.Bounds.X + c.Bounds.X - 254, g.Bounds.Y + c.Bounds.Y - 15);
|
|
break;
|
|
case string a when a.Contains("lblRabbitName"):
|
|
e.Graphics.DrawString(c.Text, large, blackBrush, g.Bounds.X + c.Bounds.X - 254, g.Bounds.Y + c.Bounds.Y - 20);
|
|
break;
|
|
case string a when a.Contains("lblEarNum"):
|
|
e.Graphics.DrawString(c.Text, normal, blackBrush, g.Bounds.X + c.Bounds.X - 254, g.Bounds.Y + c.Bounds.Y - 30);
|
|
break;
|
|
case string a when a.Contains("lblColor"):
|
|
e.Graphics.DrawString(c.Text, normal, blackBrush, g.Bounds.X + c.Bounds.X - 254, g.Bounds.Y + c.Bounds.Y - 35);
|
|
break;
|
|
case string a when a.Contains("lblRegNum"):
|
|
e.Graphics.DrawString(c.Text, normal, blackBrush, g.Bounds.X + c.Bounds.X - 254, g.Bounds.Y + c.Bounds.Y - 35);
|
|
break;
|
|
case string a when a.Contains("lblGCNum"):
|
|
e.Graphics.DrawString(c.Text, normal, blackBrush, g.Bounds.X + c.Bounds.X - 254, g.Bounds.Y + c.Bounds.Y - 35);
|
|
break;
|
|
case string a when a.Contains("lblSex"):
|
|
e.Graphics.DrawString(c.Text, normal, blackBrush, g.Bounds.X + c.Bounds.X - 308, g.Bounds.Y + c.Bounds.Y - 15);
|
|
break;
|
|
case string a when a.Contains("lblBirthday"):
|
|
e.Graphics.DrawString(c.Text, normal, blackBrush, g.Bounds.X + c.Bounds.X - 305, g.Bounds.Y + c.Bounds.Y - 12);
|
|
break;
|
|
case string a when a.Contains("lblWeight"):
|
|
e.Graphics.DrawString(c.Text, normal, blackBrush, g.Bounds.X + c.Bounds.X - 345, g.Bounds.Y + c.Bounds.Y - 20);
|
|
break;
|
|
}
|
|
}
|
|
else if (c.Name.Contains("Sire"))
|
|
{
|
|
switch (c.Name)
|
|
{
|
|
case string a when a.Contains("lblFarmName"):
|
|
e.Graphics.DrawString(EscapeFarmNamePrint(c.Text), normal, blackBrush, g.Bounds.X + c.Bounds.X - 130, g.Bounds.Y + c.Bounds.Y - 15);
|
|
break;
|
|
case string a when a.Contains("lblRabbitName"):
|
|
e.Graphics.DrawString(c.Text, large, blackBrush, g.Bounds.X + c.Bounds.X - 130, g.Bounds.Y + c.Bounds.Y - 20);
|
|
break;
|
|
case string a when a.Contains("lblEarNum"):
|
|
e.Graphics.DrawString(c.Text, normal, blackBrush, g.Bounds.X + c.Bounds.X - 130, g.Bounds.Y + c.Bounds.Y - 30);
|
|
break;
|
|
case string a when a.Contains("lblColor"):
|
|
e.Graphics.DrawString(c.Text, normal, blackBrush, g.Bounds.X + c.Bounds.X - 130, g.Bounds.Y + c.Bounds.Y - 35);
|
|
break;
|
|
case string a when a.Contains("lblRegNum"):
|
|
e.Graphics.DrawString(c.Text, normal, blackBrush, g.Bounds.X + c.Bounds.X - 130, g.Bounds.Y + c.Bounds.Y - 35);
|
|
break;
|
|
case string a when a.Contains("lblGCNum"):
|
|
e.Graphics.DrawString(c.Text, normal, blackBrush, g.Bounds.X + c.Bounds.X - 130, g.Bounds.Y + c.Bounds.Y - 35);
|
|
break;
|
|
case string a when a.Contains("lblSex"):
|
|
e.Graphics.DrawString(c.Text, normal, blackBrush, g.Bounds.X + c.Bounds.X - 185, g.Bounds.Y + c.Bounds.Y - 15);
|
|
break;
|
|
case string a when a.Contains("lblBirthday"):
|
|
e.Graphics.DrawString(c.Text, normal, blackBrush, g.Bounds.X + c.Bounds.X - 180, g.Bounds.Y + c.Bounds.Y - 12);
|
|
break;
|
|
case string a when a.Contains("lblWeight"):
|
|
e.Graphics.DrawString(c.Text, normal, blackBrush, g.Bounds.X + c.Bounds.X - 220, g.Bounds.Y + c.Bounds.Y - 20);
|
|
break;
|
|
}
|
|
}
|
|
else if (c.Name.Contains("DDDam"))
|
|
{
|
|
switch (c.Name)
|
|
{
|
|
case string a when a.Contains("lblFarmName"):
|
|
e.Graphics.DrawString(EscapeFarmNamePrint(c.Text), small, blackBrush, g.Bounds.X + c.Bounds.X - 380, g.Bounds.Y + c.Bounds.Y - 13);
|
|
break;
|
|
case string a when a.Contains("lblRabbitName"):
|
|
e.Graphics.DrawString(c.Text, normalB, blackBrush, g.Bounds.X + c.Bounds.X - 382, g.Bounds.Y + c.Bounds.Y - 20);
|
|
break;
|
|
case string a when a.Contains("lblEarNum"):
|
|
e.Graphics.DrawString(c.Text, small, blackBrush, g.Bounds.X + c.Bounds.X - 380, g.Bounds.Y + c.Bounds.Y - 23);
|
|
break;
|
|
case string a when a.Contains("lblColor"):
|
|
e.Graphics.DrawString(c.Text, small, blackBrush, g.Bounds.X + c.Bounds.X - 380, g.Bounds.Y + c.Bounds.Y - 28);
|
|
break;
|
|
case string a when a.Contains("lblRegNum"):
|
|
e.Graphics.DrawString(c.Text, small, blackBrush, g.Bounds.X + c.Bounds.X - 380, g.Bounds.Y + c.Bounds.Y - 25);
|
|
break;
|
|
case string a when a.Contains("lblGCNum"):
|
|
e.Graphics.DrawString(c.Text, small, blackBrush, g.Bounds.X + c.Bounds.X - 380, g.Bounds.Y + c.Bounds.Y - 25);
|
|
break;
|
|
case string a when a.Contains("lblSex"):
|
|
e.Graphics.DrawString(c.Text, small, blackBrush, g.Bounds.X + c.Bounds.X - 480, g.Bounds.Y + c.Bounds.Y - 8);
|
|
break;
|
|
case string a when a.Contains("lblBirthday"):
|
|
e.Graphics.DrawString(c.Text, small, blackBrush, g.Bounds.X + c.Bounds.X - 465, g.Bounds.Y + c.Bounds.Y - 8);
|
|
break;
|
|
case string a when a.Contains("lblWeight"):
|
|
e.Graphics.DrawString(c.Text, small, blackBrush, g.Bounds.X + c.Bounds.X - 510, g.Bounds.Y + c.Bounds.Y - 20);
|
|
break;
|
|
}
|
|
}
|
|
else if (c.Name.Contains("SDDam"))
|
|
{
|
|
switch (c.Name)
|
|
{
|
|
case string a when a.Contains("lblFarmName"):
|
|
e.Graphics.DrawString(EscapeFarmNamePrint(c.Text), small, blackBrush, g.Bounds.X + c.Bounds.X - 380, g.Bounds.Y + c.Bounds.Y - 13);
|
|
break;
|
|
case string a when a.Contains("lblRabbitName"):
|
|
e.Graphics.DrawString(c.Text, normalB, blackBrush, g.Bounds.X + c.Bounds.X - 382, g.Bounds.Y + c.Bounds.Y - 20);
|
|
break;
|
|
case string a when a.Contains("lblEarNum"):
|
|
e.Graphics.DrawString(c.Text, small, blackBrush, g.Bounds.X + c.Bounds.X - 380, g.Bounds.Y + c.Bounds.Y - 23);
|
|
break;
|
|
case string a when a.Contains("lblColor"):
|
|
e.Graphics.DrawString(c.Text, small, blackBrush, g.Bounds.X + c.Bounds.X - 380, g.Bounds.Y + c.Bounds.Y - 28);
|
|
break;
|
|
case string a when a.Contains("lblRegNum"):
|
|
e.Graphics.DrawString(c.Text, small, blackBrush, g.Bounds.X + c.Bounds.X - 380, g.Bounds.Y + c.Bounds.Y - 25);
|
|
break;
|
|
case string a when a.Contains("lblGCNum"):
|
|
e.Graphics.DrawString(c.Text, small, blackBrush, g.Bounds.X + c.Bounds.X - 380, g.Bounds.Y + c.Bounds.Y - 25);
|
|
break;
|
|
case string a when a.Contains("lblSex"):
|
|
e.Graphics.DrawString(c.Text, small, blackBrush, g.Bounds.X + c.Bounds.X - 480, g.Bounds.Y + c.Bounds.Y - 8);
|
|
break;
|
|
case string a when a.Contains("lblBirthday"):
|
|
e.Graphics.DrawString(c.Text, small, blackBrush, g.Bounds.X + c.Bounds.X - 465, g.Bounds.Y + c.Bounds.Y - 8);
|
|
break;
|
|
case string a when a.Contains("lblWeight"):
|
|
e.Graphics.DrawString(c.Text, small, blackBrush, g.Bounds.X + c.Bounds.X - 510, g.Bounds.Y + c.Bounds.Y - 20);
|
|
break;
|
|
}
|
|
}
|
|
else if (c.Name.Contains("DDam"))
|
|
{
|
|
switch (c.Name)
|
|
{
|
|
case string a when a.Contains("lblFarmName"):
|
|
e.Graphics.DrawString(EscapeFarmNamePrint(c.Text), normal, blackBrush, g.Bounds.X + c.Bounds.X - 254, g.Bounds.Y + c.Bounds.Y - 15);
|
|
break;
|
|
case string a when a.Contains("lblRabbitName"):
|
|
e.Graphics.DrawString(c.Text, large, blackBrush, g.Bounds.X + c.Bounds.X - 254, g.Bounds.Y + c.Bounds.Y - 20);
|
|
break;
|
|
case string a when a.Contains("lblEarNum"):
|
|
e.Graphics.DrawString(c.Text, normal, blackBrush, g.Bounds.X + c.Bounds.X - 254, g.Bounds.Y + c.Bounds.Y - 30);
|
|
break;
|
|
case string a when a.Contains("lblColor"):
|
|
e.Graphics.DrawString(c.Text, normal, blackBrush, g.Bounds.X + c.Bounds.X - 254, g.Bounds.Y + c.Bounds.Y - 35);
|
|
break;
|
|
case string a when a.Contains("lblRegNum"):
|
|
e.Graphics.DrawString(c.Text, normal, blackBrush, g.Bounds.X + c.Bounds.X - 254, g.Bounds.Y + c.Bounds.Y - 35);
|
|
break;
|
|
case string a when a.Contains("lblGCNum"):
|
|
e.Graphics.DrawString(c.Text, normal, blackBrush, g.Bounds.X + c.Bounds.X - 254, g.Bounds.Y + c.Bounds.Y - 35);
|
|
break;
|
|
case string a when a.Contains("lblSex"):
|
|
e.Graphics.DrawString(c.Text, normal, blackBrush, g.Bounds.X + c.Bounds.X - 310, g.Bounds.Y + c.Bounds.Y - 15);
|
|
break;
|
|
case string a when a.Contains("lblBirthday"):
|
|
e.Graphics.DrawString(c.Text, normal, blackBrush, g.Bounds.X + c.Bounds.X - 305, g.Bounds.Y + c.Bounds.Y - 12);
|
|
break;
|
|
case string a when a.Contains("lblWeight"):
|
|
e.Graphics.DrawString(c.Text, normal, blackBrush, g.Bounds.X + c.Bounds.X - 345, g.Bounds.Y + c.Bounds.Y - 20);
|
|
break;
|
|
}
|
|
}
|
|
else if (c.Name.Contains("DSDam"))
|
|
{
|
|
switch (c.Name)
|
|
{
|
|
case string a when a.Contains("lblFarmName"):
|
|
e.Graphics.DrawString(EscapeFarmNamePrint(c.Text), small, blackBrush, g.Bounds.X + c.Bounds.X - 380, g.Bounds.Y + c.Bounds.Y - 13);
|
|
break;
|
|
case string a when a.Contains("lblRabbitName"):
|
|
e.Graphics.DrawString(c.Text, normalB, blackBrush, g.Bounds.X + c.Bounds.X - 382, g.Bounds.Y + c.Bounds.Y - 20);
|
|
break;
|
|
case string a when a.Contains("lblEarNum"):
|
|
e.Graphics.DrawString(c.Text, small, blackBrush, g.Bounds.X + c.Bounds.X - 380, g.Bounds.Y + c.Bounds.Y - 23);
|
|
break;
|
|
case string a when a.Contains("lblColor"):
|
|
e.Graphics.DrawString(c.Text, small, blackBrush, g.Bounds.X + c.Bounds.X - 380, g.Bounds.Y + c.Bounds.Y - 28);
|
|
break;
|
|
case string a when a.Contains("lblRegNum"):
|
|
e.Graphics.DrawString(c.Text, small, blackBrush, g.Bounds.X + c.Bounds.X - 380, g.Bounds.Y + c.Bounds.Y - 25);
|
|
break;
|
|
case string a when a.Contains("lblGCNum"):
|
|
e.Graphics.DrawString(c.Text, small, blackBrush, g.Bounds.X + c.Bounds.X - 380, g.Bounds.Y + c.Bounds.Y - 25);
|
|
break;
|
|
case string a when a.Contains("lblSex"):
|
|
e.Graphics.DrawString(c.Text, small, blackBrush, g.Bounds.X + c.Bounds.X - 480, g.Bounds.Y + c.Bounds.Y - 8);
|
|
break;
|
|
case string a when a.Contains("lblBirthday"):
|
|
e.Graphics.DrawString(c.Text, small, blackBrush, g.Bounds.X + c.Bounds.X - 465, g.Bounds.Y + c.Bounds.Y - 8);
|
|
break;
|
|
case string a when a.Contains("lblWeight"):
|
|
e.Graphics.DrawString(c.Text, small, blackBrush, g.Bounds.X + c.Bounds.X - 510, g.Bounds.Y + c.Bounds.Y - 20);
|
|
break;
|
|
}
|
|
}
|
|
else if (c.Name.Contains("SSDam"))
|
|
{
|
|
switch (c.Name)
|
|
{
|
|
case string a when a.Contains("lblFarmName"):
|
|
e.Graphics.DrawString(EscapeFarmNamePrint(c.Text), small, blackBrush, g.Bounds.X + c.Bounds.X - 380, g.Bounds.Y + c.Bounds.Y - 13);
|
|
break;
|
|
case string a when a.Contains("lblRabbitName"):
|
|
e.Graphics.DrawString(c.Text, normalB, blackBrush, g.Bounds.X + c.Bounds.X - 382, g.Bounds.Y + c.Bounds.Y - 20);
|
|
break;
|
|
case string a when a.Contains("lblEarNum"):
|
|
e.Graphics.DrawString(c.Text, small, blackBrush, g.Bounds.X + c.Bounds.X - 380, g.Bounds.Y + c.Bounds.Y - 23);
|
|
break;
|
|
case string a when a.Contains("lblColor"):
|
|
e.Graphics.DrawString(c.Text, small, blackBrush, g.Bounds.X + c.Bounds.X - 380, g.Bounds.Y + c.Bounds.Y - 28);
|
|
break;
|
|
case string a when a.Contains("lblRegNum"):
|
|
e.Graphics.DrawString(c.Text, small, blackBrush, g.Bounds.X + c.Bounds.X - 380, g.Bounds.Y + c.Bounds.Y - 25);
|
|
break;
|
|
case string a when a.Contains("lblGCNum"):
|
|
e.Graphics.DrawString(c.Text, small, blackBrush, g.Bounds.X + c.Bounds.X - 380, g.Bounds.Y + c.Bounds.Y - 25);
|
|
break;
|
|
case string a when a.Contains("lblSex"):
|
|
e.Graphics.DrawString(c.Text, small, blackBrush, g.Bounds.X + c.Bounds.X - 480, g.Bounds.Y + c.Bounds.Y - 8);
|
|
break;
|
|
case string a when a.Contains("lblBirthday"):
|
|
e.Graphics.DrawString(c.Text, small, blackBrush, g.Bounds.X + c.Bounds.X - 465, g.Bounds.Y + c.Bounds.Y - 8);
|
|
break;
|
|
case string a when a.Contains("lblWeight"):
|
|
e.Graphics.DrawString(c.Text, small, blackBrush, g.Bounds.X + c.Bounds.X - 510, g.Bounds.Y + c.Bounds.Y - 20);
|
|
break;
|
|
}
|
|
}
|
|
else if (c.Name.Contains("SDam"))
|
|
{
|
|
switch (c.Name)
|
|
{
|
|
case string a when a.Contains("lblFarmName"):
|
|
e.Graphics.DrawString(EscapeFarmNamePrint(c.Text), normal, blackBrush, g.Bounds.X + c.Bounds.X - 254, g.Bounds.Y + c.Bounds.Y - 15);
|
|
break;
|
|
case string a when a.Contains("lblRabbitName"):
|
|
e.Graphics.DrawString(c.Text, large, blackBrush, g.Bounds.X + c.Bounds.X - 254, g.Bounds.Y + c.Bounds.Y - 20);
|
|
break;
|
|
case string a when a.Contains("lblEarNum"):
|
|
e.Graphics.DrawString(c.Text, normal, blackBrush, g.Bounds.X + c.Bounds.X - 254, g.Bounds.Y + c.Bounds.Y - 30);
|
|
break;
|
|
case string a when a.Contains("lblColor"):
|
|
e.Graphics.DrawString(c.Text, normal, blackBrush, g.Bounds.X + c.Bounds.X - 254, g.Bounds.Y + c.Bounds.Y - 35);
|
|
break;
|
|
case string a when a.Contains("lblRegNum"):
|
|
e.Graphics.DrawString(c.Text, normal, blackBrush, g.Bounds.X + c.Bounds.X - 254, g.Bounds.Y + c.Bounds.Y - 35);
|
|
break;
|
|
case string a when a.Contains("lblGCNum"):
|
|
e.Graphics.DrawString(c.Text, normal, blackBrush, g.Bounds.X + c.Bounds.X - 254, g.Bounds.Y + c.Bounds.Y - 35);
|
|
break;
|
|
case string a when a.Contains("lblSex"):
|
|
e.Graphics.DrawString(c.Text, normal, blackBrush, g.Bounds.X + c.Bounds.X - 308, g.Bounds.Y + c.Bounds.Y - 15);
|
|
break;
|
|
case string a when a.Contains("lblBirthday"):
|
|
e.Graphics.DrawString(c.Text, normal, blackBrush, g.Bounds.X + c.Bounds.X - 305, g.Bounds.Y + c.Bounds.Y - 12);
|
|
break;
|
|
case string a when a.Contains("lblWeight"):
|
|
e.Graphics.DrawString(c.Text, normal, blackBrush, g.Bounds.X + c.Bounds.X - 345, g.Bounds.Y + c.Bounds.Y - 20);
|
|
break;
|
|
}
|
|
}
|
|
else if (c.Name.Contains("Dam"))
|
|
{
|
|
switch (c.Name)
|
|
{
|
|
case string a when a.Contains("lblFarmName"):
|
|
e.Graphics.DrawString(EscapeFarmNamePrint(c.Text), normal, blackBrush, g.Bounds.X + c.Bounds.X - 130, g.Bounds.Y + c.Bounds.Y - 15);
|
|
break;
|
|
case string a when a.Contains("lblRabbitName"):
|
|
e.Graphics.DrawString(c.Text, large, blackBrush, g.Bounds.X + c.Bounds.X - 130, g.Bounds.Y + c.Bounds.Y - 20);
|
|
break;
|
|
case string a when a.Contains("lblEarNum"):
|
|
e.Graphics.DrawString(c.Text, normal, blackBrush, g.Bounds.X + c.Bounds.X - 130, g.Bounds.Y + c.Bounds.Y - 30);
|
|
break;
|
|
case string a when a.Contains("lblColor"):
|
|
e.Graphics.DrawString(c.Text, normal, blackBrush, g.Bounds.X + c.Bounds.X - 130, g.Bounds.Y + c.Bounds.Y - 35);
|
|
break;
|
|
case string a when a.Contains("lblRegNum"):
|
|
e.Graphics.DrawString(c.Text, normal, blackBrush, g.Bounds.X + c.Bounds.X - 130, g.Bounds.Y + c.Bounds.Y - 35);
|
|
break;
|
|
case string a when a.Contains("lblGCNum"):
|
|
e.Graphics.DrawString(c.Text, normal, blackBrush, g.Bounds.X + c.Bounds.X - 130, g.Bounds.Y + c.Bounds.Y - 35);
|
|
break;
|
|
case string a when a.Contains("lblSex"):
|
|
e.Graphics.DrawString(c.Text, normal, blackBrush, g.Bounds.X + c.Bounds.X - 185, g.Bounds.Y + c.Bounds.Y - 15);
|
|
break;
|
|
case string a when a.Contains("lblBirthday"):
|
|
e.Graphics.DrawString(c.Text, normal, blackBrush, g.Bounds.X + c.Bounds.X - 180, g.Bounds.Y + c.Bounds.Y - 12);
|
|
break;
|
|
case string a when a.Contains("lblWeight"):
|
|
e.Graphics.DrawString(c.Text, normal, blackBrush, g.Bounds.X + c.Bounds.X - 220, g.Bounds.Y + c.Bounds.Y - 20);
|
|
break;
|
|
}
|
|
}
|
|
}
|
|
}
|
|
else if (t.Name == "Label" && g.Name == "lblFarmName") //Print Farm Name
|
|
{
|
|
e.Graphics.DrawString(g.Text, xlarge, blackBrush, 10, 10);
|
|
}
|
|
else if (t.Name == "Label" && g.Name == "lblFarmAddress") //Print Address
|
|
{
|
|
e.Graphics.DrawString(g.Text, largeR, blackBrush, 10, 35);
|
|
}
|
|
else if (t.Name == "Label" && g.Name == "lblFarmPhone") //Print Phone
|
|
{
|
|
e.Graphics.DrawString(g.Text, largeR, blackBrush, 10, 68);
|
|
}
|
|
else if (t.Name == "Label" && g.Name == "lblFarmWWW") //Print WWW
|
|
{
|
|
e.Graphics.DrawString(g.Text, largeR, blackBrush, 10, 82);
|
|
}
|
|
else if (t.Name == "Label" && g.Name == "lblCertification")
|
|
{
|
|
e.Graphics.DrawString(g.Text, normal, blackBrush, 10, 750);
|
|
}
|
|
else if (t.Name == "Label" && g.Name == "lblSigned")
|
|
{
|
|
e.Graphics.DrawString(g.Text, normal, blackBrush, 10, 780);
|
|
e.Graphics.DrawLine(blackPen, 80, 800, 300, 800);
|
|
}
|
|
}
|
|
}
|
|
|
|
private void btnPrint_Click(object sender, EventArgs e)
|
|
{
|
|
|
|
Margins margins = new Margins(10, 10, 100, 100);
|
|
|
|
Panel panel = new Panel();
|
|
this.Controls.Add(panel);
|
|
|
|
Graphics graphics = panel.CreateGraphics();
|
|
Size size = this.ClientSize;
|
|
memoryImage = new Bitmap(size.Width, size.Height, graphics);
|
|
graphics = Graphics.FromImage(memoryImage);
|
|
|
|
Point point = PointToScreen(panel.Location);
|
|
graphics.CopyFromScreen(point.X, point.Y, 0, 0, size);
|
|
|
|
printDocument1.DefaultPageSettings.Landscape = true;
|
|
printDocument1.DefaultPageSettings.Margins = margins;
|
|
|
|
//printPreviewDialog1.Document = printDocument1;
|
|
//printPreviewDialog1.ShowDialog();
|
|
|
|
printDialog1.AllowSomePages = true;
|
|
printDialog1.ShowHelp = true;
|
|
|
|
printDialog1.Document = printDocument1;
|
|
|
|
DialogResult result = printDialog1.ShowDialog();
|
|
|
|
if (result == DialogResult.OK)
|
|
{
|
|
printDocument1.Print();
|
|
}
|
|
|
|
}
|
|
|
|
private string EscapeFarmName(string farmName)
|
|
{
|
|
if (farmName.Contains("&"))
|
|
{
|
|
farmName = farmName.Replace("&", "&&");
|
|
}
|
|
|
|
return farmName;
|
|
}
|
|
|
|
private string EscapeFarmNamePrint(string farmName)
|
|
{
|
|
if (farmName.Contains("&&"))
|
|
{
|
|
farmName = farmName.Replace("&&", "&");
|
|
}
|
|
return farmName;
|
|
}
|
|
|
|
}
|
|
}
|