Example #1
0
        public async Task Update(ChangeShareViewModel share)
        {
            var shareToUpdate = _unitOfWork.SharesRepository.Get(share.ShareId);

            if (share.Name != null)
            {
                shareToUpdate.Name = share.Name;
            }
            if (share.TotalCount != default(int))
            {
                shareToUpdate.TotalCount = share.TotalCount;
            }
            if (share.TotalValue != default(decimal))
            {
                shareToUpdate.TotalValue = share.TotalValue;
            }
            shareToUpdate.SingleShareValue = GetSingleShareValue(shareToUpdate.TotalValue, shareToUpdate.TotalCount);

            _unitOfWork.SharesRepository.Update(shareToUpdate);
            await _unitOfWork.CommitAsync();
        }
 private void OnChangeShareCommand(object o)
 {
     NotificationVm        = new ChangeShareViewModel();
     IsNotificationVisible = true;
 }