|
@@ -37,27 +37,6 @@ namespace Com.FirmLib.UI.Manufacturer
|
|
|
{
|
|
|
Product = new NameValueItem();
|
|
|
Brand = new NameValueItem();
|
|
|
- #region 测试数据
|
|
|
- //List<PropertyDefinition> definitons = new List<PropertyDefinition>();
|
|
|
- //definitons.Add(new PropertyDefinition() { Id = "1", Name = "信息点1", PropertyType = typeof(string) });
|
|
|
- //definitons.Add(new PropertyDefinition() { Id = "2", Name = "信息点2", PropertyType = typeof(int) });
|
|
|
- //definitons.Add(new PropertyDefinition() { Id = "3", Name = "信息点3", PropertyType = typeof(string) });
|
|
|
- //RefDefinitions = definitons;
|
|
|
- ////todo 根据参数加载项目信息
|
|
|
- //TypeItems = new ObservableCollection<TypeShowItem>();
|
|
|
- //for (int i = 0; i < 10; i++)
|
|
|
- //{
|
|
|
- // var tempItem = new TypeShowItem();
|
|
|
- // tempItem.TypeName = "型号" + (i + 1);
|
|
|
- // tempItem.MaintenancePeriod = 35;
|
|
|
- // tempItem.SeriviceLife = 40;
|
|
|
- // tempItem.Parameters = PropertyCollection.CreateCollection(definitons);
|
|
|
- // tempItem.Parameters["2"].Value = "信息点2信息";
|
|
|
- // tempItem.Parameters["1"].Value = "200";
|
|
|
- // tempItem.Parameters["3"].Value = "信息点3信息";
|
|
|
- // TypeItems.Add(tempItem);
|
|
|
- //}
|
|
|
- #endregion
|
|
|
}
|
|
|
|
|
|
|
|
@@ -181,7 +160,7 @@ namespace Com.FirmLib.UI.Manufacturer
|
|
|
}
|
|
|
catch (Exception e)
|
|
|
{
|
|
|
- MessageTip.Show(this.GetWindow(), "保存失败");
|
|
|
+ MessageTip.Show(this.GetWindow(), "删除失败");
|
|
|
}
|
|
|
|
|
|
}
|
|
@@ -289,6 +268,7 @@ namespace Com.FirmLib.UI.Manufacturer
|
|
|
resutMessage = "型号名称不能为空";
|
|
|
break;
|
|
|
}
|
|
|
+ #region 其他验证
|
|
|
//if (showItem.Parameters.Count > 1)
|
|
|
//{
|
|
|
// if (showItem.Parameters[0].Value == null || string.IsNullOrEmpty(showItem.Parameters[0].Value.ToString()))
|
|
@@ -301,8 +281,9 @@ namespace Com.FirmLib.UI.Manufacturer
|
|
|
// resutMessage = "使用寿命不能为空";
|
|
|
// break;
|
|
|
// }
|
|
|
- //}
|
|
|
-
|
|
|
+ //}
|
|
|
+ #endregion
|
|
|
+
|
|
|
int count = TypeItems.Count;
|
|
|
bool haseError = false;
|
|
|
for (int i = 0; i < count; i++)
|
|
@@ -339,11 +320,15 @@ namespace Com.FirmLib.UI.Manufacturer
|
|
|
{
|
|
|
bool flag = false;
|
|
|
ProductTypeItem dataItem = ConvertDataItem(item);
|
|
|
- if (string.IsNullOrEmpty(item.ProductTypeId))
|
|
|
+ if (string.IsNullOrWhiteSpace(item.ProductTypeId))
|
|
|
{
|
|
|
//添加
|
|
|
dataItem.ProductId = Product.Value.ToString();
|
|
|
flag=BllFactory<ProductTypeBll>.Instance.Add(dataItem);
|
|
|
+ if (flag)
|
|
|
+ {
|
|
|
+ item.ProductTypeId = dataItem.Id;
|
|
|
+ }
|
|
|
}
|
|
|
else
|
|
|
{
|