private void RazorPageLoad()
 {
     if (NBrightBuyUtils.CheckRights())
     {
         var lit = new Literal();
         lit.Text = LocalUtils.GetData(Utils.GetCurrentCulture());
         phData.Controls.Add(lit);
     }
 }
        public override string ProcessCommand(string paramCmd, HttpContext context, string editlang = "")
        {
            if (!LocalUtils.CheckRights())
            {
                return("Security Error.");
            }

            var ajaxInfo = NBrightBuyUtils.GetAjaxFields(context);
            var lang     = NBrightBuyUtils.SetContextLangauge(ajaxInfo); // Ajax breaks context with DNN, so reset the context language to match the client.
            var objCtrl  = new NBrightBuyController();

            var strOut = "OS_PluginTemplateSI Ajax Error";

            // NOTE: The paramCmd MUST start with the plugin ref. in lowercase. (links ajax provider to cmd)
            switch (paramCmd)
            {
            case "os_plugintemplatesi_getdata":
                strOut = LocalUtils.GetData(editlang, "datafields.cshtml");
                break;

            case "os_plugintemplatesi_deleterecord":
                var infoDel = objCtrl.GetPluginSinglePageData("OS_PluginTemplateSIDATA", "OS_PluginTemplateSIDATA", Utils.GetCurrentCulture());
                objCtrl.Delete(infoDel.ItemID);
                break;

            case "os_plugintemplatesi_savedata":
                strOut = objCtrl.SavePluginSinglePageData(context);
                break;

            case "os_plugintemplatesi_selectlang":
                objCtrl.SavePluginSinglePageData(context);
                strOut = "";
                break;
            }

            return(strOut);
        }