public static string Delete(string type, string history) { Dictionary <string, string> result = new Dictionary <string, string>() { { "deleted", "" }, { "error", "" } }; bool deleted = false; string errorMsg = string.Empty; try { int history_ID = 0; int.TryParse(history, out history_ID); if (type == "WorkItemTask") { deleted = Workload.WorkItem_Task_History_Delete(WORKITEM_TASK_HISTORYID: history_ID); } else { deleted = Workload.WorkItem_History_Delete(WorkItem_HistoryID: history_ID); } } catch (Exception ex) { LogUtility.LogException(ex); deleted = false; errorMsg = ex.Message; } result["deleted"] = deleted.ToString(); result["error"] = errorMsg; return(JsonConvert.SerializeObject(result, Newtonsoft.Json.Formatting.None)); }