示例#1
0
        private void button1_Click(object sender, EventArgs e)  //niii button save
        {
            label1.Text       = "Gate Open";
            pictureBox1.Image = WindowsFormsApplication1.Properties.Resources.Open;
            //myData.Write("N");

            try
            {
                Information info = new Information();
                info.Data1 = textBox3.Text;
                SaveXML.SaveData(info, "data.xml");
            }

            catch (Exception ex) {
                MessageBox.Show(ex.Message);
            }


            // plate = textBox3.Text;



            // CarPark.SavePlate((textBox3.Text));
            //string txt = CarPark.Car[i];
            // MessageBox.Show(Car[i], "System");
            //i++;
        }
 private void SaveLocation_Click(object sender, EventArgs e)
 {
     try
     {
         LocationInfo info = new LocationInfo();
         info.locationName        = LocationNameBox.Text;
         info.locationDescription = LocationDescBox.Text;
         info.locationItems       = textBox1.Text;
         info.locationItemsDesc   = textBox2.Text;
         info.locationExits       = LocationExits.Text;
         SaveXML.SaveData(info, "SavedData.xml"); // Saves the information put into the text boxes  / list boxes to a XML file.
     }
     catch (Exception ex)
     {
         MessageBox.Show(ex.Message);
     }
 }
示例#3
0
 private void buttonCreate_Click(object sender, EventArgs e)
 {
     try
     {
         if (!File.Exists("data.xml"))
         {
             Information info = new Information();
             info.Data1 = textBoxData1.Text;
             info.Data2 = textBoxData2.Text;
             info.Data3 = textBoxData3.Text;
             SaveXML.SaveData(info, "data.xml");
         }
     }
     catch (Exception ex)
     {
         MessageBox.Show(ex.Message);
     }
 }