Beispiel #1
0
        private void btnPrayTimes_Click(object sender, EventArgs e)
        {
            PrayTimes pt = new PrayTimes();

            pt.Show();
        }
Beispiel #2
0
        /********************************************************************************************/
        /// <summary>
        /// read PrayTime1.xml file and show the data it the label
        /// </summary>
        private void PrayTimesRead()
        {
            XmlDocument xmlDoc = new XmlDocument();

            if (!File.Exists("PrayTimes.xml"))
            {
                PrayTimes pt = new PrayTimes();
                pt.PraySet();
            }
            else
            {
                xmlDoc.Load("PrayTimes.xml");
                XmlNodeList nodeList = xmlDoc.DocumentElement.SelectNodes("/Table/Pray");
                string      PrayID = "", PrayName = "", PrayTime = "";
                foreach (XmlNode node in nodeList)
                {
                    PrayID   = node.SelectSingleNode("Pray_id").InnerText;
                    PrayName = node.SelectSingleNode("PrayName").InnerText;
                    PrayTime = node.SelectSingleNode("PrayTime").InnerText;
                    if (PrayID == "1")
                    {
                        lblPrayTimes1.Text   = PrayName;
                        lblPrayTimes1_1.Text = PrayTime;
                    }
                    if (PrayID == "2")
                    {
                        lblPrayTimes2.Text   = PrayName;
                        lblPrayTimes2_2.Text = PrayTime;
                    }
                    if (PrayID == "3")
                    {
                        lblPrayTimes3.Text   = PrayName;
                        lblPrayTimes3_3.Text = PrayTime;;
                    }
                    if (PrayID == "4")
                    {
                        lblPrayTimes4.Text   = PrayName;
                        lblPrayTimes4_4.Text = PrayTime;
                    }
                    if (PrayID == "5")
                    {
                        lblPrayTimes5.Text   = PrayName;
                        lblPrayTimes5_5.Text = PrayTime;
                    }
                    if (PrayID == "6")
                    {
                        lblPrayTimes6.Text   = PrayName;
                        lblPrayTimes6_6.Text = PrayTime;
                    }
                    if (PrayID == "7")
                    {
                        lblPrayTimes7.Text   = PrayName;
                        lblPrayTimes7_7.Text = PrayTime;;
                    }
                    if (PrayID == "8")
                    {
                        lblPrayTimes8.Text   = PrayName;
                        lblPrayTimes8_8.Text = PrayTime;
                    }
                    if (PrayID == "9")
                    {
                        lblPrayTimes9.Text   = PrayName;
                        lblPrayTimes9_9.Text = PrayTime;
                    }
                    if (PrayID == "10")
                    {
                        lblPrayTimes10.Text    = PrayName;
                        lblPrayTimes10_10.Text = PrayTime;
                    }
                    if (PrayID == "11")
                    {
                        lblPrayTimes11.Text    = PrayName;
                        lblPrayTimes11_11.Text = PrayTime;;
                    }
                    if (PrayID == "12")
                    {
                        lblPrayTimes12.Text    = PrayName;
                        lblPrayTimes12_12.Text = PrayTime;
                    }
                }
            }
        }