} //end Quote() public Quote(net.autotask.webservices.Quote entity) : base(entity) { this.BillToLocationID = int.Parse(entity.BillToLocationID.ToString()); this.EffectiveDate = DateTime.Parse(entity.EffectiveDate.ToString()); this.ExpirationDate = DateTime.Parse(entity.ExpirationDate.ToString()); this.Name = entity.Name == null ? default(string) : entity.Name.ToString(); this.OpportunityID = int.Parse(entity.OpportunityID.ToString()); this.AccountID = entity.AccountID == null ? default(int?) : int.Parse(entity.AccountID.ToString()); this.CalculateTaxSeparately = entity.CalculateTaxSeparately == null ? default(bool?) : bool.Parse(entity.CalculateTaxSeparately.ToString()); this.Comment = entity.Comment == null ? default(string) : entity.Comment.ToString(); this.ContactID = entity.ContactID == null ? default(int?) : int.Parse(entity.ContactID.ToString()); this.CreateDate = entity.CreateDate == null ? default(DateTime?) : DateTime.Parse(entity.CreateDate.ToString()); this.CreatorResourceID = entity.CreatorResourceID == null ? default(int?) : int.Parse(entity.CreatorResourceID.ToString()); this.Description = entity.Description.ToString() == null ? default(string) : entity.Description.ToString(); this.eQuoteActive = entity.eQuoteActive == null ? default(bool?) : bool.Parse(entity.eQuoteActive.ToString()); this.ExternalQuoteNumber = entity.ExternalQuoteNumber == null ? default(string) : entity.ExternalQuoteNumber.ToString(); this.GroupByID = entity.GroupByID == null ? default(int?) : int.Parse(entity.GroupByID.ToString()); this.GroupByProductCategory = entity.GroupByProductCategory == null ? default(bool?) : bool.Parse(entity.GroupByProductCategory.ToString()); this.LastActivityDate = entity.LastActivityDate == null ? default(DateTime?) : DateTime.Parse(entity.LastActivityDate.ToString()); this.LastModifiedBy = entity.LastModifiedBy == null ? default(int?) : int.Parse(entity.LastModifiedBy.ToString()); this.PaymentTerm = entity.PaymentTerm == null ? default(int?) : int.Parse(entity.PaymentTerm.ToString()); this.PaymentType = entity.PaymentType == null ? default(int?) : int.Parse(entity.PaymentType.ToString()); this.PrimaryQuote = entity.PrimaryQuote == null ? default(bool?) : bool.Parse(entity.PrimaryQuote.ToString()); this.ProposalProjectID = entity.ProposalProjectID == null ? default(int?) : int.Parse(entity.ProposalProjectID.ToString()); this.PurchaseOrderNumber = entity.PurchaseOrderNumber == null ? default(string) : entity.PurchaseOrderNumber.ToString(); this.QuoteNumber = entity.QuoteNumber == null ? default(int?) : int.Parse(entity.QuoteNumber.ToString()); this.QuoteTemplateID = entity.QuoteTemplateID == null ? default(int?) : int.Parse(entity.QuoteTemplateID.ToString()); this.ShippingType = entity.ShippingType == null ? default(int?) : int.Parse(entity.ShippingType.ToString()); this.ShipToLocationID = int.Parse(entity.ShipToLocationID.ToString()); this.ShowEachTaxInGroup = entity.ShowEachTaxInGroup == null ? default(bool?) : bool.Parse(entity.ShowEachTaxInGroup.ToString()); this.ShowTaxCategory = entity.ShowTaxCategory == null ? default(bool?) : bool.Parse(entity.ShowTaxCategory.ToString()); this.SoldToLocationID = int.Parse(entity.SoldToLocationID.ToString()); this.TaxGroup = entity.TaxGroup == null ? default(int?) : int.Parse(entity.TaxGroup.ToString()); } //end Quote(net.autotask.webservices.Quote entity)
} //end Quote() public Quote(net.autotask.webservices.Quote entity) : base(entity) { var thisType = typeof(Quote); var fields = typeof(Quote).GetFields(); var entityReflection = typeof(net.autotask.webservices.Quote); foreach (var i in fields) { try { if (i.Name == "UserDefinedFields") { // treat differently: UserDefinedFields = entity.UserDefinedFields?.Select(udf => new UserDefinedField { Name = udf.Name, Value = udf.Value }).ToList(); continue; } var value = entityReflection.GetProperty(i.Name)?.GetValue(entity); thisType.GetField(i.Name).SetValue(this, value); } catch (Exception e) { Console.WriteLine(e); throw; } } } //end Quote(net.autotask.webservices.Quote entity)
} //end Quote() public Quote(net.autotask.webservices.Quote entity) : base(entity) { } //end Quote(net.autotask.webservices.Quote entity)