XiangTan_JiaoJie_Bak/DM_Weight/Models/ChannelList.cs

214 lines
6.3 KiB
C#
Raw Normal View History

2025-01-06 09:40:32 +08:00
using Prism.Commands;
using Prism.Mvvm;
using SqlSugar;
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
namespace DM_Weight.Models
{
[SugarTable("channel_list")]
public class ChannelList : BindableBase
{
/// <summary>
///
///</summary>
[SugarColumn(ColumnName = "chnguid", IsPrimaryKey = true)]
//[SugarColumn(ColumnName = "id", IsPrimaryKey = true)]
public string Id { get; set; }
/// <summary>
///
/// 默认值: NULL
///</summary>
[SugarColumn(ColumnName = "machine_id")]
public string MachineId { get; set; }
/// <summary>
///
/// 默认值: NULL
///</summary>
[SugarColumn(ColumnName = "row_no")]
public int DrawerNo { get; set; }
/// <summary>
///
/// 默认值: NULL
///</summary>
[SugarColumn(ColumnName = "col_no")]
public int ColNo { get; set; }
/// <summary>
///
/// 默认值: NULL
///</summary>
[SugarColumn(ColumnName = "pos_no")]
public int PosNo { get; set; }
/// <summary>
///
/// 默认值: NULL
///</summary>
[SugarColumn(ColumnName = "drug_id")]
public string DrugId { get; set; }
///// <summary>
/////
///// 默认值: NULL
/////</summary>
//[SugarColumn(ColumnName = "manu_no")]
//public string ManuNo { get; set; }
/// <summary>
///
///这个值 用于控制柜子使用与未使用的状态
///自始至终未使用是空值,打开了则记录当前打开时间,根据时间修改按钮颜色
///</summary>
[SugarColumn(ColumnName = "eff_date")]
public string EffDate { get; set; }
///// <summary>
/////
///// 默认值: NULL
/////</summary>
//[SugarColumn(ColumnName = "quantity")]
//public int Quantity { get; set; }
/// <summary>
///
/// 默认值: 1 (公共药箱值为1归属个人药箱值为0)
///</summary>
[SugarColumn(ColumnName = "drawer_type")]
public int DrawerType { get; set; }
/// <summary>
///
/// 药箱状态 1药箱在0药箱不在药箱在时开药箱为取药箱药箱不在时开药箱为还药箱
///</summary>
[SugarColumn(ColumnName = "drawer_state")]
public int DrawerState { get; set; }
/// <summary>
///
/// 默认值: 1
///</summary>
[SugarColumn(IsIgnore =true)]
public int BoardType { get; set; }
/// <summary>
///
/// 默认值: 1
///</summary>
//[SugarColumn(IsIgnore = true)]
[SugarColumn(ColumnName = "state")]
public int? State { get; set; }
[SugarColumn(IsIgnore = true)]
public bool IsSelected { get; set; }
[SugarColumn(IsIgnore = true)]
public InOutInvoice Invoice { get; set; }
[SugarColumn(IsIgnore = true)]
public string Location
{
get => DrawerNo + "-" + ColNo;
}
[SugarColumn(ColumnName ="yh_no")]
public string BelongUser
{
get;set;
}
//private int _addQuantity = 0;
//[SugarColumn(IsIgnore = true)]
//public int AddQuantity
//{
// get => _addQuantity;
// set
// {
// SetProperty(ref _addQuantity, value);
// }
//}
//private int _takeQuantity = 0;
//[SugarColumn(IsIgnore = true)]
//public int TakeQuantity
//{
// get => _takeQuantity;
// set
// {
// if (value > Quantity)
// {
// throw new ArgumentException("取药数量不能大于库存");
// }
// SetProperty(ref _takeQuantity, value);
// }
//}
//private int _returnQuantity = 0;
//[SugarColumn(IsIgnore = true)]
//public int ReturnQuantity
//{
// get => _returnQuantity;
// set
// {
// SetProperty(ref _returnQuantity, value);
// }
//}
//private int _checkQuantity = 0;
//[SugarColumn(IsIgnore = true)]
//public int CheckQuantity
//{
// get => _checkQuantity;
// set
// {
// if (value < 0)
// {
// throw new ArgumentException("盘点数量不能是负数");
// }
// SetProperty(ref _checkQuantity, value);
// }
//}
//[SugarColumn(IsIgnore = true)]
//public int? CanReturnQuantity { get; set; }
private DrugInfo? _DrugInfo;
[Navigate(NavigateType.ManyToOne, nameof(DrugId))]
public DrugInfo Drug { get => _DrugInfo; set => SetProperty(ref _DrugInfo, value); }
//[SugarColumn(IsIgnore = true)]
//public int process { get; set; } = 0;
private DrugManuNo? _drugManuNo;
[SugarColumn(IsIgnore = true)]
public DrugManuNo? drugManuNo { get => _drugManuNo; set => SetProperty(ref _drugManuNo, value); }
private List<ChannelStock>? _channelStocks;
[Navigate(NavigateType.OneToMany, nameof(ChannelStock.Chnguid))]
public List<ChannelStock> channelStocks { get => _channelStocks; set => SetProperty(ref _channelStocks, value); }
//private DelegateCommand<ChannelList> _addManunoCommand;
//[SugarColumn(IsIgnore = true)]
//public DelegateCommand<ChannelList> AddManunoCommand
//{
// get
// {
// if (_addManunoCommand == null)
// _addManunoCommand = new DelegateCommand<ChannelList>(o => DoDelete(o));
// return _addManunoCommand;
// }
//}
//private void DoDelete(ChannelList parameter)
//{
//}
//药品规格
private string _drugSpec;
[SugarColumn(ColumnName = "drug_manu_no")]
public string DrugSpec { get=> _drugSpec;set=>SetProperty(ref _drugSpec, value); }
}
}