コード例 #1
0
        public ActionResult DeleteConfirmed(
            Int32?UserTypeID
            )
        {
            UserType UserType = new UserType();

            UserType.UserTypeID = System.Convert.ToInt32(UserTypeID);
            UserType            = UserTypeData.Select_Record(UserType);

            bool bSucess = false;

            bSucess = UserTypeData.Delete(UserType);
            if (bSucess == true)
            {
                return(RedirectToAction("Index"));
            }
            else
            {
                ModelState.AddModelError("", "Can Not Delete");
            }
            return(null);
        }
コード例 #2
0
        // GET: /UserType/Delete/<id>
        public ActionResult Delete(
            Int32?UserTypeID
            )
        {
            if (
                UserTypeID == null
                )
            {
                return(new HttpStatusCodeResult(HttpStatusCode.BadRequest));
            }


            UserType UserType = new UserType();

            UserType.UserTypeID = System.Convert.ToInt32(UserTypeID);
            UserType            = UserTypeData.Select_Record(UserType);

            if (UserType == null)
            {
                return(HttpNotFound());
            }
            return(View(UserType));
        }
コード例 #3
0
        public ActionResult Edit(UserType UserType)
        {
            UserType oUserType = new UserType();

            oUserType.UserTypeID = System.Convert.ToInt32(UserType.UserTypeID);
            oUserType            = UserTypeData.Select_Record(UserType);

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

            return(View(UserType));
        }