예제 #1
0
 public void LoadFromDao(captor c)
 {
     CaptorId      = c.captorId;
     Serial_number = c.serial_number;
     Description   = c.description;
     Localisation  = c.localisation;
 }
예제 #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);
        }
예제 #3
0
파일: Program.cs 프로젝트: benesy/projet4
        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();
        }