Exemplo n.º 1
0
        public static void ToDisk(string surn, string nam, string secNam,
            string DateB, string DateS, int Sal,
            string expir, string posit)
        {
            using (var db = new TablesContext())
            {
                Database.SetInitializer<TablesContext>(null);
                var serm = new Temp();
                serm.NameV = "surn";
                serm.Value = surn;
                db.Temp.Add(serm);

                var nem = new Temp();
                nem.NameV = "nam";
                nem.Value = nam;
                db.Temp.Add(nem);

                var sec = new Temp();
                sec.NameV = "secNam";
                sec.Value = secNam;
                db.Temp.Add(sec);

                var dbirth = new Temp();
                dbirth.NameV = "DateB";
                dbirth.Value = DateB;
                db.Temp.Add(dbirth);

                var dstart = new Temp();
                dstart.NameV = "DateS";
                dstart.Value = DateS;
                db.Temp.Add(dstart);

                var sala = new Temp();
                sala.NameV = "Sal";
                sala.Value = Sal.ToString();
                db.Temp.Add(sala);

                var expr = new Temp();
                expr.NameV = "expir";
                expr.Value = expir;
                db.Temp.Add(expr);

                var post = new Temp();
                post.NameV = "posit";
                post.Value = posit;
                db.Temp.Add(post);

                db.SaveChanges();

            }
        }
Exemplo n.º 2
0
 private void AddTempValue(string name, string position)
 {
     using (var db = new TablesContext())
     {
         var post = new Temp();
         post.NameV = name;
         post.Value = position;
         db.Temp.Add(post);
     }
 }