123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131 |
- using MeterVision.db;
- using System;
- using System.Collections.Generic;
- using System.ComponentModel;
- using System.Linq;
- using System.Runtime.CompilerServices;
- using System.Text;
- using System.Threading.Tasks;
- namespace MeterVision.model
- {
- //标准模板目录
- public class StandItem : INotifyPropertyChanged
- {
- public event PropertyChangedEventHandler PropertyChanged;
- protected void OnPropertyChanged(string propertyName)
- {
- PropertyChanged?.Invoke(this, new PropertyChangedEventArgs(propertyName));
- }
- private int _index;
- public int Index
- {
- get => _index;
- set
- {
- if (_index != value)
- {
- _index = value;
- OnPropertyChanged(nameof(Index));
- }
- }
- }
- public string StandId { get; set; }
- public string CreateTime { get; set; }
- public string StandTime => GetStandTime();
- private string _standName;
- public string StandName
- {
- get => _standName;
- set
- {
- if(_standName != value)
- {
- _standName = value;
- OnPropertyChanged(nameof(StandName));
- }
- }
- }
- public int StandType { get; set; }
- public string StandTypeName
- {
- get
- {
- //return StandType == 1 ? "自定义" :
- // (StandType == 2 ? "导入" : string.Empty);
- return StandType == 1 ? "⚙️[自建模板]" : " 📊[导入Excel]";
- //(StandType == 2 ? "导入" : string.Empty);
- }
- }
- public string StandTypeNameColor
- {
- get
- {
- return StandType == 1 ? "#007BFF" : "#28A745";
- }
- }
- private int _standCount;
- public int StandCount
- {
- get => _standCount;
- set
- {
- if(_standCount != value)
- {
- _standCount = value;
- OnPropertyChanged(nameof(StandCount));
- }
- }
- }
- //标准模板的文件全路径+文件名称
- public string StandFile { get; set; }
- public string StandFileName
- {
- get
- {
- if (StandFile != String.Empty)
- {
- return ThisApp.GetFileNameWithoutExtension(StandFile);
- }
- return string.Empty;
- }
- }
- private string GetStandTime()
- {
- if(CreateTime != string.Empty)
- {
- return ThisApp.ConvertDateFormat(CreateTime);
- }
- return string.Empty;
- }
- public StandItem()
- {
- }
- public StandItem(VStand vStand)
- {
- this.StandId = vStand.StandId;
- this.CreateTime = vStand.CreateTime;
- this.StandName = vStand.StandName;
- this.StandType = vStand.StandType;
- this.StandFile = vStand.StandFile;
- this.StandCount = vStand.StandCount;
- }
- ///////////////////////////////////////////
- }
- }
|