예제 #1
0
        public bool SellInvestment(Guid investmentId, decimal sellPrice, SellReason sellReason, DateTime sellDate)
        {
            using (DbConnection connection = Db.CreateConnection())
            {
                connection.Open();

                Investment investment = connection.Get <Investment>(investmentId);
                if (investment == null)
                {
                    Log.Error("Unable to find investment with id {0} (sellreason: {1})", investmentId, sellReason.ToString());
                    return(false);
                }

                investment.SellDate   = sellDate;
                investment.SellPrice  = sellPrice;
                investment.SellReason = sellReason;

                return(connection.Update <Investment>(investment));
            }
        }
        public bool SellInvestment(Guid investmentId, decimal sellPrice, SellReason sellReason, DateTime sellDate)
        {
            using (DbConnection connection = Db.CreateConnection())
            {
                connection.Open();

                Investment investment = connection.Get<Investment>(investmentId);
                if (investment == null)
                {
                    Log.Error("Unable to find investment with id {0} (sellreason: {1})", investmentId, sellReason.ToString());
                    return false;
                }

                investment.SellDate = sellDate;
                investment.SellPrice = sellPrice;
                investment.SellReason = sellReason;

                return connection.Update<Investment>(investment);
            }
        }