using CommunityToolkit.Mvvm.ComponentModel;
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
namespace BBWYB.Client.Models.PackPurchaseTask
{
///
/// 合格证
///
public class CertificateModel : ObservableObject
{
///
/// 合格证id
///
public long Id { get; set; }
public string PurchaseSkuId { get; set; }
///
/// skuid
///
public string SkuId { get; set; }
private string spuId;
///
/// 品牌
///
public string SpuId { get => spuId; set { SetProperty (ref spuId, value); } }
private string brand;
///
/// 品牌
///
public string Brand { get => brand; set { SetProperty(ref brand, value); } }
private string brandName;
///
/// 品名
///
public string BrandName { get => brandName; set { SetProperty(ref brandName, value); } }
private string shader;
///
/// 材质
///
public string Shader { get => shader; set { SetProperty(ref shader, value); } }
private string excuteStander;
///
/// 执行标准
///
public string ExcuteStander
{
get => excuteStander; set
{
SetProperty(ref excuteStander, value);
GetExcuteStanderFormat();
}
}
private string excuteStanderFormat;
///
/// 执行标准 (,=>换行)
///
public string ExcuteStanderFormat { get => excuteStanderFormat; set { SetProperty(ref excuteStanderFormat, value); } }
private string productShop;
///
/// 生产商
///
public string ProductShop { get => productShop; set { SetProperty(ref productShop, value); } }
private string productAdress;
///
/// 地址
///
public string ProductAdress { get => productAdress; set { SetProperty(ref productAdress, value); } }
private string productNo;
///
/// 型号(货号)
///
public string ProductNo { get => productNo; set { SetProperty(ref productNo, value); } }
/////
///// 生产日期
/////
//public DateTime ProductDate { get; set; }
///
/// 经销商
///
public string Reseller { get; set; }
private int isLogo;
///
/// 是否含3cLogo(0没有 ,1有)
///
public int IsLogo { get => isLogo; set { SetProperty(ref isLogo, value); } }
private string factoryNumber;
///
/// 工厂编号
///
public string FactoryNumber { get => factoryNumber; set { SetProperty(ref factoryNumber, value); } }
private string applyAge;
///
/// 适用年龄
///
public string ApplyAge { get => applyAge; set { SetProperty(ref applyAge, value); } }
private CertificateLabelModel labelModel;
public CertificateLabelModel LabelModel { get => labelModel; set { SetProperty(ref labelModel, value); } }
void GetExcuteStanderFormat()
{
StringBuilder sb = new StringBuilder();
if (!string.IsNullOrEmpty(ExcuteStander))
if (this.ExcuteStander.Contains(",") || this.ExcuteStander.Contains(","))//有逗号就拆分
{
var excutes = this.ExcuteStander.Split(new string[] { ",", "," }, StringSplitOptions.RemoveEmptyEntries);
for (int i = 0; i < excutes.Length; i++)
{
if (i % 2 == 0 && i > 0)//间隔两个换行
{
sb.Append("\r\n");
}
sb.Append(excutes[i]).Append(" ");
}
sb.Remove(sb.Length - 3, 3);
this.ExcuteStanderFormat = sb.ToString();
return;
}
this.ExcuteStanderFormat = ExcuteStander;
}
private long goodsNumber = 1;
///
/// 配件序号
///
public long GoodsNumber { get => goodsNumber; set { SetProperty(ref goodsNumber, value); } }
private string produceDate;
///
/// 生产日期
///
public string ProduceDate { get => produceDate; set { SetProperty(ref produceDate, value); } }
}
}