public async Task <ActionResult> DeleteConfirmed(Guid id)
        {
            LaserPointerInformation laserPointerInformation = await db.LaserPointerInformations.FindAsync(id);

            db.LaserPointerInformations.Remove(laserPointerInformation);
            await db.SaveChangesAsync();

            return(RedirectToAction("Index"));
        }
        public async Task <ActionResult> Edit([Bind(Include = "Id,Position,Longitude,Latitude,FaceLongitude,FaceLatitude,Floor")] LaserPointerInformation laserPointerInformation)
        {
            if (ModelState.IsValid)
            {
                db.Entry(laserPointerInformation).State = EntityState.Modified;
                await db.SaveChangesAsync();

                return(RedirectToAction("Index"));
            }
            return(View(laserPointerInformation));
        }
        public async Task <ActionResult> Create([Bind(Include = "Id,Position,Longitude,Latitude,FaceLongitude,FaceLatitude,Floor")] LaserPointerInformation laserPointerInformation)
        {
            if (ModelState.IsValid)
            {
                laserPointerInformation.Id = Guid.NewGuid();
                db.LaserPointerInformations.Add(laserPointerInformation);
                await db.SaveChangesAsync();

                return(RedirectToAction("Index"));
            }

            return(View(laserPointerInformation));
        }
        // GET: LaserPointerInformations/Edit/5
        public async Task <ActionResult> Edit(Guid?id)
        {
            if (id == null)
            {
                return(new HttpStatusCodeResult(HttpStatusCode.BadRequest));
            }
            LaserPointerInformation laserPointerInformation = await db.LaserPointerInformations.FindAsync(id);

            if (laserPointerInformation == null)
            {
                return(HttpNotFound());
            }
            return(View(laserPointerInformation));
        }
示例#5
0
        protected override void OnNavigatedTo(NavigationEventArgs e)
        {
            UUID = (string)e.Parameter;
            TextLBeaconID.Text = "LBeaconID: " + UUID;
            BeaconInformation BI =
                PointPage.BeaconInformations.Where(
                    c => c.Id == Guid.Parse(UUID)).First();
            LaserPointerInformation LPI =
                PointPage.LaserPointerInformations.Where(
                    c => c.Id == BI.LaserPointerInformationId).First();

            latitude.Text       = "經度: " + BI.Latitude.ToString();
            longitude.Text      = "緯度: " + BI.Longitude.ToString();
            ReferencePoint.Text = "地點: " + LPI.Position;

            facePoint   = new GeoCoordinate(LPI.FaceLatitude, LPI.FaceLongitude);
            CenterPoint = new GeoCoordinate(LPI.Latitude, LPI.Longitude);
            targetPoint = new GeoCoordinate(BI.Latitude, BI.Longitude);
        }