Пример #1
0
 private void EditarRegistrosCajas_Load(object sender, EventArgs e)
 {
     this.Location = new Point(0, 0);
     reg = new Registro();
     acercaDe = new About();
     if (reg.obtenerClientes())
     {
         foreach (string clien in reg.ListaClientes)
             cmbClientes.Items.Add(clien);
     }
     this.crearDataGridView(dgvRegistros);
     if (user.EsAdmin)
         toolStrip_cmdAdministracionSistema.Enabled = true;
     else
         toolStrip_cmdAdministracionSistema.Enabled = false;
     registrosDeCajasToolStripMenuItem.Enabled = false;
 }
Пример #2
0
 private void EtiquetasCaja_FormClosing(object sender, FormClosingEventArgs e)
 {
     if (e.CloseReason == CloseReason.UserClosing)
     {
         if (reg != null)
         {
             reg = null;
             this.Hide();
             this.Dispose();
             return;
         }
         if (MessageBox.Show(this, "¿Está seguro(a) que desea salir del programa?", "Cerrando", MessageBoxButtons.OKCancel, MessageBoxIcon.Warning) == DialogResult.OK)
         {
             MatarProcesosWordExcel();
             Application.Exit();
         }  
         else
             e.Cancel = true;
     }
 }
Пример #3
0
 public EtiquetasCaja(Usuario u, Registro r)
 {
     InitializeComponent();
     reg = r;
     user = u;
     ChecarEstadoDeRegistro();
     InicializarObjetosYEventos(true);
     Uri pathDB = new Uri("file://" + rutasEnModAdmin.RutaDeAccess);
     connAccess.ConnectionString = @"Provider=Microsoft.ACE.OLEDB.12.0; Data" + @" Source=" + pathDB.LocalPath + "; ";
 }
Пример #4
0
        private void restart_Click(object sender, EventArgs e)
        {
            this.Cursor = Cursors.WaitCursor;
            appWord.DisplayAlerts = Word.WdAlertLevel.wdAlertsNone;
            for (int i = 0; i < documentosWord.Keys.Count; i++)
            {
                if (documentosWord.ContainsKey(i))
                {
                    documentosWord[i].Save();
                    documentosWord[i].Saved = true;
                    ((Microsoft.Office.Interop.Word._Document)documentosWord[i]).Close();
                }
            }
            ((Microsoft.Office.Interop.Word._Application)appWord).Quit();
            System.Runtime.InteropServices.Marshal.ReleaseComObject(appWord);

            if (rpt != null)
            {
                rpt.cerrarProcesos();
                rpt = null;
            }
            this.MatarProcesosWordExcel();
            cmdBorrarDatos_Click(sender, e);
            foreach (Control bt in this.Controls)
                if (bt.Name == "cmdRestart")
                    bt.Dispose();
            if (reg != null)
            {
                this.Hide();
                this.Dispose();
                reg = null;
            }
            btnTerminar = null;
            this.Cursor = Cursors.Default;
        }