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("surgical_residual")]
    public class SurgicalResidual : BindableBase
    {
        //[SugarColumn(ColumnName = "id")]
        //public int Id { get; set; }
        [SugarColumn(ColumnName = "order_no", IsPrimaryKey = true)]
        public string OrderNo { get; set; }
        [SugarColumn(ColumnName = "send_no")]
        public string SendNo { get; set; }
        [SugarColumn(ColumnName = "drug_id")]
        public string DrugId { get; set; }
        //public string residual_dose { get; set; }
        [SugarColumn(ColumnName = "create_time")]
        public DateTime CreateTime { get; set; }
        //使用量
        [SugarColumn(ColumnName = "use_dose")]
        public string UseDose { get; set; }
        //剩余量
        [SugarColumn(ColumnName = "residual_dose")]
        public string ResidualDose { get; set; }
        [SugarColumn(ColumnName = "dose_unit")]
        public string DoseUnit { get; set; }
        //余液处置时间
        [SugarColumn(ColumnName = "disposal_time")]
        public string DisposalTime { get; set; }
        //数量
        [SugarColumn(ColumnName = "quantity")]
        public int Quantity { get; set; }
        //病人ID
        [SugarColumn(ColumnName = "patient_id")]
        public string PatientId { get; set; }
        //病人
        [SugarColumn(ColumnName = "patient_name")]
        public string PName { get; set; }
        //性别
        [SugarColumn(ColumnName = "sex")]
        public string Sex { get; set; }
        //毒麻柜使用的状态
        [SugarColumn(ColumnName = "dm_status")]
        public int DmStatus { get; set; }
        //批次
        [SugarColumn(ColumnName = "manu_no")]
        public string ManuNo { get; set; }
        //麻醉师工号
        [SugarColumn(ColumnName = "anaesthetist_code")]
        public string DoctorCode { get; set; }
        //药品信息
        [Navigate(NavigateType.ManyToOne, nameof(DrugId))]
        public DrugInfo DrugInfo { get; set; }
        //使用量+单位
        [SugarColumn(IsIgnore = true)]
        public string UseDoseInfo
        {
            get => UseDose == null ? "" : UseDose + DoseUnit;
        }
        /// 
        /// 剩余量+单位
        /// 
        [SugarColumn(IsIgnore = true)]
        public string ResidualDoseInfo
        {
            get => ResidualDose == null ? "" : ResidualDose + DoseUnit;
        }
        /// 
        /// 是否选中
        /// 
        private bool _itemIsChecked;
        [SugarColumn(IsIgnore = true)]
        public bool ItemIsChecked { get => _itemIsChecked; set => SetProperty(ref _itemIsChecked, value); }
    }
}