Skip to content

Commit

Permalink
v3.6.1 - in Dev
Browse files Browse the repository at this point in the history
  • Loading branch information
leedavi committed Jun 29, 2017
1 parent 75f9a72 commit 74f6455
Show file tree
Hide file tree
Showing 6 changed files with 49 additions and 6 deletions.
32 changes: 30 additions & 2 deletions Components/Product/ProductFunctions.cs
Original file line number Diff line number Diff line change
Expand Up @@ -44,6 +44,9 @@ public static string ProcessCommand(string paramCmd,HttpContext context,string e
break;
case "product_admin_getdetail":
strOut = ProductFunctions.ProductAdminDetail(context);
break;
case "product_adminaddnew":
strOut = ProductFunctions.ProductAdminAddNew(context);
break;
case "product_admin_save":
strOut = ProductFunctions.ProductAdminSave(context);
Expand Down Expand Up @@ -122,7 +125,7 @@ public static string ProcessCommand(string paramCmd,HttpContext context,string e
return strOut;
}

public static String ProductAdminDetail(HttpContext context)
public static String ProductAdminDetail(HttpContext context, int productid = 0)
{
try
{
Expand All @@ -131,6 +134,7 @@ public static String ProductAdminDetail(HttpContext context)
var settings = NBrightBuyUtils.GetAjaxDictionary(context);
var strOut = "";
var selecteditemid = settings["selecteditemid"];
if (productid > 0) selecteditemid = productid.ToString();
if (Utils.IsNumeric(selecteditemid))
{

Expand Down Expand Up @@ -201,6 +205,26 @@ public static String ProductAdminSaveAs(HttpContext context)
}
}

public static String ProductAdminAddNew(HttpContext context)
{
try
{
var productid = ProductSave(context, true);
if (productid > 0)
{
return ProductAdminDetail(context, productid);
}
else
{
return "";
}
}
catch (Exception ex)
{
return ex.ToString();
}
}

public static String ProductAdminSave(HttpContext context)
{
try
Expand All @@ -221,7 +245,7 @@ public static String ProductAdminSave(HttpContext context)
}
}

private static void ProductSave(HttpContext context, bool newrecord = false)
private static int ProductSave(HttpContext context, bool newrecord = false)
{
if (NBrightBuyUtils.CheckManagerRights())
{
Expand Down Expand Up @@ -259,8 +283,12 @@ private static void ProductSave(HttpContext context, bool newrecord = false)
Utils.RemoveCache(strCacheKey);
DataCache.ClearCache();

return prdData.Info.ItemID;

}

}
return -1;
}

public static String ProductAdminList(HttpContext context, bool paging = true)
Expand Down
Binary file modified Installation/NBrightStore_03.06.01.00_DNN8_Install.zip
Binary file not shown.
2 changes: 1 addition & 1 deletion Plugins/readme.txt
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ Files

menu.config
-----------
Main default system menu (will be used for new systems and should include all suystem menu options)
Main default system menu (will be used for new systems and should include all system menu options)

*system.config
--------------
Expand Down
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ v3.6.1
- Fix to category Product Select.
- Fix Tax Drop Down to display description, not value.
- Add apply tax to all products in a category.

- Redisplay missing add button for products.

v3.6.0
- Convert Product Admin to Razor.
Expand Down
1 change: 1 addition & 0 deletions Themes/config/default/Admin_Product.cshtml
Original file line number Diff line number Diff line change
Expand Up @@ -45,6 +45,7 @@
<i class="fa fa-bars"></i>
</a>
<div class="actionbuttonwrapper">
<a id="productAdmin_cmdAddNew" class="btn btn-primary " href="#">@ResourceKey("General.cmdAddButton")</a>
<a id="productAdmin_cmdSaveExit" style="display: none;" class="btn btn-primary " href="#">@ResourceKey("General.cmdSaveExitButton")</a>
<a id="productAdmin_cmdSave" style="display: none;" class="btn btn-primary " href="#">@ResourceKey("General.cmdSaveButton")</a>
<a id="productAdmin_cmdSaveAs" style="display: none;" class="btn btn-warning " href="#">@ResourceKey("General.cmdSaveAsButton")</a>
Expand Down
18 changes: 16 additions & 2 deletions Themes/config/js/admin_product.js
Original file line number Diff line number Diff line change
Expand Up @@ -36,6 +36,13 @@
delay: { show: 100, hide: 200 }
});

$('#productAdmin_cmdAddNew').unbind("click");
$('#productAdmin_cmdAddNew').click(function () {
$('.processing').show();
$('#razortemplate').val('Admin_ProductDetail.cshtml');
nbxget('product_adminaddnew', '#nbs_productadminsearch', '#datadisplay');
});

if (e.cmd == 'product_admin_getlist') {

$('.processing').hide();
Expand All @@ -47,7 +54,8 @@
$("#productAdmin_cmdSaveAs").hide();
$("#productAdmin_cmdDelete").hide();
$("#productAdmin_cmdReturn").hide();

$("#productAdmin_cmdAddNew").show();

// Move products
$(".selectmove").hide();
$(".selectcancel").hide();
Expand Down Expand Up @@ -181,8 +189,13 @@
|| e.cmd == 'product_addproperty'
|| e.cmd == 'product_addrelated'
|| e.cmd == 'product_removerelated'
|| e.cmd == 'product_adminaddnew'
|| e.cmd == 'product_updateproductimages') {

// Copy the productid into the selecteditemid (for Add New Product)
$('#selecteditemid').val($('#itemid').val());


$('.processing').hide();

$('.productsearchpanel').hide();
Expand All @@ -192,6 +205,7 @@
$("#productAdmin_cmdSaveAs").show();
$("#productAdmin_cmdDelete").show();
$("#productAdmin_cmdReturn").show();
$("#productAdmin_cmdAddNew").hide();

$('#datadisplay').children().find('.sortelementUp').click(function () { moveUp($(this).parent()); });
$('#datadisplay').children().find('.sortelementDown').click(function () { moveDown($(this).parent()); });
Expand Down Expand Up @@ -292,7 +306,7 @@
$('#selecteditemid').val('');
nbxget('product_admin_getlist', '#nbs_productadminsearch', '#datadisplay');
});

$('#productAdmin_cmdSave').unbind("click");
$('#productAdmin_cmdSave').click(function () {
$('.processing').show();
Expand Down

0 comments on commit 74f6455

Please sign in to comment.