using iWareCommon.Common.Dao; using iWareExcel.EXCEL.Entity; using iWareExcel.ORM; using System.Collections.Generic; using System.Linq; namespace iWareExcel.EXCEL.Dao { public class WorkCellDao : CommonDao { private static object Lock = new object(); private WorkCellDao() { } private static WorkCellDao Instance = null; /// /// 获取单例的方法 /// /// 角色服务的单例实体 public static WorkCellDao GetInstance() { if (Instance == null) { lock (Lock) { if (Instance == null) { Instance = new WorkCellDao(); } } } return Instance; } /// /// 该方法获取在WorkSheetEntity和ORM的EXCELWorkSheet之间字段的对应关系 /// protected override string GetColumnName(string name) { return WorkCellEntity.GetColumnName(name); } /// /// 获取WorkSheetEntity中属性名列表 /// /// WorkSheetEntity中属性名列表 protected override List GetColumnNames() { return WorkCellEntity.GetColumnMap().Keys.ToList(); } /// /// 将orm转为WorkSheetEntity中的实体 /// /// orm中的EXCELWorkSheet类 /// WorkSheetEntity protected override WorkCellEntity ToEntity(EXCELWorkCell s) { return new WorkCellEntity(s); } /// /// 将WorkSheetEntity转为ORM中的EXCELWorkSheet /// /// WorkSheetEntity类 /// orm中的EXCELWorkSheet类 protected override EXCELWorkCell ToOrm(WorkCellEntity t) { return t.ToOrm(); } /// /// 获取在WorkCellEntity的表名 /// protected override string GetTableName() { return WorkCellEntity.GetTableName(); } } }