public ActionResult Options(QuoteOptionsModel model) { using (var qm = new QuoteManager()) { foreach (var psm in model.ProductLineSelectionModels) { if (psm.IsSelected) { // add it to the quote options database var option = new QuoteOption { QuoteID = model.QuoteID, ContentCategory = QuoteOptionCategory.ProductLineMapping, ForeignKey = psm.ProductLineID, TableName = TableName.ProductLine }; option = qm.CreateOption(option); } } foreach (var msm in model.ManufacturerSelectionModels) { if (msm.IsSelected) { // add it to the quote options database var option = new QuoteOption { QuoteID = model.QuoteID, ContentCategory = QuoteOptionCategory.ManufacturerDefault, ForeignKey = msm.ManufacturerID, TableName = TableName.Manufacturer }; option = qm.CreateOption(option); } } } return(RedirectToAction("Edit", new { id = model.QuoteID })); }