Hi there
I have the following code:
//
// POST: /PlayRoundHole/Create
[AcceptVerbs(HttpVerbs.Post)]
public ActionResult Create(FormCollection collection)
{
try
{
DB db = new DB();
PlayRound playRound = new PlayRound();
playRound.PlayerID = Int64.Parse(Request.Form["Value"]);
playRound.TenantID = 1;
playRound.RoundID = Int64.Parse(Request.Form["RoundID"].ToString());
playRound.Score = 0;
var playRoundHoles = from prh in db.PlayRoundHoles.ToList()
from hl in db.Holes.ToList()
where prh.HoleID == hl.HoleID
where prh.PlayRoundID == Int64.Parse(Request.Form["RoundID"].ToString())
select new { prh.HoleID, hl.Sequence };
foreach(var a in playRoundHoles)
{
PlayRoundHole playRoundHole = new PlayRoundHole();
playRoundHole.HoleID = a.HoleID;
playRoundHole.Stroke = Byte.Parse(Request.Form["PlayRoundHoleID_" + a.Sequence].ToString());
playRound.PlayRoundHoles.Add(playRoundHole);
}
db.SubmitChanges();
return RedirectToAction("Index");
}
catch
{
return View();
}
}
There is no error at all BUT I coun't see the data that is being saved. Any ideas? Is there anyway to trace this?