Пример #1
0
        private void button1_Click(object sender, EventArgs e)
        {
            if (textBox1.Text.Equals(""))
            {
                MessageBox.Show("Lutfen parametrelerinizi kontrol ediniz");
            }
            else
            {
                User admin = new User();

                if (admin.RezervasyonIptal(textBox1.Text) == 1)
                {
                    MessageBox.Show("Rezervasyon silindi");
                }
                else
                {
                    MessageBox.Show("Rezervasyon bulunamadi");

                }
            }
        }
Пример #2
0
        //read existing xml data
        private User[] parse_xml(String filename)
        {
            XmlDocument doc = new XmlDocument();
            doc.Load(filename);
            XmlNode node = doc.SelectSingleNode("/GarageInfo");
            XmlNodeList nodeList = node.ChildNodes;
            int i = nodeList.Count;
            User[] all_usr = new User[i];

            //read all data into User[] array
            for(int j=0;j<i;j++)
            {
                XmlNode internal_node = nodeList.Item(j);
                if (internal_node != null)
                {
                    User user = new User();
                    user.NAME = internal_node.Attributes["name"].Value;
                    user.CAR_NUMBER = internal_node.Attributes["carnum"].Value;
                    user.PHONE_NUMBER = internal_node.Attributes["phonenum"].Value;
                    user.TIME = internal_node.Attributes["TIME"].Value;
                    all_usr[j] = user;
                }
            }
            return all_usr;
        }