コード例 #1
0
ファイル: HomeController.cs プロジェクト: Niseel/SaleApp
        public IActionResult Profile(int?id)
        {
            if (id == null)
            {
                return(NotFound());
            }

            if (HttpContext.Session.GetString("LoginName") == null)
            {
                ViewBag.checkLogin = 0;
                return(View("AddCart"));
            }

            var user = _serviceCustomer.GetUser(id.Value);

            if (user == null)
            {
                return(NotFound());
            }

            UserEditVm UserEdit = new UserEditVm()
            {
                ID           = user.ID,      // hidden
                ExistAvtPath = user.AvtPath, // hidden
                Password     = user.Password,
                Address      = user.Address,
                Birth        = user.Birth,
                FirstName    = user.FirstName,
                LastName     = user.LastName,
                Level        = user.Level,
                Mail         = user.Mail,
                Note         = user.Note,
                Phone        = user.Phone,
                Status       = user.Status
            };
            var x = _userService.GetList();

            ViewBag.StatusList = x.StatusList;
            return(View(UserEdit));
        }
コード例 #2
0
        public IActionResult Create()
        {
            if (HttpContext.Session.GetInt32("LoginLevel") != 2)
            {
                ViewBag.checkLogin = 0;
                return(View("../Home/AddCart"));
            }
            var x = _userService.GetList();

            ViewBag.StatusList = x.StatusList;
            return(View());
        }