20260831功能同步:

1. 不同车间区分料框查询、料框解绑接口
2. 注释电池型号逻辑
3. 打开电池状况界面
This commit is contained in:
Administrator
2026-08-31 13:54:07 +08:00
parent 6dfac6d986
commit c2ed98d52d
26 changed files with 1646 additions and 13 deletions
+31
View File
@@ -0,0 +1,31 @@
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
namespace JinYuan.DAL.Models
{
public static class ModelExtension
{
public static T ToModel<T>(this System.Data.DataRow row) where T : class, new()
{
if (row == null) return null;
T model = new T();
var type = typeof(T);
var properties = type.GetProperties();
foreach (var prop in properties)
{
if (row.Table.Columns.Contains(prop.Name))
{
var value = row[prop.Name];
if (value != DBNull.Value)
{
prop.SetValue(model, Convert.ChangeType(value, prop.PropertyType));
}
}
}
return model;
}
}
}