public ActionResult CreateDecision(FormCollection collection) { try { // TODO: Add insert logic here IGenericRepository generics = new GenericRepository(); string decisionnotes = collection["decision"].ToString(); int decMeetingId = int.Parse(collection["DecMeetings"].ToString()); int decisionType = generics.getExternalRef(collection["decisiontypes"].ToString(),UpdateUtils.TYPE_DECISION); int tradeTerms = generics.getExternalRef(collection["tradeterms"].ToString(),UpdateUtils.TYPE_TRADETERMS); int PActionID = int.Parse(collection["SourceID"].ToString()); IDecisionsRepository decisions = new DecisionsRepository(); IGenericRepository generic = new GenericRepository(); Decision dec = new Decision(); dec.AddedDate = DateTime.Now; dec.DecisionType = decisionType; dec.ParagraphActionID = PActionID; dec.Notes = decisionnotes; dec.TradeTerms = tradeTerms; dec.SuspensionCommitteeID = decMeetingId; if (collection["suspensiondate"] != null && collection["suspensiondate"].Length > 0) { dec.SuspensionDate = DateTime.Parse(collection["suspensiondate"].ToString()); } if (collection["lifteddate"] != null && collection["lifteddate"].Length > 0) { DateTime liftedDate = DateTime.Parse(collection["lifteddate"].ToString()); dec.SuspensionDate = liftedDate; } if (collection["LiftedMeetings"] != null && collection["LiftedMeetings"].Length > 0) { int liftedCommitteeId = int.Parse(collection["LiftedMeetings"].ToString()); dec.LigftingCommitteeID = liftedCommitteeId; } int i = decisions.SaveDecision(dec); ViewData["MeetingsA"] = ViewData["DecMeetings"] = ViewData["LiftedMeetings"] = new SelectList(generic.getAllMeetingsSelect(), "ID", "Description"); //ViewData["DecCommittees"] = ViewData["LiftedCommittees"]= new SelectList(generic.getAllCommitteesSelect(), "ID", "Description"); IList<Decision> decs = decisions.GetAllDecisionsPerParagraph(PActionID); ViewData["decisiondetails"] = UpdateUtils.GetDecisionDetails(decs); ViewData["decisions"] = decs; //ViewData["decisions"] = decisions.GetAllDecisionsPerParagraph(PActionID); ViewData["ReviewID"] = int.Parse(collection["ReviewID"]); ViewData["PALibID"] = int.Parse(collection["PALibID"]); ViewData["PActionID"] = PActionID; ViewData["decisiontypes"] = new SelectList(generic.GetAllDecisionTypes(), "Description", "Description"); ViewData["tradeterms"] = new SelectList(generic.GetAllTradeTerms(), "Description", "Description"); ViewData["editmode"] = false; return PartialView("Decisions"); //return RedirectToAction("Index"); } catch { return RedirectToAction("Search", "SearchReview"); } }