Пример #1
0
 public LogicalUnit MapFromBoToDao(object daoObj, LogicalUnit logicalUnitBo)
 {
     var logicalUnitDao = (DataRow)daoObj;
     logicalUnitBo.Id = int.Parse(logicalUnitDao["LogicalUnitID"].ToString());
     logicalUnitBo.Name = logicalUnitDao["Name"].ToString();
     return logicalUnitBo;
 }
Пример #2
0
        public static LogicalUnitDto AssembleDto(LogicalUnit logicalUnit)
        {
            LogicalUnitDto logicalUnitDto = new LogicalUnitDto();
            logicalUnitDto.id = logicalUnit.Id + 1;
            logicalUnitDto.text = logicalUnit.Name;
            logicalUnitDto.leaf = true;

            return logicalUnitDto;
        }
Пример #3
0
        private LogicalUnit[] GetLogicalUnitsFromDatabase()
        {
            var sqlResult = PDMSDataRetriever.ExecuteSQL("SELECT * FROM LogicalUnits WHERE LogicalUnitID IN(1,50,57)");

            LogicalUnit[] logicalUnits = new LogicalUnit[sqlResult.Tables[0].Rows.Count];

            for (int i = 0; i < sqlResult.Tables[0].Rows.Count; i++)
            {
                logicalUnits[i] = _logicalUnitMapper.MapFromBoToDao(sqlResult.Tables[0].Rows[i], LogicalUnit.NewLogicalUnit());
            }
            return logicalUnits;
        }
Пример #4
0
        public LogicalUnit[] GetLogicalUnitsFromXml()
        {
            var xmlDoc = XDocument.Parse(Informedica.GenPres.Data.Properties.Resources.patients);
            var logicalUnitsObj = from c in xmlDoc.Descendants("logicalunit")
                    select new
                    {
                        name = c.Attribute("name").Value
                    };

            var logicalUnits = new LogicalUnit[logicalUnitsObj.Count()];

            int id = 0;
            foreach (var logicalunit in logicalUnitsObj)
            {
                logicalUnits[id] = _xmlLogicalUnitMapper.MapFromBoToDao(id, logicalunit.name, LogicalUnit.NewLogicalUnit());
                id++;
            }

            return logicalUnits;
        }
Пример #5
0
 public LogicalUnit MapFromBoToDao(int id, string name, LogicalUnit logicalUnitBo)
 {
     logicalUnitBo.Id = id;
     logicalUnitBo.Name = name;
     return logicalUnitBo;
 }