public static void Main()
public JsonResult GetAllUsersApprovalInternalAgreement()
Dictionary<String, String> err = new Dictionary<string, string>();
err.Add("Err", "User Not Login");
return Json(err, JsonRequestBehavior.AllowGet);
IApprovalManagementService svcApprovalManagement = ConstructorInjection.CreateInstance<IApprovalManagementService>("service.xml", "service");
Dictionary<int, List<String>> result = svcApprovalManagement.GetAllUsersApproval("1759");
List<String> userList = new List<string>();
ILookupDetailService svcLookupDetail = ConstructorInjection.CreateInstance<ILookupDetailService>("service.xml", "service");
LookupDetailFilter filter = new LookupDetailFilter();
filter.LookupId = "APPROVER_IA";
List<LookupDetail> lookupDetailObjs = svcLookupDetail.GetLookupDetails(filter);
if (lookupDetailObjs != null && lookupDetailObjs.Count > 0)
foreach (LookupDetail itemLookup in lookupDetailObjs)
if (itemLookup == null) continue;
if (String.IsNullOrEmpty(itemLookup.Value)) continue;
if (userList.Contains(itemLookup.Value.ToUpper())) continue;
userList.Add(itemLookup.Value.ToUpper());
Dictionary<string, List<String>> resultJSON = new Dictionary<string, List<String>>();
if (result != null && result.Count > 0)
foreach (KeyValuePair<int, List<String>> itemDict in result)
if (itemDict.Value == null) continue;
if (itemDict.Value.Count <= 0) continue;
foreach (String itemUser in itemDict.Value)
if (String.IsNullOrEmpty(itemUser)) continue;
if (!itemDict.Value.Contains(itemUser.ToUpper()))
if (resultJSON.ContainsKey(itemDict.Key.ToString()))
if (!resultJSON[itemDict.Key.ToString()].Contains(itemUser))
resultJSON[itemDict.Key.ToString()].Add(itemUser);
List<String> users = new List<string>();
resultJSON.Add(itemDict.Key.ToString(), users);
return Json(resultJSON, JsonRequestBehavior.AllowGet);