Exemplo n.º 1
0
 public void LoadFromDao(captor c)
 {
     CaptorId      = c.captorId;
     Serial_number = c.serial_number;
     Description   = c.description;
     Localisation  = c.localisation;
 }
Exemplo n.º 2
0
        public captor ConvertToDao()
        {
            captor c = new captor();

            c.captorId      = CaptorId;
            c.serial_number = Serial_number;
            c.description   = Description;
            c.localisation  = Localisation;

            return(c);
        }
Exemplo n.º 3
0
        static void Main(string[] args)
        {
            ClearDb();

            projet4Entities ctx = new projet4Entities();
            MCaptor         mc  = new MCaptor();

            mc.Serial_number = "482";
            mc.Localisation  = "ici";
            mc.Description   = "plop";
            captor cpt = mc.ConvertToDao();

            ctx.captor.Add(cpt);
            ctx.SaveChanges();
            Console.WriteLine("capteur : id {0} ajouté !", cpt.captorId);
            Console.ReadLine();
        }