public SearchResultModel(CCTransaction ccTransaction) { this.CCTransactionId = ccTransaction.CCTransactionId; this.RiskId = ccTransaction.RiskId; this.AccountCode = ccTransaction.BrokerCompany.ParentCompany.OpenCompany.OpenCompanyID; this.BrokerReference = ccTransaction.BrokerReference; this.ClientName = ccTransaction.ClientCompany.CompanyName; this.PolicyReference = ccTransaction.Reference; this.MemoAmount = ccTransaction.CCTransactionItem.FirstOrDefault(cci => cci.CCCategoryTypeId == 4 && cci.CCSubCategoryTypeId == 1).Amount; this.Amount = ccTransaction.Amount; this.JournalType = null; //handled as custom helper in view this.GeneralDescrition6 = ccTransaction.CCOpenPremiumType.Description; this.TotalCommissionRate = (decimal)ccTransaction.CCTransactionItem.Where(cci => cci.CCCategoryTypeId == 2).Sum(ccix => ccix.Rate); this.BrokerCommissionRate = (decimal)ccTransaction.CCTransactionItem.FirstOrDefault(cci => cci.CCCategoryTypeId == 2 && cci.CCSubCategoryTypeId == 5).Rate; //Broker Commission rate this.PowerplaceCommissionRate = (decimal)ccTransaction.CCTransactionItem.FirstOrDefault(cci => cci.CCCategoryTypeId == 2 && cci.CCSubCategoryTypeId == 6).Rate; //Powerplace commission rate this.TotalCommissionValue = ccTransaction.CCTransactionItem.Where(cci => cci.CCCategoryTypeId == 2).Sum(ccix => ccix.Amount); this.PowerplaceCommissionValue = ccTransaction.CCTransactionItem.FirstOrDefault(cci => cci.CCCategoryTypeId == 2 && cci.CCSubCategoryTypeId == 6).Amount; this.BrokerCommissionValue = ccTransaction.CCTransactionItem.FirstOrDefault(cci => cci.CCCategoryTypeId == 2 && cci.CCSubCategoryTypeId == 5).Amount; this.IPTValue = ccTransaction.CCTransactionItem.FirstOrDefault(cci => cci.CCCategoryTypeId == 3 && cci.CCSubCategoryTypeId == 1).Amount; this.CCOpenTransactionTypeId = ccTransaction.CCOpenTransactionTypeId; this.EffectiveDate = ccTransaction.EffectiveDate; }
public SunContraTransaction(CCTransaction ccTransaction,DateTime? postingDate) { this.ccTransaction = ccTransaction; this.ccTransactionDateTimeNeeded = postingDate; }