public BetData Insert(BetData bet) { var p = new DynamicParameters(); p.Add("Username", bet.Username); p.Add("User2ID", bet.User2ID); p.Add("BetActionID", bet.BetActionID); p.Add("BetValue", bet.BetValue); p.Add("FileExtension", bet.FileExtension); p.Add("Guid", dbType: DbType.Guid, direction: ParameterDirection.Output); this._db.Execute("spSUP_Bet_Insert", p, commandType: CommandType.StoredProcedure); bet.Guid = p.Get <Guid>("Guid"); return(bet); }
//public BetData Update(BetData bet) //{ // this._db.Execute("spSUP_Bet_Update", param: bet, commandType: CommandType.StoredProcedure); // return bet; //} public BetData Update(BetData bet) { var p = new DynamicParameters(); p.Add("Guid", bet.Guid, direction: ParameterDirection.InputOutput); p.Add("BetID", dbType: DbType.Int32, direction: ParameterDirection.Output); if (bet.BetActionID == 115) { p.Add("UserID", bet.User1ID); } else { p.Add("UserID", bet.User2ID); } p.Add("BetStatusID", bet.BetStatusID); this._db.Execute("spSUP_Bet_Update", param: p, commandType: CommandType.StoredProcedure); bet.Guid = p.Get <Guid>("Guid"); bet.BetID = p.Get <Int32>("BetID"); return(bet); }