コード例 #1
0
        public bool EditShare(int id, ShareDTO share, StatisticsDTO statistics)
        {
            var edited = repo.GetById(id);

            statistics.SelectsTime += repo.LastOperationTime;
            statistics.SelectsCount++;

            if (edited == null)
            {
                return(false);
            }

            edited.OwnerId = share.OwnerId;
            edited.StockId = share.StockId;
            edited.Amount  = share.Amount;

            repo.Edit(edited);
            statistics.UpdatesTime += repo.LastOperationTime;
            statistics.UpdatesCount++;

            return(true);
        }