Example #1
0
        public ActionResult DropdownSite(int ClusterId)
        {
            List <DDSites_get_Result> dDSites_Get_Results = new List <DDSites_get_Result>();

            if (Session["ProfileId"] != null)
            {
                if (Convert.ToString(Session["ProfileId"]) == "1" || Convert.ToString(Session["ProfileId"]) == "2")
                {
                    using (SecurityDBEntities entities = new SecurityDBEntities())
                    {
                        dDSites_Get_Results = entities.DDSites_get(ClusterId).ToList();
                    }
                }
                else
                {
                    string[]           SiteName = Convert.ToString(Session["SiteMapping"]).Split(new string[] { "||" }, StringSplitOptions.None);
                    string[]           SiteId   = Convert.ToString(Session["SiteId"]).Split(new string[] { "||" }, StringSplitOptions.None);
                    DDSites_get_Result dDSites  = new DDSites_get_Result();
                    for (int i = 0; i < SiteName.Length; i++)
                    {
                        dDSites.SiteName = SiteName[i].ToString();
                    }
                    for (int i = 0; i < SiteId.Length; i++)
                    {
                        dDSites.SiteId = Convert.ToInt32(SiteId[i]);
                    }
                    dDSites_Get_Results.Add(dDSites);
                }
            }
            return(Json(dDSites_Get_Results));
        }