コード例 #1
0
		private void detach_ContractMoneys(ContractMoney entity)
		{
			this.SendPropertyChanging();
			entity.Month = null;
		}
コード例 #2
0
        private void SavePaymentPlan(Budget2DataContext context, Guid budgetVersionId, IEnumerable<PaymentPlanItem> paymentPlanItems, Guid contractId)
        {
            foreach (var paymentPlanItem in paymentPlanItems)
            {

                var currPaymentPlanItem = new ContractMoney()
                                              {
                                                  Id = Guid.NewGuid(),
                                                  Number = paymentPlanItem.Prefix,
                                                  NumberId = paymentPlanItem.Number,
                                                  ContractId = contractId,
                                                  ExternalId = paymentPlanItem.Id
                                              };

                context.ContractMoneys.InsertOnSubmit(currPaymentPlanItem);



                if (paymentPlanItem.Date == DateTime.MinValue)
                    throw new Exception(string.Format("Значение поля PaymentPlanItem.Date ({0}) некорректно.", paymentPlanItem.Date));

                currPaymentPlanItem.Date = paymentPlanItem.Date;
                currPaymentPlanItem.MonthId = (byte)paymentPlanItem.Date.Month;
                currPaymentPlanItem.Year = paymentPlanItem.Date.Year;
                currPaymentPlanItem.DateFrom = paymentPlanItem.DateFrom;
                currPaymentPlanItem.DateTo = paymentPlanItem.DateTo;
                currPaymentPlanItem.Comment = paymentPlanItem.Comment;
                currPaymentPlanItem.ConditionPayment = paymentPlanItem.PaymentTerms;
                currPaymentPlanItem.Sum = paymentPlanItem.Amount;
                currPaymentPlanItem.ExternalFromEmployeeId = paymentPlanItem.FromEmployee;
                currPaymentPlanItem.ExternaToEmployeeId = paymentPlanItem.ToEmployee;
                currPaymentPlanItem.PaidState = paymentPlanItem.FactPay;

                currPaymentPlanItem.FromCounteragentId =
                        (from c in context.Counteragents
                         where c.Number == paymentPlanItem.FromEmployee && c.BudgetVersionId == budgetVersionId && !c.IsDeleted && !c.IsPotential
                         select new Nullable<Guid>(c.Id)).FirstOrDefault();

                currPaymentPlanItem.ToCounteragentId =
                       (from c in context.Counteragents
                        where c.Number == paymentPlanItem.ToEmployee && c.BudgetVersionId == budgetVersionId && !c.IsDeleted && !c.IsPotential
                        select new Nullable<Guid>(c.Id)).FirstOrDefault();

                Logger.Log.DebugFormat("План платежей {0} обновлен (Id={1}).", currPaymentPlanItem.NumberId, currPaymentPlanItem.Id);
            }
        }
コード例 #3
0
		private void detach_ContractMoneys1(ContractMoney entity)
		{
			this.SendPropertyChanging();
			entity.Counteragent1 = null;
		}
コード例 #4
0
		private void attach_ContractMoneys(ContractMoney entity)
		{
			this.SendPropertyChanging();
			entity.Counteragent = this;
		}
コード例 #5
0
 partial void DeleteContractMoney(ContractMoney instance);
コード例 #6
0
 partial void UpdateContractMoney(ContractMoney instance);
コード例 #7
0
 partial void InsertContractMoney(ContractMoney instance);