Пример #1
0
        private void refresh_Click(object sender, EventArgs e)
        {
            FirstPageForm fr = new FirstPageForm();

            fr.Show();
            this.Hide();
        }
Пример #2
0
        private void rateBtn_Click(object sender, EventArgs e)
        {
            RateMe        xml  = new RateMe();
            List <string> rate = new List <string>();

            try
            {
                foreach (DataGridViewRow row in dataGridView1.Rows)
                {
                    foreach (DataGridViewColumn column in dataGridView1.Columns)
                    {
                        if (column.Index != 0 && column.Index != 5)
                        {
                            bool a = Convert.ToBoolean(row.Cells[column.Index].Value);
                            if (a)
                            {
                                string criteria = Convert.ToString(row.Cells[0].Value);
                                string header   = dataGridView1.Columns[column.Index].HeaderText;
                                rate.Add(criteria);
                                rate.Add(header);
                            }
                        }
                    }
                }
                //Console.WriteLine(rate);
                //Checking if the xml file is present or not
                bool exist = File.Exists("../../../rates.xml");
                if (!exist)
                {
                    MessageBox.Show("No xml file");
                    //creating a xml file if it does not exist.

                    xml.CreateXML();
                }
                else
                {
                    MessageBox.Show("Rating Completed, Xml file present");
                }
                xml.updateXML(rate, now.ToString());


                FirstPageForm fr = new FirstPageForm();

                fr.Show();
                this.Hide();
            }
            catch
            {
                MessageBox.Show("Please rate all the criteria");
            }
        }
Пример #3
0
        private void catogeryAddition_Click(object sender, EventArgs e)
        {
            if (catogeryAddTxt.Text == "")
            {
                MessageBox.Show("Please add Something");
            }
            else
            {
                CatogeryAdditionAdmin category = new CatogeryAdditionAdmin(catogeryAddTxt.Text);

                //RateMe.ReadCategory() is defined as static class so it is easier and reuse of the code

                catogeryList.DataSource = RateMe.ReadCategory();
                catogeryAddTxt.Text     = "";
                MessageBox.Show("Success");
                //ratedata();
                //rateMe_Enter();

                FirstPageForm fr = new FirstPageForm();
                fr.Show();
                this.Hide();
            }
        }