Ejemplo n.º 1
0
 public static StarSystem ObjectToMessage(StarSystemViewModel ssvm)
 {
     var ss = new StarSystem
     {
         Id = ssvm.Id,
         Name = ssvm.Name,
         Uploader = ssvm.Uploader
     };
     return ss;
 }
Ejemplo n.º 2
0
 public static StarSystemViewModel MessageToObject(StarSystem starSystem)
 {
     var ssvm = new StarSystemViewModel
     {
         Id = starSystem.Id,
         Name = starSystem.Name,
         Uploader =  starSystem.Uploader
     };
     return ssvm;
 }
Ejemplo n.º 3
0
        public static StarSystem SystemSelectRow(int id)
        {
            IDataReader dr = DAL.StarSystem.SystemSelectRow(id);
            StarSystem system = new StarSystem();

            if (!dr.Read()) return system;
            system.Id = (int) dr["Id"];
            system.Name = (string) dr["Name"];
            system.Uploader = (string) dr["Uploader"];
            return system;
        }
Ejemplo n.º 4
0
        public static List<StarSystem> SystemSelectAll()
        {
            IDataReader dr = DAL.StarSystem.SystemSelectAll();
            var systemList = new List<StarSystem>();
            while (dr.Read())
            {
                var mySystem = new StarSystem
                {
                    Id = (int) dr["Id"],
                    Name = (string) dr["Name"],
                    Uploader = (string) dr["Uploader"]
                };

                systemList.Add(mySystem);
            }
            return systemList;
        }