예제 #1
0
        public ActionResult DeleteConfirmed(
            Int32?PermissionID
            )
        {
            Permission Permission = new Permission();

            Permission.PermissionID = System.Convert.ToInt32(PermissionID);
            Permission = PermissionData.Select_Record(Permission);

            bool bSucess = false;

            bSucess = PermissionData.Delete(Permission);
            if (bSucess == true)
            {
                return(RedirectToAction("Index"));
            }
            else
            {
                ModelState.AddModelError("", "Can Not Delete");
            }
            return(null);
        }
예제 #2
0
        // GET: /Permission/Delete/<id>
        public ActionResult Delete(
            Int32?PermissionID
            )
        {
            if (
                PermissionID == null
                )
            {
                return(new HttpStatusCodeResult(HttpStatusCode.BadRequest));
            }


            Permission Permission = new Permission();

            Permission.PermissionID = System.Convert.ToInt32(PermissionID);
            Permission = PermissionData.Select_Record(Permission);

            if (Permission == null)
            {
                return(HttpNotFound());
            }
            return(View(Permission));
        }
예제 #3
0
        public ActionResult Edit(Permission Permission)
        {
            Permission oPermission = new Permission();

            oPermission.PermissionID = System.Convert.ToInt32(Permission.PermissionID);
            oPermission = PermissionData.Select_Record(Permission);

            if (ModelState.IsValid)
            {
                bool bSucess = false;
                bSucess = PermissionData.Update(oPermission, Permission);
                if (bSucess == true)
                {
                    return(RedirectToAction("Index"));
                }
                else
                {
                    ModelState.AddModelError("", "Can Not Update");
                }
            }

            return(View(Permission));
        }