public ActionResult Add(FormCollection form) //, GateVersion gateversion, Project project { MyLogger.GetInstance().Info("Creating New Project"); string objString = form["txtObject"]; msg = ""; WrapperUpdateProject model = JsonConvert.DeserializeObject <WrapperUpdateProject>(objString); if (ModelState.IsValid) { SQLManager pm = new SQLManager(); bool result = pm.AddNewProject(model); if (result == false) { msg = "Error - saving project"; MyLogger.GetInstance().Error(msg); return(RedirectToAction("ErrorView", "Project", new { message = msg })); } } return(RedirectToAction("Show", "Project")); }
public ActionResult Edit(WrapperUpdateProject model) { ActionResponse ar = new ActionResponse(); string output = ""; MyLogger.GetInstance().Info("Updating Gate Info .." + model.gateVersion.gvProjectId); if (ModelState.IsValid) { SQLManager pm = new SQLManager(); ar = pm.UpdateGateInfo(model); if (!ar.IsSuccess) { return(RedirectToAction("ErrorView", "Project", new { msg = ar.ErrorMsg })); } else { output = "gate info updated successfully"; MyLogger.GetInstance().Info("Updated gate info successfully.." + model.gateVersion.gvProjectId); } } return(Json(output, JsonRequestBehavior.AllowGet)); }