private void MergeSpendType(SpendType originalSpendType, SpendTypeRequest SpendType) { originalSpendType.Consortium = this.ConsortiumRepository.GetById(SpendType.ConsortiumId); originalSpendType.Description = SpendType.Description; originalSpendType.Required = SpendType.Required; originalSpendType.Item = this.SpendItemRepository.GetById(SpendType.SpendItemId); }
private void Refresh() { _spendType = _context.spendType; _amount = _spendType == SpendType.TransferToBankCard ? _context.realAmount + _context.serviceAmount : _context.amount; if (_spendType == SpendType.ToSelfAssets) { _payway = AssetsManager.Instance.curUseBankCard != null ? PaywayType.BankCard : PaywayType.None; } else if (_spendType == SpendType.CanUseAnt && AssetsManager.Instance.curPayway == PaywayType.Ant && AssetsManager.Instance.assetsData.antPay > _amount) { _payway = PaywayType.Ant; } else { _payway = AssetsManager.Instance.SetCurPaywayByMoney(_amount); } _serviceItem.SetActive(_spendType == SpendType.TransferToBankCard); _orderItem.SetActive(_spendType == SpendType.TransferToBankCard); if (_spendType == SpendType.TransferToBankCard) { _orderText.text = _context.realAmount.ToString("0.00"); _serviceText.text = _context.serviceAmount.ToString("0.00"); } _amountText.text = _amount.ToString("0.00"); _infoText.text = _spendType == SpendType.ToSelfAssets ? ContentHelper.Read(ContentHelper.RechargeText) : ContentHelper.Read(ContentHelper.TransferText); _signObj.transform.localPosition = new Vector3(-_amountText.preferredWidth / 2, _signObj.transform.localPosition.y, _signObj.transform.localPosition.z); _canPayFlag = _payway != PaywayType.None; _useItem.SetActive(_canPayFlag); _okTextObj.SetActive(_canPayFlag); _canNotPayObj.SetActive(!_canPayFlag); _selectTextObj.SetActive(!_canPayFlag); _paywayStr = Utils.FormatPaywayStr(_payway, AssetsManager.Instance.curUseCardId); _useItemText.text = _paywayStr; }
public SpendType CreateSpendType(SpendTypeRequest SpendType) { var entity = new SpendType(); this.MergeSpendType(entity, SpendType); this.SpendTypeRepository.Insert(entity); if (SpendType.ForAll) { var consortiums = this.ConsortiumRepository.GetAll().Where(x => x.Id != SpendType.ConsortiumId) .Select(x => x.Id) .ToList(); consortiums.ForEach(x => { var nentity = new SpendType(); this.MergeSpendType(nentity, SpendType); nentity.Consortium = this.ConsortiumRepository.GetById(x); this.SpendTypeRepository.Insert(nentity); }); } return(entity); }
private void GetByID(Guid id) { // Act SpendType spendType = repo.GetById(id); // Assert Assert.IsNotNull(spendType.Description, "GetByID returned null."); Assert.AreEqual(id, spendType.Id); Assert.AreEqual(DESCRIPTION, spendType.Description); Assert.AreEqual(LONG_DESCRIPTION, spendType.LongDescription); }
private void CreateTransactionTypeRows() { var paymentTypeId = paymentTypeRepository.Add(PAYMENTTYPE_TOADD); var fundTypeId = fundTypeRepository.Add(FUNDTYPE_TOADD); var budgetTypeId = budgetTypeRepository.Add(BUDGETTYPE_TOADD); var spendTypeId = spendTypeRepository.Add(SPENDTYPE_TOADD); PAYMENTTYPE = paymentTypeRepository.GetById(paymentTypeId); BUDGETTYPE = budgetTypeRepository.GetById(budgetTypeId); FUNDTYPE = fundTypeRepository.GetById(fundTypeId); SPENDTYPE = spendTypeRepository.GetById(spendTypeId); }
private void Delete(Guid id) { // Arrange SpendType spendType = repo.GetById(id); // Act repo.Remove(spendType); spendType = repo.GetById(id); // Assert Assert.IsNull(spendType, "Record is not deleted."); }
public void Setup() { payment = Payment.Create( (TransactionDescription)"Council Tax", DateTime.Parse("03/06/2018"), PaymentType.Create("DDR", "Direct Debit").Value, 210.00, BudgetType.Create("CTAX", "Council Tax"), SpendType.Create("Revenue", "Revenue"), (Note)string.Empty, "", FundType.Create("Revenue", "Revenue")); }
private void InitialiseParameters() { DATERECIEVED = new DateTime(2018, 8, 7); DESCRIPTION = (TransactionDescription)"Builder and Sons"; AMOUNT = 520.00; PAYMENTTYPE_TOADD = PaymentType.Create("CHQ", "Cheque").Value; BUDGETTYPE_TOADD = BudgetType.Create("Building", "Building Maintenance"); FUNDTYPE_TOADD = FundType.Create("Building", "Building Fund"); SPENDTYPE_TOADD = SpendType.Create("Capital", "Capital"); NOTE = (Note)string.Empty; BANKCLEARED = false; CHEQUENUMBER = "000123"; }
private Guid Create() { //Arrange SpendType spendType = SpendType.Create(DESCRIPTION, LONG_DESCRIPTION); //Act spendType.Id = repo.Add(spendType); //Assert Assert.AreNotEqual(0, spendType.Id, "Creating new record does not return id"); return(spendType.Id); }
private void Update(Guid id) { // Arrange SpendType spendType = repo.GetById(id); spendType.LongDescription = "Test Change"; // Act repo.Update(spendType); SpendType updatedSpendType = repo.GetById(id); // Assert Assert.AreEqual("Test Change", updatedSpendType.LongDescription, "Record is not updated."); }
public SpendType UpdateSpendType(SpendType originalSpend, SpendTypeRequest Spend) { this.MergeSpendType(originalSpend, Spend); SpendTypeRepository.Update(originalSpend); return(originalSpend); }
public Expenditure(DateTime dateTime, Decimal amount, SpendType spendType) { this.dateTime = dateTime; this.amount = amount; this.spendType = spendType; }
public SelectPayWayContext(double amount, SpendType spendType) : base(UIType.SelectPayWay) { this.amount = amount; this.spendType = spendType; }