Exemple #1
0
        public ActionResult New(int id)
        {
            var db = new TbCmsContext();

            //return View("Input", _rep.GetInputNewData());
            return(View("Input"));
        }
Exemple #2
0
        public ActionResult List()
        {
            var db = new TbCmsContext();

            //return View(_rep.GetFirstListData());
            return(View());
        }
Exemple #3
0
        public ActionResult New(SystemUserInputViewModel model)
        {
            if (!ModelState.IsValid)
            {
                return(View("Input", model));
            }

            // 登録.
            var ret = _rep.RegistrationInputNewData(model);

            if (!ret)
            {
                // DB登録失敗.
                // TODO:本来はこれだけじゃダメだけど、ひとまず元の画面に戻す.
                return(View("Input", model));
            }

            // DB登録に成功したのでリスト画面に戻す.
            // TODO:検索条件を保持しておいた方がよい?.
            var db = new TbCmsContext();

            return(View("List", _rep.GetFirstListData()));
        }
Exemple #4
0
        public ActionResult Login(LoginViewModel model)
        {
            var db = new TbCmsContext();

            var loginViewModel = _rep.CheckLogin(model);

            if (loginViewModel.IsSuccess)
            {
                // ログイン成功.

                // セッションに必要な情報を設定.
                Session["IsAdministrator"]  = true; // TODO:暫定.
                Session["IsCreateNews"]     = true; // TODO:暫定.
                Session["IsCreateContents"] = true; // TODO:暫定.

                Session["LoginId"] = loginViewModel.system_user_id;

                return(Redirect("../Menu/Menu"));
            }
            else
            {
                return(View(loginViewModel));
            }
        }
Exemple #5
0
        public ActionResult List(SystemUserListViewModel model)
        {
            var db = new TbCmsContext();

            return(View(_rep.GetSarchListData(model)));
        }
Exemple #6
0
        public ActionResult Edit(string id)
        {
            var db = new TbCmsContext();

            return(View("Input", _rep.GetInputEditData(id)));
        }