void FillBackSideTextByDrawText(Graphics gr) { const int textMainMargin = 468; const int textMargin = textMainMargin + 41; const int textWidth = 450; GraphicsHelper.DrawText(gr, "9.", textMainMargin, 38); GraphicsHelper.DrawText(gr, YearOfManufacture.ToUpper(), textMargin, 38, textWidth); GraphicsHelper.DrawText(gr, "10.", textMainMargin, 88); GraphicsHelper.DrawText(gr, Type.ToUpper(), textMargin, 88, textWidth); GraphicsHelper.DrawText(gr, "11.", textMainMargin, 138); GraphicsHelper.DrawText(gr, VehicleIdentificationNumber.ToUpper(), textMargin, 138, textWidth); GraphicsHelper.DrawText(gr, "12.", textMainMargin, 190); GraphicsHelper.DrawText(gr, GrossWeight.ToString("n2"), textMargin, 190, textWidth); GraphicsHelper.DrawText(gr, "13.", textMainMargin, 242); GraphicsHelper.DrawText(gr, CurbWeight.ToString("n2"), textMargin, 242, textWidth); GraphicsHelper.DrawText(gr, "14.", textMainMargin, 293); GraphicsHelper.DrawText(gr, EngineNumber.ToUpper(), textMargin, 293, textWidth); GraphicsHelper.DrawText(gr, "15.", textMainMargin, 345); GraphicsHelper.DrawText(gr, EnginePower.ToUpper(), textMargin, 345, textWidth); GraphicsHelper.DrawText(gr, "16.", textMainMargin, 395); GraphicsHelper.DrawText(gr, FuelType.ToUpper(), textMargin, 395, textWidth); GraphicsHelper.DrawText(gr, "17.", textMainMargin, 448); GraphicsHelper.DrawText(gr, NumberOfSeats.ToSafeString(), textMargin, 448, textWidth); GraphicsHelper.DrawText(gr, "18.", textMainMargin, 499); GraphicsHelper.DrawText(gr, NumberOfStandees.ToSafeString(), textMargin, 499, textWidth); GraphicsHelper.DrawText(gr, "19.", textMainMargin, 549); GraphicsHelper.DrawText(gr, SpecialMarks.ToUpper(), textMargin, 549, textWidth); }
/// <summary> /// Routings the populate shipment line fields. /// </summary> /// <param name="schema">The schema.</param> /// <param name="parentShipment">The parent shipment.</param> public void RoutingPopulateShipmentLineFields(TextFieldCollection schema, TDCShipment parentShipment) { schema["Order"].Value = string.Concat(parentShipment.OpCoCode, "-", parentShipment.ShipmentNumber, "-", parentShipment.DespatchNumber); schema["LineCode"].Value = LineNumber.ToString(); schema["Product"].Value = ProductCode; schema["MaximumUnits"].Value = Quantity.ToString(); schema["MaximumWeight"].Value = GrossWeight.ToString("######0.##"); schema["MaximumVolume"].Value = Volume.ToString("###0.###"); schema["Width"].Value = Width.ToString();; schema["Length"].Value = Length.ToString(); }
public string Update() { NetWeight = GrossWeight - (LessTear + LessSample + LessDamage); RatePerQuintal = RatePerMound * (decimal)2.6792; RatePerQuintal = Math.Round((decimal)RatePerQuintal, 2, MidpointRounding.AwayFromZero); Amount = NetWeight * RatePerQuintal; if (Amount.HasValue) { Amount = Math.Round((decimal)Amount); } XDocument doc = XDocument.Load(@"Transactions.xml"); var record = from r in doc.Descendants("Transaction") where (int)r.Element("Serial") == Serial select r; foreach (XElement r in record) { r.Element("Seller").Value = Seller; r.Element("Bales").Value = Bales.ToString(); r.Element("Date").Value = XmlConvert.ToString(Date, XmlDateTimeSerializationMode.RoundtripKind); r.Element("Station").Value = Station; r.Element("Quality").Value = Quality; r.Element("RatePerMound").Value = RatePerMound.ToString(); r.Element("Condition").Value = Condition; r.Element("Broker").Value = Broker; r.Element("BrokeragePaid").Value = BrokeragePaid.ToString(); r.Element("PaymentDate").Value = PaymentDate.HasValue ? XmlConvert.ToString(PaymentDate.Value, XmlDateTimeSerializationMode.RoundtripKind) : ""; r.Element("Buyer").Value = Buyer; r.Element("PressSerialFrom").Value = PressSerialFrom; r.Element("PressSerialTo").Value = PressSerialTo; r.Element("PressMark").Value = PressMark; r.Element("PressDate").Value = PressDate.HasValue ? XmlConvert.ToString(PressDate.Value, XmlDateTimeSerializationMode.RoundtripKind) : ""; r.Element("GrossWeight").Value = GrossWeight.ToString(); r.Element("LessTear").Value = LessTear.ToString(); r.Element("LessSample").Value = LessSample.ToString(); r.Element("LessDamage").Value = LessDamage.ToString(); r.Element("DespatchDate").Value = DespatchDate.HasValue ? XmlConvert.ToString(DespatchDate.Value, XmlDateTimeSerializationMode.RoundtripKind) : ""; r.Element("NetWeight").Value = NetWeight.ToString(); r.Element("RatePerQuintal").Value = RatePerQuintal.ToString(); r.Element("Amount").Value = Amount.ToString(); r.Element("GRNo").Value = GRNo; r.Element("LotNo").Value = LotNo; r.Element("DueDate").Value = DueDate.HasValue ? XmlConvert.ToString(DueDate.Value, XmlDateTimeSerializationMode.RoundtripKind) : ""; } doc.Save(@"Transactions.xml"); return("Record Updated Successfully"); }