public void AddRelQuota(RelQuota relQuota) { //RelQuotas RelQuotas.Add(relQuota); SetRelQuotaStage(); }
private void LoadRelQuota(int id) { if (ContractType == ContractType.Purchase) { using (var quotaService = SvcClientManager.GetSvcClient<QuotaServiceClient>(SvcType.QuotaSvc)) { List<Quota> quotas = quotaService.SelectWithMultiOrderLazyLoad( "it.RelQuotaId == " + id + " and it.Contract.ContractType == " + (int)ContractType + " and it.Contract.TradeType == " + (int)TradeType.ShortDomesticTrade, null, new List<SortCol> { new SortCol() { ColName = "RelQuotaStage", ByDescending = false } }, new List<string>() { "Contract", "Contract.InternalCustomer" }, null).ToList(); if (quotas.Count > 0) { foreach (Quota quota in quotas) { var rel = new RelQuota { BusinessParnterId = quota.Contract.InternalCustomerId.Value, BusinessParnterName = quota.Contract.InternalCustomer.ShortName, Price = quota.RelPrice, QuotaStage = quota.RelQuotaStage.Value, SignDate = quota.Contract.SignDate.Value, VATInvoiceDate = quota.VATInvoiceDate }; RelQuotas.Add(rel); } } } } }