示例#1
0
        public override string ProcessCommand(string paramCmd, HttpContext context, string editlang = "")
        {
            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  = "manualpayment Ajax Error";

            if (PluginUtils.CheckPluginSecurity(PortalSettings.Current.PortalId, "manualpayment"))
            {
                switch (paramCmd)
                {
                case "manualpayment_savesettings":
                    strOut = objCtrl.SavePluginSinglePageData(context);
                    break;

                case "manualpayment_selectlang":
                    objCtrl.SavePluginSinglePageData(context);
                    var nextlang = ajaxInfo.GetXmlProperty("genxml/hidden/nextlang");
                    var info     = objCtrl.GetPluginSinglePageData("manualpayment", "MANUALPAYMENT", nextlang);
                    strOut = NBrightBuyUtils.RazorTemplRender("settingsfields.cshtml", 0, "", info, "/DesktopModules/NBright/NBrightBuy/Providers/ManualPaymentProvider", "config", nextlang, StoreSettings.Current.Settings());
                    break;
                }
            }

            return(strOut);
        }
        public override string ProcessCommand(string paramCmd, HttpContext context, string editlang = "")
        {
            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_WorldPay Ajax Error";

            if (PluginUtils.CheckPluginSecurity(PortalSettings.Current.PortalId, "os_worldpay"))
            {
                if (UserController.Instance.GetCurrentUserInfo().IsInRole("Administrators") || UserController.Instance.GetCurrentUserInfo().IsInRole("manager"))
                {
                    // NOTE: The paramCmd MUST start with the plugin ref. in lowercase. (links ajax provider to cmd)
                    switch (paramCmd)
                    {
                    case "os_worldpay_savesettings":
                        strOut = objCtrl.SavePluginSinglePageData(context);
                        break;

                    case "os_worldpay_selectlang":
                        objCtrl.SavePluginSinglePageData(context);
                        var nextlang = ajaxInfo.GetXmlProperty("genxml/hidden/nextlang");
                        var info     = objCtrl.GetPluginSinglePageData("OS_WorldPaypayment", "OS_WorldPayPAYMENT", nextlang);
                        strOut = NBrightBuyUtils.RazorTemplRender("settingsfields.cshtml", 0, "", info, "/DesktopModules/NBright/OS_WorldPay", "config", nextlang, StoreSettings.Current.Settings());
                        break;
                    }
                }
            }

            return(strOut);
        }
示例#3
0
        public string ProcessCommand(string paramCmd, HttpContext context, string editlang = "")
        {
            var strOut   = "CATEGORY - ERROR!! - No Security rights or function command.";
            var ajaxInfo = NBrightBuyUtils.GetAjaxFields(context);

            EntityTypeCode = ajaxInfo.GetXmlProperty("genxml/hidden/entitytypecode");
            if (EntityTypeCode == "")
            {
                EntityTypeCode = "CATEGORY";                       // default to category
            }
            EditLangCurrent = NBrightBuyUtils.GetEditLang(ajaxInfo, Utils.GetCurrentCulture());

            if (!paramCmd.ToLower().Contains("save"))
            {
                // pickup nextlang, indicates if we are changing languages. (Don't use if saving data, only for getting next language.)
                EditLangCurrent = NBrightBuyUtils.GetNextLang(ajaxInfo, EditLangCurrent);
            }

            if (PluginUtils.CheckPluginSecurity(PortalSettings.Current.PortalId, "categories"))
            {
                switch (paramCmd)
                {
                case "category_admin_getlist":
                    strOut = CategoryAdminList(context, "", EditLangCurrent);
                    break;

                case "category_admin_getdetail":
                    strOut = CategoryAdminDetail(context, 0, EditLangCurrent);
                    break;

                case "category_admin_addnew":
                    strOut = CategoryAdminAddNew(context);
                    break;

                case "category_admin_savelist":
                    strOut = CategoryAdminSaveList(context);
                    break;

                case "category_admin_save":
                    strOut = CategorySave(context, EditLangCurrent);
                    break;

                case "category_admin_saveexit":
                    strOut = CategorySave(context, EditLangCurrent);
                    break;

                case "category_admin_movecategory":
                    strOut = MoveCategoryAdmin(context);
                    break;

                case "category_admin_delete":
                    strOut = DeleteCategory(context);
                    break;

                case "category_updateimages":
                    strOut = UpdateCategoryImages(context, EditLangCurrent);
                    break;

                case "category_getproductselectlist":
                    var productFunctions = new ProductFunctions();
                    strOut = productFunctions.ProductAdminList(context, true, EditLangCurrent, "", true);
                    break;

                case "category_selectchangehidden":
                    strOut = CategoryHidden(context);
                    break;

                case "category_selectcatxref":
                    strOut = SelectCatXref(context, EditLangCurrent);
                    break;

                case "category_deletecatxref":
                    strOut = DeleteCatXref(context);
                    break;

                case "category_deleteallcatxref":
                    strOut = DeleteAllCatXref(context, EditLangCurrent);
                    break;

                case "category_copyallcatxref":
                    strOut = CopyAllCatXref(context);
                    break;

                case "category_moveallcatxref":
                    strOut = CopyAllCatXref(context, true);
                    break;

                case "category_cattaxupdate":
                    strOut = CatTaxUpdate(context, EditLangCurrent);
                    break;

                case "category_addgroupfilter":
                    strOut = AddGroupFilter(context, EditLangCurrent);
                    break;

                case "category_removegroupfilter":
                    strOut = RemoveGroupFilter(context, EditLangCurrent);
                    break;

                case "category_categorygroupfilter":
                    strOut = CategoryGroupFilters(context, EditLangCurrent);
                    break;
                }
            }

            switch (paramCmd)
            {
            case "category_categoryproductlist":
                strOut = GetCategoryProductList(context, EditLangCurrent);
                break;

            case "category_removeimage":
                strOut = RemoveCategoryImage(context, EditLangCurrent);
                break;

            case "category_displayproductselect":
                strOut = CategoryProductSelect(context, EditLangCurrent);
                break;
            }

            return(strOut);
        }
示例#4
0
        public string ProcessCommand(string paramCmd, HttpContext context, string editlang = "")
        {
            var categoryFunctions = new CategoryFunctions();

            var strOut   = "PROPERTY - ERROR!! - No Security rights or function command.";
            var ajaxInfo = NBrightBuyUtils.GetAjaxFields(context);

            UiLang = ajaxInfo.GetXmlProperty("genxml/hidden/uilang");
            if (UiLang == "")
            {
                UiLang = EditLangCurrent;
            }
            var userId = ajaxInfo.GetXmlPropertyInt("genxml/hidden/userid");

            EntityTypeCode = ajaxInfo.GetXmlProperty("genxml/hidden/entitytypecode");
            if (EntityTypeCode == "")
            {
                EntityTypeCode = "CATEGORY";                       // default to category
            }
            UiLang          = NBrightBuyUtils.GetUILang(ajaxInfo);
            EditLangCurrent = editlang;
            if (EditLangCurrent == "")
            {
                EditLangCurrent = NBrightBuyUtils.GetEditLang(ajaxInfo);
            }

            if (!paramCmd.ToLower().Contains("save"))
            {
                // pickup nextlang, indicates if we are changing languages. (Don't use if saving data, only for getting next language.)
                EditLangCurrent = NBrightBuyUtils.GetNextLang(ajaxInfo, EditLangCurrent);
            }

            if (PluginUtils.CheckPluginSecurity(PortalSettings.Current.PortalId, "propertiesvalue"))
            {
                switch (paramCmd)
                {
                case "property_admin_getlist":
                    strOut = categoryFunctions.CategoryAdminList(context, "property", EditLangCurrent);
                    break;

                case "property_admin_getdetail":
                    strOut = categoryFunctions.CategoryAdminDetail(context, 0, EditLangCurrent);
                    break;

                case "property_admin_addnew":
                    strOut = categoryFunctions.CategoryAdminAddNew(context, "property");
                    break;

                case "property_admin_savelist":
                    strOut = categoryFunctions.CategoryAdminSaveList(context);
                    break;

                case "property_admin_save":
                    strOut = categoryFunctions.CategorySave(context, EditLangCurrent);
                    break;

                case "property_admin_saveexit":
                    strOut = categoryFunctions.CategorySave(context, EditLangCurrent);
                    break;

                case "property_admin_movecategory":
                    strOut = categoryFunctions.MoveCategoryAdmin(context, "property");
                    break;

                case "property_admin_delete":
                    strOut = categoryFunctions.DeleteCategory(context, "property");
                    break;

                case "property_updateimages":
                    strOut = categoryFunctions.UpdateCategoryImages(context, EditLangCurrent);
                    break;

                case "property_getproductselectlist":
                    var productFunctions = new ProductFunctions();
                    strOut = productFunctions.ProductAdminList(context, true, EditLangCurrent, "", true);
                    break;

                case "property_selectchangehidden":
                    strOut = categoryFunctions.CategoryHidden(context);
                    break;

                case "property_selectcatxref":
                    strOut = categoryFunctions.SelectCatXref(context, EditLangCurrent);
                    break;

                case "property_deletecatxref":
                    strOut = categoryFunctions.DeleteCatXref(context);
                    break;

                case "property_deleteallcatxref":
                    strOut = categoryFunctions.DeleteAllCatXref(context, EditLangCurrent);
                    break;
                }
            }

            switch (paramCmd)
            {
            case "property_categoryproductlist":
                strOut = categoryFunctions.GetCategoryProductList(context, EditLangCurrent);
                break;

            case "property_removeimage":
                strOut = categoryFunctions.RemoveCategoryImage(context, EditLangCurrent);
                break;

            case "property_displayproductselect":
                strOut = categoryFunctions.CategoryProductSelect(context, EditLangCurrent);
                break;
            }

            return(strOut);
        }