Files
Web_AUTSDATA_Mvc_Prod/AUTS.Domain/Application/NurseScheduleStatisticsModel.cs
2025-11-20 13:11:05 +08:00

39 lines
1.2 KiB
C#
Raw Blame History

This file contains invisible Unicode characters
This file contains invisible Unicode characters that are indistinguishable to humans but may be processed differently by a computer. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.
using System;
using System.Collections.Generic;
using System.Dynamic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
namespace AUTS.Domain
{
public class NurseScheduleStatisticsModel : DynamicObject
{
public string EmpName { get; set; }
public string TotalHour { get; set; }
public string TotalWork { get; set; }
Dictionary<string, object> Properties = new Dictionary<string, object>();
public override bool TrySetMember(SetMemberBinder binder, object value)
{
if (!Properties.Keys.Contains(binder.Name))
{
//在此可以做一些小动作
//if (binder.Name == "Col")
//  Properties.Add(binder.Name + (Properties.Count), value.ToString());
//else
//  Properties.Add(binder.Name, value.ToString());
Properties.Add(binder.Name, value.ToString());
}
return true;
}
public override bool TryGetMember(GetMemberBinder binder, out object result)
{
return Properties.TryGetValue(binder.Name, out result);
}
}
}