|
|
@ -1,4 +1,6 @@
|
|
|
|
using CommunityToolkit.Mvvm.ComponentModel;
|
|
|
|
using AduSkin.Controls.Metro;
|
|
|
|
|
|
|
|
using AduSkin.Controls;
|
|
|
|
|
|
|
|
using CommunityToolkit.Mvvm.ComponentModel;
|
|
|
|
using CommunityToolkit.Mvvm.Input;
|
|
|
|
using CommunityToolkit.Mvvm.Input;
|
|
|
|
using Prism.Events;
|
|
|
|
using Prism.Events;
|
|
|
|
using SlnMesnac.Model.domain;
|
|
|
|
using SlnMesnac.Model.domain;
|
|
|
@ -12,6 +14,7 @@ using System.Collections.ObjectModel;
|
|
|
|
using System.Linq;
|
|
|
|
using System.Linq;
|
|
|
|
using System.Text;
|
|
|
|
using System.Text;
|
|
|
|
using System.Threading.Tasks;
|
|
|
|
using System.Threading.Tasks;
|
|
|
|
|
|
|
|
using System.Windows.Forms;
|
|
|
|
using static MaterialDesignThemes.Wpf.Theme.ToolBar;
|
|
|
|
using static MaterialDesignThemes.Wpf.Theme.ToolBar;
|
|
|
|
|
|
|
|
|
|
|
|
namespace SlnMesnac.WPF.ViewModel.ProductDetails
|
|
|
|
namespace SlnMesnac.WPF.ViewModel.ProductDetails
|
|
|
@ -149,10 +152,21 @@ namespace SlnMesnac.WPF.ViewModel.ProductDetails
|
|
|
|
|
|
|
|
|
|
|
|
[RelayCommand]
|
|
|
|
[RelayCommand]
|
|
|
|
private void SavePrdouctInfo()
|
|
|
|
private void SavePrdouctInfo()
|
|
|
|
|
|
|
|
{
|
|
|
|
|
|
|
|
NoticeManager.NotifiactionShow.AddNotifiaction(new NotifiactionModel()
|
|
|
|
|
|
|
|
{
|
|
|
|
|
|
|
|
Title = "通知",
|
|
|
|
|
|
|
|
Content = $"保存产品信息",
|
|
|
|
|
|
|
|
NotifiactionType = EnumPromptType.Success
|
|
|
|
|
|
|
|
});
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
try
|
|
|
|
|
|
|
|
{
|
|
|
|
|
|
|
|
Task.Run(() =>
|
|
|
|
{
|
|
|
|
{
|
|
|
|
var info = ProductInfo;
|
|
|
|
var info = ProductInfo;
|
|
|
|
|
|
|
|
|
|
|
|
if(info != null)
|
|
|
|
if (info != null)
|
|
|
|
{
|
|
|
|
{
|
|
|
|
info.productImage = productImage;
|
|
|
|
info.productImage = productImage;
|
|
|
|
info.featureImage = featureImage;
|
|
|
|
info.featureImage = featureImage;
|
|
|
@ -164,7 +178,7 @@ namespace SlnMesnac.WPF.ViewModel.ProductDetails
|
|
|
|
var productFeatureInfo = ProductFeature.ToList();
|
|
|
|
var productFeatureInfo = ProductFeature.ToList();
|
|
|
|
//productFeatureInfo.ToList().ForEach(x => x.productCode = info.productCode);
|
|
|
|
//productFeatureInfo.ToList().ForEach(x => x.productCode = info.productCode);
|
|
|
|
|
|
|
|
|
|
|
|
foreach(var item in productFeatureInfo)
|
|
|
|
foreach (var item in productFeatureInfo)
|
|
|
|
{
|
|
|
|
{
|
|
|
|
item.productCode = info.productCode;
|
|
|
|
item.productCode = info.productCode;
|
|
|
|
if (item.objid != 0)
|
|
|
|
if (item.objid != 0)
|
|
|
@ -206,6 +220,41 @@ namespace SlnMesnac.WPF.ViewModel.ProductDetails
|
|
|
|
_product_paramServices.Insert(item);
|
|
|
|
_product_paramServices.Insert(item);
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
App.Current.Dispatcher.Invoke(() =>
|
|
|
|
|
|
|
|
{
|
|
|
|
|
|
|
|
NoticeManager.NotifiactionShow.AddNotifiaction(new NotifiactionModel()
|
|
|
|
|
|
|
|
{
|
|
|
|
|
|
|
|
Title = "通知",
|
|
|
|
|
|
|
|
Content = $"{info.productName}产品信息更新完成",
|
|
|
|
|
|
|
|
NotifiactionType = EnumPromptType.Success
|
|
|
|
|
|
|
|
});
|
|
|
|
|
|
|
|
});
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
else
|
|
|
|
|
|
|
|
{
|
|
|
|
|
|
|
|
App.Current.Dispatcher.Invoke(() =>
|
|
|
|
|
|
|
|
{
|
|
|
|
|
|
|
|
NoticeManager.NotifiactionShow.AddNotifiaction(new NotifiactionModel()
|
|
|
|
|
|
|
|
{
|
|
|
|
|
|
|
|
Title = "通知",
|
|
|
|
|
|
|
|
Content = $"产品信息保存失败,基本信息为空",
|
|
|
|
|
|
|
|
NotifiactionType = EnumPromptType.Error
|
|
|
|
|
|
|
|
});
|
|
|
|
|
|
|
|
});
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
});
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
}catch(Exception ex)
|
|
|
|
|
|
|
|
{
|
|
|
|
|
|
|
|
NoticeManager.NotifiactionShow.AddNotifiaction(new NotifiactionModel()
|
|
|
|
|
|
|
|
{
|
|
|
|
|
|
|
|
Title = "通知",
|
|
|
|
|
|
|
|
Content = $"产品信息保存异常:{ex.Message}",
|
|
|
|
|
|
|
|
NotifiactionType = EnumPromptType.Error
|
|
|
|
|
|
|
|
});
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|