public ActionResult CoreValues(int taskid, int id, FormCollection form) { string message = string.Empty; Dictionary <string, string> dict = new Dictionary <string, string>(); dict = FormCollectionToDict(form); if (PMSModel.UpdateCoreValueScore(dict, 0, out message)) { TempData["AlertMessage"] = "CoreValue data saved successfully"; return(Redirect("/Stage3/PerformanceCoachingandReview/" + taskid + "/" + id)); } else { TempData["AlertMessage"] = "Ops! CoreValue data saving failed, please try again or contact IT member"; return(View()); } }
public JsonResult CoreValueSave(string[] KPIForDatabase) { string temp = KPIForDatabase[0]; string[] splitString = { "},{" }; string[] result = temp.Substring(2, temp.Length - 2).Split(splitString, StringSplitOptions.None); Dictionary <string, string> dict = new Dictionary <string, string>(); foreach (string s in result) { string[] kparray = s.Replace("\"", "").Split(','); dict.Add((kparray[0].Split(':'))[1], (kparray[1].Split(':'))[1]); } string message = string.Empty; PMSModel.UpdateCoreValueScore(dict, 0, out message); return(Json(message)); }
public ActionResult CoreValues(int taskid, int id, FormCollection form) { string message = string.Empty; Dictionary <string, string> dict = new Dictionary <string, string>(); foreach (string key in form.AllKeys) { dict.Add(key.Substring(5), form[key]); } if (PMSModel.UpdateCoreValueScore(dict, 1, out message)) { return(Redirect("/Stage1Approval/PerformanceCoachingandReview/" + taskid + "/" + id)); } else { return(View()); } }