public ActionResult CreateRoute()
        {
            AssignRouteChildren     childern = new AssignRouteChildren();
            List <AssignedRouteAll> allList  = new List <AssignedRouteAll>();

            try
            {
                Guid agencyId = new Guid(Session["AgencyId"].ToString());
                allList = new TransportationData().GetChildrenRouteAssignedDetail(agencyId);
                List <CenterDetails> centerlist = new List <CenterDetails>();
                string address = string.Empty;
                childern.BusStaffDetails = new TransportationData().GetBusStaffData(out address, out centerlist, agencyId);
                childern.CenterAddress   = address;
                childern.CenterList      = centerlist;
                // allList = GetLatLongAll(allList);
                childern.AssignRouteList = allList;
                JavaScriptSerializer js = new JavaScriptSerializer();
                childern.TestString = js.Serialize(childern.AssignRouteList);
                List <AssignedRouteAll> pickupRouteNames = allList.Where(a => a.PickUpRouteName != null && a.PickUpRouteName != "Not Assigned").OrderBy(a => a.Latitude).OrderBy(a => a.Longitude).ToList();
                List <AssignedRouteAll> dropRouteNames   = allList.Where(a => a.DropRouteName != null && a.DropRouteName != "Not Assigned").OrderBy(a => a.Latitude).OrderBy(a => a.Longitude).ToList();

                string[] listPickUp   = pickupRouteNames.Where(a => a.PickUpRouteName != null && a.PickUpRouteName != "Not Assigned").Select(a => a.PickUpRouteName).ToArray();
                string[] listPickDrop = dropRouteNames.Where(a => a.DropRouteName != null && a.DropRouteName != "Not Assigned").Select(a => a.DropRouteName).ToArray();
                var      listPickUp1  = listPickUp.Union(listPickDrop).ToList();
                // var listDrop = allList.Select(a => new { RoputeName = a.DropRouteName }).ToList();


                TempData["pickupRouteNames"] = js.Serialize(pickupRouteNames);
                TempData["dropRouteNames"]   = js.Serialize(dropRouteNames);
                TempData["listPickUp1"]      = listPickUp1;
            }
            catch (Exception ex)
            {
                clsError.WriteException(ex);
            }

            return(View(childern));
        }
        public JsonResult GetBusStaffByCenter(string enc_CenterId)
        {
            BusStaff staff = new BusStaff();
            List <AssignedRouteAll> allList    = new List <AssignedRouteAll>();
            List <string>           pickUpList = new List <string>();
            string pickUpRouteNames            = string.Empty;
            string dropRouteName = string.Empty;
            string TestString    = string.Empty;

            try
            {
                long centerId = (enc_CenterId == "0")?0:Convert.ToInt64(EncryptDecrypt.Decrypt64(enc_CenterId));
                Guid agencyId = new Guid(Session["AgencyId"].ToString());
                staff   = new TransportationData().GetBusStaffByCenter(agencyId, centerId);
                allList = new TransportationData().GetChildrenRouteAssignedDetailByCenter(agencyId, centerId);
                //   allList = GetLatLongAll(allList);
                JavaScriptSerializer js = new JavaScriptSerializer();
                TestString = js.Serialize(allList);
                List <AssignedRouteAll> pickupRouteNames = allList.Where(a => a.PickUpRouteName != null && a.PickUpRouteName != "Not Assigned").OrderBy(a => a.Latitude).OrderBy(a => a.Longitude).ToList();
                List <AssignedRouteAll> dropRouteNames   = allList.Where(a => a.DropRouteName != null && a.DropRouteName != "Not Assigned").OrderBy(a => a.Latitude).OrderBy(a => a.Longitude).ToList();

                string[] listPickUp   = pickupRouteNames.Where(a => a.PickUpRouteName != null && a.PickUpRouteName != "Not Assigned").Select(a => a.PickUpRouteName).ToArray();
                string[] listPickDrop = dropRouteNames.Where(a => a.DropRouteName != null && a.DropRouteName != "Not Assigned").Select(a => a.DropRouteName).ToArray();
                var      listPickUp1  = listPickUp.Union(listPickDrop).ToList();
                // var listDrop = allList.Select(a => new { RoputeName = a.DropRouteName }).ToList();


                pickUpRouteNames = js.Serialize(pickupRouteNames);
                dropRouteName    = js.Serialize(dropRouteNames);
                pickUpList       = listPickUp1;
            }
            catch (Exception ex)
            {
                clsError.WriteException(ex);
            }
            return(Json(new { staff, pickUpRouteNames, dropRouteName, pickUpList, TestString }, JsonRequestBehavior.AllowGet));
        }