Exemple #1
0
 public static datas instance()
 {
     if (singleton == null)
     {
         singleton = new datas();
     }
     return(singleton);
 }
        private void textBox1_TextChanged(object sender, EventArgs e)
        {
            int i = 0;

            if (int.TryParse(textBox1.Text, out i))
            {
                this.Cursor = Cursors.WaitCursor;
                datas data = datas.instance();
                datas._customer.id_customer = Convert.ToInt32(textBox1.Text);
                datas._Customer cst = data.seachCustomer();
                write_type_drink(cst.type_drink);
                write_qtSucre(cst.qtsucre);
                write_mug(cst.mug);
                this.Cursor = Cursors.Default;
            }
        }
 private void button1_Click(object sender, EventArgs e)
 {
     try
     {
         label3.Text    = "";
         label3.Visible = true;
         this.Cursor    = Cursors.WaitCursor;
         datas data = datas.instance();
         datas._customer.id_customer = Convert.ToInt32(textBox1.Text);
         datas._customer.type_drink  = read_type_drink();
         datas._customer.qtsucre     = read_qtSucre();
         datas._customer.mug         = read_mug();
         Application.DoEvents();
         label3.Text = "Votre boisson est en cours ...";
         data.insertCustomer();
         Thread.Sleep(3000);
         label3.Text = "Votre boisson est préte.";
         this.Cursor = Cursors.WaitCursor;
     }
     catch (Exception ex)
     {
         this.Cursor = Cursors.WaitCursor;
     }
 }