// per copiare gli attributi comuni public void CopyAttributes(PagamentoAbstractModel model) { /* * this.DescriptionPayment = model.DescriptionPayment; * this.EmailReceivent = model.EmailReceivent; * this.ReturnUrlForFailed = model.ReturnUrlForFailed; * this.ReturnUrlForSuccess = model.ReturnUrlForSuccess; * this.Token = model.Token; * this.TotalPrice = model.TotalPrice; * this.TypePayment = model.TypePayment; * this.UrlRequest = model.UrlRequest; * this.WebSite = model.WebSite; * this.Test = model.Test;*/ foreach (System.Reflection.PropertyInfo propertyInfo in model.GetType().GetProperties()) { this.GetType().GetProperty(propertyInfo.Name).SetValue(this, propertyInfo.GetValue(model)); } }
public SalvataggioPagamentoViewModel(PagamentoAbstractModel model) : base(model) { }
// se crei l'oggetto partendo da un altro tipo di oggetto, // questo costruttore copia direttamente gli attributi in comune public PagamentoAbstractModel(PagamentoAbstractModel model) { this.CopyAttributes(model); }
public PagamentoViewModel(PagamentoAbstractModel model) : base(model) { }