Beispiel #1
0
        public string Validate()
        {
            var sb = new StringBuilder();
            var rs = Holder.Validate();

            if (!String.IsNullOrEmpty(rs))
            {
                sb.AppendLine(rs);
            }

            if (DateOfIssue == MinDate)
            {
                sb.AppendLine(String.Format(ErrorTexts.FieldIsEmpty, Texts.DateOfIssue));
            }

            if (DateOfExpiry == MinDate)
            {
                sb.AppendLine(String.Format(ErrorTexts.FieldIsEmpty, Texts.DateOfExpiry));
            }

            PlaceOfIssue = PlaceOfIssue.ToSafeTrimmedString();
            if (String.IsNullOrEmpty(PlaceOfIssue))
            {
                sb.AppendLine(String.Format(ErrorTexts.FieldIsEmpty, Texts.PlaceOfIssue));
            }

            //CardNumber = CardNumber.ToSafeTrimmedString();
            //if (String.IsNullOrEmpty(CardNumber))
            //    sb.AppendLine(String.Format(ErrorTexts.FieldIsEmpty, Texts.CardNumber));

            return(sb.ToString());
        }
Beispiel #2
0
        public string Validate()
        {
            var sb = new StringBuilder();

            if (IsPersonal)
            {
                var rs = Person.Validate();
                if (!String.IsNullOrEmpty(rs))
                {
                    sb.AppendLine(rs);
                }
            }
            else
            {
                var rs = Organization.Validate();
                if (!String.IsNullOrEmpty(rs))
                {
                    sb.AppendLine(rs);
                }
            }

            var r = Vehicle.Validate();

            if (!String.IsNullOrEmpty(r))
            {
                sb.AppendLine(r);
            }

            if (DateOfIssue == MinDate)
            {
                sb.AppendLine(String.Format(ErrorTexts.FieldIsEmpty, Texts.DateOfIssue));
            }


            if (ExpireDate.Value.Date == DateTime.Today.Date)
            {
                ExpireDate = null;
            }

            PlaceOfIssue = PlaceOfIssue.ToSafeTrimmedString();
            if (String.IsNullOrEmpty(PlaceOfIssue))
            {
                sb.AppendLine(String.Format(ErrorTexts.FieldIsEmpty, Texts.PlaceOfIssue));
            }

            return(sb.ToString());
        }
        void FillFrontSideTextByDrawText(Graphics gr)
        {
            var textMargin = GraphicsHelper.DefaultMainTextMargin + 26;

            GraphicsHelper.DrawMainText(gr, "1.", 146);
            GraphicsHelper.DrawText(gr, RegNumber.ToUpper(), textMargin, 146);
            GraphicsHelper.DrawMainText(gr, "2.", 183);
            GraphicsHelper.DrawText(gr, Model.ToUpper(), textMargin, 183);
            GraphicsHelper.DrawMainText(gr, "3.", 220);
            GraphicsHelper.DrawText(gr, Color.ToUpper(), textMargin, 220);
            GraphicsHelper.DrawMainText(gr, "4.", 257);
            GraphicsHelper.DrawText(gr, Owner.ToUpper(), textMargin, 257, GraphicsHelper.DefaultTextBlockWidth, 65);
            GraphicsHelper.DrawMainText(gr, "5.", 330);
            GraphicsHelper.DrawText(gr, Address, textMargin, 330, GraphicsHelper.DefaultTextBlockWidth, 85);
            GraphicsHelper.DrawMainText(gr, "6.", 425);
            var dt = DateOfIssue.ToShortDateString();

            GraphicsHelper.DrawText(gr, dt.ToUpper(), textMargin, 425);
            GraphicsHelper.DrawMainText(gr, "7.", 466);
            GraphicsHelper.DrawText(gr, PlaceOfIssue.ToUpper(), textMargin, 466);
            GraphicsHelper.DrawMainText(gr, "8.", 510);
            GraphicsHelper.DrawText(gr, PersonalNumber.ToUpper(), textMargin, 510);
        }
Beispiel #4
0
 /// <summary>
 /// Gets the hash code
 /// </summary>
 /// <returns>Hash code</returns>
 public override int GetHashCode()
 {
     unchecked // Overflow is fine, just wrap
     {
         var hashCode = 41;
         // Suitable nullity checks etc, of course :)
         if (AgentNumericCode != null)
         {
             hashCode = hashCode * 59 + AgentNumericCode.GetHashCode();
         }
         if (Code != null)
         {
             hashCode = hashCode * 59 + Code.GetHashCode();
         }
         if (FlightDate != null)
         {
             hashCode = hashCode * 59 + FlightDate.GetHashCode();
         }
         if (FlightLegs != null)
         {
             hashCode = hashCode * 59 + FlightLegs.GetHashCode();
         }
         if (InvoiceNumber != null)
         {
             hashCode = hashCode * 59 + InvoiceNumber.GetHashCode();
         }
         if (IsETicket != null)
         {
             hashCode = hashCode * 59 + IsETicket.GetHashCode();
         }
         if (IsRegisteredCustomer != null)
         {
             hashCode = hashCode * 59 + IsRegisteredCustomer.GetHashCode();
         }
         if (IsRestrictedTicket != null)
         {
             hashCode = hashCode * 59 + IsRestrictedTicket.GetHashCode();
         }
         if (IsThirdParty != null)
         {
             hashCode = hashCode * 59 + IsThirdParty.GetHashCode();
         }
         if (IssueDate != null)
         {
             hashCode = hashCode * 59 + IssueDate.GetHashCode();
         }
         if (MerchantCustomerId != null)
         {
             hashCode = hashCode * 59 + MerchantCustomerId.GetHashCode();
         }
         if (Name != null)
         {
             hashCode = hashCode * 59 + Name.GetHashCode();
         }
         if (PassengerName != null)
         {
             hashCode = hashCode * 59 + PassengerName.GetHashCode();
         }
         if (Passengers != null)
         {
             hashCode = hashCode * 59 + Passengers.GetHashCode();
         }
         if (PlaceOfIssue != null)
         {
             hashCode = hashCode * 59 + PlaceOfIssue.GetHashCode();
         }
         if (Pnr != null)
         {
             hashCode = hashCode * 59 + Pnr.GetHashCode();
         }
         if (PointOfSale != null)
         {
             hashCode = hashCode * 59 + PointOfSale.GetHashCode();
         }
         if (PosCityCode != null)
         {
             hashCode = hashCode * 59 + PosCityCode.GetHashCode();
         }
         if (TicketDeliveryMethod != null)
         {
             hashCode = hashCode * 59 + TicketDeliveryMethod.GetHashCode();
         }
         if (TicketNumber != null)
         {
             hashCode = hashCode * 59 + TicketNumber.GetHashCode();
         }
         if (TotalFare != null)
         {
             hashCode = hashCode * 59 + TotalFare.GetHashCode();
         }
         if (TotalFee != null)
         {
             hashCode = hashCode * 59 + TotalFee.GetHashCode();
         }
         if (TotalTaxes != null)
         {
             hashCode = hashCode * 59 + TotalTaxes.GetHashCode();
         }
         if (TravelAgencyName != null)
         {
             hashCode = hashCode * 59 + TravelAgencyName.GetHashCode();
         }
         return(hashCode);
     }
 }
Beispiel #5
0
        /// <summary>
        /// Returns true if AirlineData instances are equal
        /// </summary>
        /// <param name="other">Instance of AirlineData to be compared</param>
        /// <returns>Boolean</returns>
        public bool Equals(AirlineData other)
        {
            if (ReferenceEquals(null, other))
            {
                return(false);
            }
            if (ReferenceEquals(this, other))
            {
                return(true);
            }

            return
                ((
                     AgentNumericCode == other.AgentNumericCode ||
                     AgentNumericCode != null &&
                     AgentNumericCode.Equals(other.AgentNumericCode)
                     ) &&
                 (
                     Code == other.Code ||
                     Code != null &&
                     Code.Equals(other.Code)
                 ) &&
                 (
                     FlightDate == other.FlightDate ||
                     FlightDate != null &&
                     FlightDate.Equals(other.FlightDate)
                 ) &&
                 (
                     FlightLegs == other.FlightLegs ||
                     FlightLegs != null &&
                     FlightLegs.SequenceEqual(other.FlightLegs)
                 ) &&
                 (
                     InvoiceNumber == other.InvoiceNumber ||
                     InvoiceNumber != null &&
                     InvoiceNumber.Equals(other.InvoiceNumber)
                 ) &&
                 (
                     IsETicket == other.IsETicket ||
                     IsETicket != null &&
                     IsETicket.Equals(other.IsETicket)
                 ) &&
                 (
                     IsRegisteredCustomer == other.IsRegisteredCustomer ||
                     IsRegisteredCustomer != null &&
                     IsRegisteredCustomer.Equals(other.IsRegisteredCustomer)
                 ) &&
                 (
                     IsRestrictedTicket == other.IsRestrictedTicket ||
                     IsRestrictedTicket != null &&
                     IsRestrictedTicket.Equals(other.IsRestrictedTicket)
                 ) &&
                 (
                     IsThirdParty == other.IsThirdParty ||
                     IsThirdParty != null &&
                     IsThirdParty.Equals(other.IsThirdParty)
                 ) &&
                 (
                     IssueDate == other.IssueDate ||
                     IssueDate != null &&
                     IssueDate.Equals(other.IssueDate)
                 ) &&
                 (
                     MerchantCustomerId == other.MerchantCustomerId ||
                     MerchantCustomerId != null &&
                     MerchantCustomerId.Equals(other.MerchantCustomerId)
                 ) &&
                 (
                     Name == other.Name ||
                     Name != null &&
                     Name.Equals(other.Name)
                 ) &&
                 (
                     PassengerName == other.PassengerName ||
                     PassengerName != null &&
                     PassengerName.Equals(other.PassengerName)
                 ) &&
                 (
                     Passengers == other.Passengers ||
                     Passengers != null &&
                     Passengers.SequenceEqual(other.Passengers)
                 ) &&
                 (
                     PlaceOfIssue == other.PlaceOfIssue ||
                     PlaceOfIssue != null &&
                     PlaceOfIssue.Equals(other.PlaceOfIssue)
                 ) &&
                 (
                     Pnr == other.Pnr ||
                     Pnr != null &&
                     Pnr.Equals(other.Pnr)
                 ) &&
                 (
                     PointOfSale == other.PointOfSale ||
                     PointOfSale != null &&
                     PointOfSale.Equals(other.PointOfSale)
                 ) &&
                 (
                     PosCityCode == other.PosCityCode ||
                     PosCityCode != null &&
                     PosCityCode.Equals(other.PosCityCode)
                 ) &&
                 (
                     TicketDeliveryMethod == other.TicketDeliveryMethod ||
                     TicketDeliveryMethod != null &&
                     TicketDeliveryMethod.Equals(other.TicketDeliveryMethod)
                 ) &&
                 (
                     TicketNumber == other.TicketNumber ||
                     TicketNumber != null &&
                     TicketNumber.Equals(other.TicketNumber)
                 ) &&
                 (
                     TotalFare == other.TotalFare ||
                     TotalFare != null &&
                     TotalFare.Equals(other.TotalFare)
                 ) &&
                 (
                     TotalFee == other.TotalFee ||
                     TotalFee != null &&
                     TotalFee.Equals(other.TotalFee)
                 ) &&
                 (
                     TotalTaxes == other.TotalTaxes ||
                     TotalTaxes != null &&
                     TotalTaxes.Equals(other.TotalTaxes)
                 ) &&
                 (
                     TravelAgencyName == other.TravelAgencyName ||
                     TravelAgencyName != null &&
                     TravelAgencyName.Equals(other.TravelAgencyName)
                 ));
        }