public ActionResult DeleteConfirmed(int id)
        {
            Clearances clearances = db.Clearances.Find(id);

            db.Clearances.Remove(clearances);
            db.SaveChanges();
            return(RedirectToAction("Index"));
        }
 public ActionResult Edit([Bind(Include = "ClearanceId,ResidentId,Residentname,Cedula,BarangayId,RegisteredVoter,BGClearance")] Clearances clearances)
 {
     if (ModelState.IsValid)
     {
         db.Entry(clearances).State = EntityState.Modified;
         db.SaveChanges();
         return(RedirectToAction("Index"));
     }
     return(View(clearances));
 }
        public ActionResult Create([Bind(Include = "ClearanceId,ResidentId,Residentname,Cedula,BarangayId,RegisteredVoter,BGClearance")] Clearances clearances)
        {
            if (ModelState.IsValid)
            {
                db.Clearances.Add(clearances);
                db.SaveChanges();
                return(RedirectToAction("Index"));
            }

            return(View(clearances));
        }
        // GET: Clearances/Delete/5
        public ActionResult Delete(int?id)
        {
            if (id == null)
            {
                return(new HttpStatusCodeResult(HttpStatusCode.BadRequest));
            }
            Clearances clearances = db.Clearances.Find(id);

            if (clearances == null)
            {
                return(HttpNotFound());
            }
            return(View(clearances));
        }
        /// <summary>
        /// 
        /// </summary>
        /// <param name="authorization"></param>
        /// <returns></returns>
        public bool Unlock(Clearances authorization)
        {
            if (authorization >= lockAuthorization)
            {
                lockAuthorization = Clearances.NONE; //open

                //UNLOCK THE POLYGON IN PLACE HERE
                IsTranslateEnabled = true;
                IsRotateEnabled = true;

                Effect = touchedUnlockEffect;

                if (OnUnlock != null)
                    OnUnlock(this, EventArgs.Empty);

                return true;
            }
            return false;
        }
        /// <summary>
        /// 
        /// </summary>
        /// <param name="authorization"></param>
        /// <returns></returns>
        public bool Lock(Clearances authorization)
        {
            if (authorization > lockAuthorization)
            {
                lockAuthorization = authorization;

                //LOCK THE POLYGON IN PLACE HERE
                IsTranslateEnabled = false;
                IsRotateEnabled = false;

                Effect = TouchLockedEffect;

                if(OnLock != null)
                    OnLock(this, EventArgs.Empty);

                return true;
            }
            return false;
        }