public ActionResult DropdownCluster(int BranchId) { List <DDClusters_get_Result> dDClusters = new List <DDClusters_get_Result>(); if (Session["ProfileId"] != null) { if (Convert.ToString(Session["ProfileId"]) == "1" || Convert.ToString(Session["ProfileId"]) == "2") { using (SecurityDBEntities entities = new SecurityDBEntities()) { dDClusters = entities.DDClusters_get(BranchId).ToList(); } } else { string[] ClusterName = Convert.ToString(Session["ClusterMapping"]).Split(new string[] { "||" }, StringSplitOptions.None); string[] ClusterId = Convert.ToString(Session["ClusterId"]).Split(new string[] { "||" }, StringSplitOptions.None); DDClusters_get_Result dDClusters_ = new DDClusters_get_Result(); for (int i = 0; i < ClusterName.Length; i++) { dDClusters_.ClusterName = ClusterName[i].ToString(); } for (int i = 0; i < ClusterId.Length; i++) { dDClusters_.ClusterId = Convert.ToInt32(ClusterId[i]); } dDClusters.Add(dDClusters_); } } return(Json(dDClusters)); }