Esempio n. 1
0
        private void loadButton_Click(object sender, EventArgs e)
        {
            GameData    ga     = new GameData();
            SeedTable   st     = new SeedTable();
            HelperClass helper = new HelperClass();;

            try
            {
                var loaddata = comboBox1.SelectedItem as GameData;
                //   byte [,]  Cells = helper.MakeLoadData(loaddata);
                ClearCells();
                Cells = helper.MakeLoadData(loaddata);
                if (cRun.Checked == true)
                {
                    cRun.Checked = false;
                }


                pView.Refresh();

                Populate();
            }
            catch
            {
                throw;
            }
        }
Esempio n. 2
0
        //Read

        public string LoadGame(SeedTable s)
        {
            using (Connection connection = new Connection())
            {
                var    objecttoLoad = s as SeedTable;
                string SeedString   = objecttoLoad.Seed.ToString();
                return(SeedString);
            }
        }
Esempio n. 3
0
        //Update

        public void EditSave(SeedTable s)
        {
            using (Connection connection = new Connection())
            {
                var objecttoedit = s as SeedTable;
                connection.SeedTables.AddOrUpdate(s);
                connection.SaveChanges();
            }
        }
Esempio n. 4
0
 //Create
 public void SaveGame(SeedTable s)
 {
     using (Connection connection = new Connection())
     {
         var gobjecttoAdd = s as SeedTable;
         connection.SeedTables.Add(s);
         connection.SaveChanges();
     }
 }
Esempio n. 5
0
        //Delete

        public void DeleteSave(SeedTable s)
        {
            using (Connection connection = new Connection())
            {
                int remID        = s.Id;
                var gametoremove = connection.SeedTables.Find(remID);
                connection.SeedTables.Remove(gametoremove);
                connection.SaveChanges();
            }
        }