コード例 #1
0
ファイル: Delete.cshtml.cs プロジェクト: tokshine/KBS
 public IActionResult OnGet(int id)
 {
     FieldText = languageData.GetById(id);
     if (FieldText == null)
     {
         return(RedirectToPage("./NotFound"));
     }
     return(Page());
 }
コード例 #2
0
ファイル: Edit.cshtml.cs プロジェクト: tokshine/KBS
        public IActionResult OnGet(int?id)
        {
            if (id.HasValue)
            {
                FieldText         = languageData.GetById(id.Value);
                ViewData["Title"] = "Edit";
            }
            else
            {
                ViewData["Title"]   = "Add a word/phrase";
                FieldText           = new FieldText();
                FieldText.FieldType = FieldType.XAMARIN;
            }

            Languages = htmlHelper.GetEnumSelectList <FieldType>();
            if (FieldText == null)
            {
                return(RedirectToPage("./NotFound"));
            }
            return(Page());
        }