Beispiel #1
0
 private void addRoToDgv(RO ro)
 {
     object[] data = new object[7];
     data[0] = ro.getId();
     data[1] = ro.customer.name;
     data[2] = ro.bike.getMakeModel();
     data[3] = ro.dateIn.ToShortDateString();
     if (!ro.isCLosed())
     {
         data[4] = "n/a";
     }
     else
     {
         data[4] = ro.dateOut.ToShortDateString();
     }
     data[5] = ro.getSubTotal();
     data[6] = ro.getTotal();
     dgvRo.Rows.Add(data);
 }
Beispiel #2
0
        private void writeBottomArea(System.Drawing.Printing.PrintPageEventArgs e)
        {
            StringFormat format      = new StringFormat();
            Font         textFont    = new Font("Times New Roman", 14);
            Font         controlFont = new Font("Times New Roman", 14, FontStyle.Bold);

            format.Alignment   = StringAlignment.Near;
            format.FormatFlags = StringFormatFlags.FitBlackBox;
            float offset = 0;


            textFont = new Font("Times New Roman", 12);

            format.Alignment = StringAlignment.Far;
            SizeF      field     = e.Graphics.MeasureString("Gas/Oil/Greas", textFont);
            RectangleF valueArea = new RectangleF(bottomArea.Right - field.Width, bottomArea.Top, field.Width, field.Height);
            RectangleF infoArea  = new RectangleF(valueArea.Left - field.Width, bottomArea.Top, field.Width, field.Height);

            drawTextToCurrentPosition(e, "Total Labor:", textFont, ref offset, infoArea, format);
            offset = 0;
            drawTextToCurrentPosition(e, "$" + currentRo.getTotalLabor().ToString(), textFont, ref offset, valueArea, format);
            offset = 0;
            moveDown(ref valueArea);
            moveDown(ref infoArea);
            drawTextToCurrentPosition(e, "Total Parts:", textFont, ref offset, infoArea, format);
            offset = 0;
            drawTextToCurrentPosition(e, "$" + currentRo.getTotalPartsPrice().ToString(), textFont, ref offset, valueArea, format);
            offset = 0;
            moveDown(ref valueArea);
            moveDown(ref infoArea);
            drawTextToCurrentPosition(e, "Gas/Oil/Grease:", textFont, ref offset, infoArea, format);
            offset = 0;
            drawTextToCurrentPosition(e, "$" + currentRo.gasOilGreas.ToString(), textFont, ref offset, valueArea, format);
            offset = 0;
            moveDown(ref valueArea);
            moveDown(ref infoArea);
            drawTextToCurrentPosition(e, "EPA/Waste:", textFont, ref offset, infoArea, format);
            offset = 0;
            drawTextToCurrentPosition(e, "$" + currentRo.getTotalWaste().ToString(), textFont, ref offset, valueArea, format);
            offset = 0;
            moveDown(ref valueArea);
            moveDown(ref infoArea);
            drawTextToCurrentPosition(e, "Deposit:", textFont, ref offset, infoArea, format);
            offset = 0;
            drawTextToCurrentPosition(e, "$" + currentRo.deposit.ToString(), textFont, ref offset, valueArea, format);
            offset = 0;
            moveDown(ref valueArea);
            moveDown(ref infoArea);
            drawTextToCurrentPosition(e, "SubTotal:", textFont, ref offset, infoArea, format);
            offset = 0;
            drawTextToCurrentPosition(e, "$" + currentRo.getSubTotal().ToString(), textFont, ref offset, valueArea, format);
            offset = 0;
            moveDown(ref valueArea);
            moveDown(ref infoArea);
            drawTextToCurrentPosition(e, "Tax:", textFont, ref offset, infoArea, format);
            offset = 0;
            drawTextToCurrentPosition(e, "$" + currentRo.getTax().ToString(), textFont, ref offset, valueArea, format);
            offset = 0;
            moveDown(ref valueArea);
            moveDown(ref infoArea);
            drawTextToCurrentPosition(e, "Total:", controlFont, ref offset, infoArea, format);
            offset = 0;
            drawTextToCurrentPosition(e, "$" + currentRo.getTotal().ToString(), controlFont, ref offset, valueArea, format);
            offset = 0;
            moveDown(ref valueArea);
            moveDown(ref infoArea);
            drawTextToCurrentPosition(e, "Due:", controlFont, ref offset, infoArea, format);
            offset = 0;
            drawTextToCurrentPosition(e, "$" + currentRo.getDept().ToString(), controlFont, ref offset, valueArea, format);
            offset = 0;
            moveDown(ref valueArea);
            moveDown(ref infoArea);
        }