Exemple #1
0
 public void addWp(IList<WP> wp)
 {
     var db = new Database();
     foreach(var w in wp)
         db.WPs.InsertOnSubmit(w);
     db.SubmitChanges();
 }
Exemple #2
0
 public List<Vessel> getAllVessel()
 {
     var db = new Database();
     List<Vessel> query = (from ves in db.Vessels
                  select ves).ToList<Vessel>();
     return query;
     
 }           
Exemple #3
0
 public int AddNewRace(Race r)
 {
     var db = new Database();
     db.Races.InsertOnSubmit(r);
     db.SubmitChanges();
     int id = r.Id;
     return id;
 }
Exemple #4
0
        public void AddVesselsToRace(int idR, int[] idV)
        {
            var db = new Database();
            for(int i=0;i<idV.Length;i++)
            {
                var v = new VesselsInRace
                {
                    RaceId = idR,
                    VesselId = idV[i]                    
                };
                db.VesselsInRaces.InsertOnSubmit(v);
            }

            db.SubmitChanges();
        }
Exemple #5
0
 public void AddVesselToDB(string name, string class_,string nation, string nr,decimal tcf) 
 {
     var vessel = new Vessel
     {
         Name = name,
         Class = class_,
         Nationality = nation,
         RaceNumber = nr,
         TCF = tcf
     };
     Database db = new Database();
     db.Vessels.InsertOnSubmit(vessel);
     
     db.SubmitChanges();            
    
 }