Exemplo n.º 1
0
        private void button2_Click(object sender, EventArgs e)
        {
            mainmenu m = new mainmenu();

            m.Show();
            this.Hide();
        }
Exemplo n.º 2
0
        private void button2_Click(object sender, EventArgs e)
        {
            StreamWriter sw = new StreamWriter("items.txt");

            foreach (KeyValuePair <int, Items> entry2 in data.b.item)
            {
                sw.WriteLine(entry2.Value.name + ',' + entry2.Value.color + ',' + entry2.Value.price + ',' + entry2.Value.category + ',' + entry2.Value.numOforders + ',' + entry2.Value.quantity + ',' + entry2.Value.brand);
            }

            sw.Close();
            mainmenu m = new mainmenu();

            m.Show();
            this.Hide();
        }
Exemplo n.º 3
0
 private void button1_Click(object sender, EventArgs e)
 {
     if (data.users[textBox1.Text].password == textBox2.Text)
     {
         StreamWriter sw = new StreamWriter("users.txt");
         foreach (KeyValuePair <string, User> entry in data.users)
         {
             sw.WriteLine(entry.Value.name + ',' + entry.Value.password + ',' + entry.Value.address + ',' + entry.Value.email);
         }
         sw.Close();
         data.user = textBox1.Text;
         this.Hide();
         mainmenu m = new mainmenu();
         m.Show();
     }
     else
     {
         MessageBox.Show("Username or Password is wrong");
     }
 }
Exemplo n.º 4
0
      private void cartt_Load(object sender, EventArgs e)
      {
          DataTable dt = new DataTable();
          dt.Columns.Add("name");
          dt.Columns.Add("price");
          dt.Columns.Add("color");
          dt.Columns.Add("brand");
 
          int price = 0;
          foreach (var i in data.cart)
          {
              dt.Rows.Add(data.b.item[i].name, data.b.item[i].price, data.b.item[i].color, data.b.item[i].brand);
              price += data.b.item[i].price;
              data.b.item[i].numOforders++;
              data.b.item[i].quantity--;
          }
          dataGridView1.DataSource = dt;
          label1.Text = price+"";
          //MessageBox.Show("Thank You, Confirmed!");
          mainmenu m = new mainmenu();
          m.Show();
          this.Hide();
      }