Esempio n. 1
0
        public bool LoadForm()
        {
            Cursor.Current = Cursors.WaitCursor;
            UserControl content = new ucListProvider();

            Global.mainForm.pContent.Controls.Clear();
            pContent.Controls.Add(content);
            Cursor.Current = Cursors.Default;

            return(true);
        }
Esempio n. 2
0
 private void btnBack_Click(object sender, EventArgs e)
 {
     try
     {
         Cursor.Current = Cursors.WaitCursor;
         UserControl content = new ucListProvider();
         Global.mainForm.pContent.Controls.Clear();
         Global.mainForm.pContent.Controls.Add(content);
         Cursor.Current = Cursors.Default;
     }
     catch (Exception ex)
     {
         Mail.gestionaError(ex.Message); Global.error = true;
         MessageBox.Show("ERROR", "Charlotte", MessageBoxButtons.OK, MessageBoxIcon.Error);
     }
 }
Esempio n. 3
0
        private void btnRemove_Click(object sender, EventArgs e)
        {
            try
            {
                DialogResult result = MessageBox.Show("¿Quieres anular el ticket?", "Charlotte", MessageBoxButtons.YesNo, MessageBoxIcon.Question);

                if (result == DialogResult.Yes)
                {
                    if (Global.common.deleteTicketSQL(Global.idTicket))
                    {
                        Global.idTicket = 0;

                        MessageBox.Show("Ticket eliminado correctamente", "Charlotte", MessageBoxButtons.OK, MessageBoxIcon.Information);
                        Cursor.Current = Cursors.WaitCursor;
                        UserControl content = new ucListProvider();
                        Global.mainForm.pContent.Controls.Clear();
                        Global.mainForm.pContent.Controls.Add(content);
                        Cursor.Current = Cursors.Default;
                    }
                    else
                    {
                        MessageBox.Show("ERROR", "Charlotte", MessageBoxButtons.OK, MessageBoxIcon.Information);
                        Cursor.Current = Cursors.WaitCursor;
                        UserControl content = new ucListProvider();
                        Global.mainForm.pContent.Controls.Clear();
                        Global.mainForm.pContent.Controls.Add(content);
                        Cursor.Current = Cursors.Default;
                    }
                }
                else if (result == DialogResult.No)
                {
                    Cursor.Current = Cursors.WaitCursor;
                    UserControl content = new ucListProvider();
                    Global.mainForm.pContent.Controls.Clear();
                    Global.mainForm.pContent.Controls.Add(content);
                    Cursor.Current = Cursors.Default;
                }
            }
            catch (Exception ex)
            {
                Mail.gestionaError(ex.Message); Global.error = true;
                MessageBox.Show("ERROR", "Charlotte", MessageBoxButtons.OK, MessageBoxIcon.Error);
            }
        }
Esempio n. 4
0
        private void btnSave_Click(object sender, EventArgs e)
        {
            try
            {
                Cursor.Current = Cursors.WaitCursor;

                Global.common.insertProviderSQL(tbName.Text, tbAddress.Text, tbPhone.Text);

                Cursor.Current = Cursors.Default;

                MessageBox.Show("Proveedor guardado correctamente", "Charlotte", MessageBoxButtons.OK, MessageBoxIcon.Information);

                UserControl content = new ucListProvider();
                Global.mainForm.pContent.Controls.Clear();
                Global.mainForm.pContent.Controls.Add(content);
            }
            catch (Exception ex)
            {
                Mail.gestionaError(ex.Message); Global.error = true;
                MessageBox.Show("ERROR", "Charlotte", MessageBoxButtons.OK, MessageBoxIcon.Error);
            }
        }