Ejemplo n.º 1
0
 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_PurchaseNotification Ajax Error";

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

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

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

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

            case "os_purchasenotification_testemail":
                LocalUtils.OutputTestEmail();
                strOut = LocalUtils.GetData(editlang, "datafields.cshtml");
                break;
            }

            return(strOut);
        }