public void InitLector() { Name = Name.Trim(); PreName = PreName.Trim(); SecondName = SecondName.Trim(); ThirdName = ThirdName != null && ThirdName.Trim() != string.Empty ? ThirdName.Trim() : null; }
public override int GetHashCode() { return((FirstName?.GetHashCode() ?? 0 * 397) ^ ((SecondName?.GetHashCode() ?? 0) * 397) ^ ((ThirdName?.GetHashCode() ?? 0) * 397) ^ DateOfBirth.GetHashCode()); }
public override bool Collect(AbstractDataCollector <TEntity> collector) { if (collector == null) { return(false); } ActiveCollector = collector; ID = ((ISupplierViewer)ActiveCollector.ActiveViewer).ID; if (ActiveDBItem == null) { return(false); } if (FirstName != null) { ((Person_cu)ActiveDBItem).FirstName_P = FirstName.ToString(); } if (SecondName != null) { ((Person_cu)ActiveDBItem).SecondName_P = SecondName.ToString(); } if (ThirdName != null) { ((Person_cu)ActiveDBItem).ThirdName_P = ThirdName.ToString(); } if (FourthName != null) { ((Person_cu)ActiveDBItem).FourthName_P = FourthName.ToString(); } if (MaritalStatus != null) { ((Person_cu)ActiveDBItem).MaritalStatus_P_ID = Convert.ToInt32(MaritalStatus); } if (Gender != null) { ((Person_cu)ActiveDBItem).Gender = Convert.ToBoolean(Gender); } if (BirthDate != null) { ((Person_cu)ActiveDBItem).BirthDate = Convert.ToDateTime(BirthDate); } if (Mobile1 != null) { ((Person_cu)ActiveDBItem).Mobile1 = Mobile1.ToString(); } if (Mobile2 != null) { ((Person_cu)ActiveDBItem).Mobile2 = Mobile2.ToString(); } if (Phone1 != null) { ((Person_cu)ActiveDBItem).Phone1 = Phone1.ToString(); } if (Phone2 != null) { ((Person_cu)ActiveDBItem).Phone2 = Phone2.ToString(); } if (Address != null) { ((Person_cu)ActiveDBItem).Address = Address.ToString(); } if (Email != null) { ((Person_cu)ActiveDBItem).EMail = Email.ToString(); } if (IdentificationCardType != null) { ((Person_cu)ActiveDBItem).IdentificationCardType_P_ID = Convert.ToInt32(IdentificationCardType); } if (IdentificationCardNumber != null) { ((Person_cu)ActiveDBItem).IdentificationCardNumber = IdentificationCardNumber.ToString(); } if (IdentificationCardIssueDate != null) { ((Person_cu)ActiveDBItem).IdentificationCardIssuingDate = Convert.ToDateTime(IdentificationCardIssueDate); } if (IdentificationCardExpirationDate != null) { ((Person_cu)ActiveDBItem).IdentificationCardExpirationDate = Convert.ToDateTime(IdentificationCardExpirationDate); } if (((Person_cu)ActiveDBItem).Supplier_cu == null) { ((Person_cu)ActiveDBItem).Supplier_cu = new Supplier_cu(); } if (InternalCode != null) { ((Person_cu)ActiveDBItem).Supplier_cu.InternalCode = InternalCode.ToString(); } if (((Person_cu)ActiveDBItem).Supplier_cu != null) { ((Person_cu)ActiveDBItem).Supplier_cu.IsOnDuty = true; } ((Person_cu)ActiveDBItem).IsOnDuty = true; switch (((ISupplierViewer)ActiveCollector.ActiveViewer).CommonTransactionType) { case DB_CommonTransactionType.DeleteExisting: ((Person_cu)ActiveDBItem).IsOnDuty = false; if (((Person_cu)ActiveDBItem).Supplier_cu != null) { ((Person_cu)ActiveDBItem).Supplier_cu.IsOnDuty = false; } break; } RelatedViewers = ((ISupplierViewer)ActiveCollector.ActiveViewer).RelatedViewers; return(true); }