예제 #1
0
        public IActionResult Edit(int id = 0)
        {
            UserDBModel db = new UserDBModel();

            if (Request.Cookies["userID"] != null)
            {
                id = Int32.Parse(Request.Cookies["userID"]);
            }
            else
            {
                return(RedirectToAction("/Home/Index/"));
            }
            UserModel user = db.GetUserById(id);

            return(View(user));
        }
예제 #2
0
        public IActionResult Index(int id = 0)
        {
            if (Request.Cookies["userID"] != null)
            {
                string userID = Request.Cookies["userID"];

                UserDBModel db   = new UserDBModel();
                UserModel   user = db.GetUserById(Int32.Parse(userID));
                //get the total novel uploaded

                return(View(user));
            }
            else
            {
                return(RedirectToAction("/Home/Index/"));
            }
        }
예제 #3
0
        public IActionResult Index(string id = "0")
        {
            UserDBModel db = new UserDBModel();

            if (Request.Cookies["userID"] != null)
            {
                id = Request.Cookies["userID"];
            }

            UserModel        user = db.GetUserById(Int32.Parse(id));
            List <UserModel> nv   = db.GetAllUser(user.fUsername, user.fPassword);

            if (!db.AdminChecking(Int32.Parse(id)))
            {
                return(RedirectToAction("../Home/Index"));
            }

            return(View(nv));
        }