public JsonResult Save_List(string ListName, string restricted) { string str = ""; try { byte res = 0; if (restricted == "Yes") { res = 1; } else { res = 0; } var countlst = context.Prospecting_Lists.Where(x => x.listname == ListName).Count(); var username = User.Identity.Name; if (countlst == 0) { context.SPInsertProspectlist(ListName, res, username); context.SaveChanges(); str = "Success"; } else { str = "List already exist"; } } catch (Exception ex) { cm.ErrorExceptionLogingByService(ex.ToString(), "ProspectListsClient" + ":" + new StackTrace().GetFrame(0).GetMethod().Name, "Save_List", "NA", "NA", "NA", "WEB"); str = "Error Occured"; } return(Json(str, JsonRequestBehavior.AllowGet)); }