private void btnGenerar_Click(object sender, EventArgs e)
 {
     if (cmbEdificios.CheckedItems.Count > 0)
     {
         bool todo = true;
         if (cmbEdificios.CheckedItems.Count < cmbEdificios.Items.Count)
         {
             todo = false;
             MessageBox.Show("Solo se generaran las liquidaciones, no el CSV ni informe de emision", "Sistema");
         }
         DateTime periodo = DateTime.Parse("1/" + this.periodo.Value.Month + "/" + this.periodo.Value.Year);
         List<edificio> edificios = new List<edificio>();
         foreach(edificio ed in cmbEdificios.CheckedItems)
         {
             edificios.Add(ed);
         }
         LoadingForm loading = new LoadingForm();
         (new Thread(() => loading.ShowDialog())).Start();
         Business.ControladorInformes.generarAllLiquidaciones(edificios, todo,periodo, vto1.Value, vto2.Value, txtTextoAlPie.Text, Properties.Resources.emergencias, Properties.Resources.qr, Properties.Resources.tijera);
         Invoke(new Action(() => loading.Close()));
         if (MessageBox.Show("Desea abrir la carpeta con los archivos generados?", "Sistema", MessageBoxButtons.YesNo) == DialogResult.Yes)
             //System.Diagnostics.Process.Start(@"Liquidaciones\" + edi.direccion + periodo.Month + "-" + periodo.Year + ".pdf");
             System.Diagnostics.Process.Start("Liquidaciones\\" + periodo.Month + " del " + periodo.Year);
         this.Close();
     }
     else
         MessageBox.Show("Seleccione al menos un edificio", "Sistema");
 }
 private void btnGenerar_Click(object sender, EventArgs e)
 {
     LoadingForm loading = new LoadingForm();
     try {
         DateTime periodo = DateTime.Parse("1/" + this.periodo.Value.Month + "/" + this.periodo.Value.Year);
         (new Thread(() => loading.ShowDialog())).Start();
         Business.ControladorInformes.generarLiquidacionesUnidad(((edificio)cmbEdificios.SelectedItem), periodo, (unidad)cmbUnidad.SelectedItem, Properties.Resources.emergencias, Properties.Resources.qr, Properties.Resources.tijera);
         Invoke(new Action(() => loading.Close()));
         if (MessageBox.Show("Desea abrir la carpeta con la liquidacion generada?", "Sistema", MessageBoxButtons.YesNo) == DialogResult.Yes)
             //System.Diagnostics.Process.Start(@"Liquidaciones\" + edi.direccion + periodo.Month + "-" + periodo.Year + ".pdf");
             System.Diagnostics.Process.Start(@"Liquidaciones\" + periodo.Month + " del " + periodo.Year + "/");
         this.Close();
     }
     catch (Exception ex)
     {
         Invoke(new Action(() => loading.Close()));
         MessageBox.Show("Esta funcion solo esta disponible si ya se generaron las liquidaciones del edificio", "Sistema");
     }
 }
        private void btnGenerar_Click(object sender, EventArgs e)
        {
            if (cmbEdificios.CheckedItems.Count > 0)
            {
                var output = new List<edificio>(cmbEdificios.CheckedItems.Count);
                output.AddRange(cmbEdificios.CheckedItems.Cast<edificio>());

                LoadingForm loading = new LoadingForm();
                (new Thread(() => loading.ShowDialog())).Start();
                Business.ControladorInformes.generarInformeUnidadesEdificio(output);
                Invoke(new Action(() => loading.Close()));
                if (MessageBox.Show("Desea abrir la carpeta con los archivos generados?", "Sistema", MessageBoxButtons.YesNo) == DialogResult.Yes)
                    //System.Diagnostics.Process.Start(@"Liquidaciones\" + edi.direccion + periodo.Month + "-" + periodo.Year + ".pdf");
                    System.Diagnostics.Process.Start("Listados unidades\\");
                this.Close();
            }
            else
                MessageBox.Show("Seleccione al menos un edificio", "Sistema");
        }
示例#4
0
 private void Administracion_FormClosing(object sender, FormClosingEventArgs e)
 {
     LoadingForm loading = new LoadingForm();
     try
     {
         Thread t;
         t = new Thread(() => loading.ShowDialog());
         t.Start();
         Process p = new Process();
         p.StartInfo.FileName = "mysql_stop.bat";
         p.StartInfo.WindowStyle = ProcessWindowStyle.Hidden;
         p.Start();
         Invoke(new Action(() => loading.Close()));
     }
     catch (Exception exc)
     {
         Invoke(new Action(() => loading.Close()));
         this.Close();
     }
 }
示例#5
0
 private void Administracion_Load(object sender, EventArgs e)
 {
     LoadingForm loading = new LoadingForm();
     try
     {
         Thread t;
         t = new Thread(() => loading.ShowDialog());
         t.Start();
         iniciarDB();
         Invoke(new Action(() => loading.Close()));
         string[] args = Environment.GetCommandLineArgs();
         if (args.Count() > 1)
             //Hubo update
             (new Novedades()).ShowDialog();
     }
     catch (Exception ex)
     {
         try
         {
             Process p = new Process();
             p.StartInfo.FileName = "mysql_start.bat";
             p.StartInfo.WindowStyle = ProcessWindowStyle.Hidden;
             p.Start();
             iniciarDB();
             Invoke(new Action(() => loading.Close()));
             string[] args = Environment.GetCommandLineArgs();
             if (args.Count() > 1)
                 //Hubo update
                 (new Novedades()).ShowDialog();
         }
         catch (Exception exc)
         {
             Invoke(new Action(() => loading.Close()));
             MessageBox.Show("No se puede conectar al servidor, pruebe mas tarde..", "Sistema");
             this.Close();
         }
     }
 }
示例#6
0
 private void btnInformeCobros_Click(object sender, EventArgs e)
 {
     LoadingForm loading = new LoadingForm();
     (new Thread(() => loading.ShowDialog())).Start();
     Business.ControladorInformes.generarInformeDeEmision(DateTime.Now);
     String nombre = "Informe de emision " + DateTime.Now.Month + "-" + DateTime.Now.Year + ".pdf";
     Invoke(new Action(() => loading.Close()));
     if (MessageBox.Show("Desea abrir el informe?", "Sistema", MessageBoxButtons.YesNo) == DialogResult.Yes)
         System.Diagnostics.Process.Start(@"Informes\" + nombre);
 }