コード例 #1
0
ファイル: Aplicador.cs プロジェクト: yovanych/Neurohipot
        public void Vsita_Previa_ASC(Control c)
        {
            try
            {
                if (VistaPrevia != null)
                {
                    VistaPrevia.Stop();
                }
                switch (this.Configuracion.Estimulo_ASC)
                {
                case 0:
                    this.VistaPrevia = new Vista_Previa_AS(this.Configuracion.Color_Fondo_ASC, this.Configuracion.Imagenes_ASC_IMG, c);
                    break;

                default:     //case 1:
                    this.VistaPrevia = new Vista_Previa_AS(this.Configuracion.Color_Fondo_ASC, this.Configuracion.Imagenes_ASC_FIG, c);
                    break;
                }
                VistaPrevia.Start();
            }
            catch (Exception)
            {
                throw new Exception(Resources.MSG_PreviewNotLoaded);
            }
        }
コード例 #2
0
        private void BT_Pantalla_Click(object sender, EventArgs e)
        {
            try
            {
                if (TB_Desde.Text == "")
                {
                    TB_Desde.Text = "1";
                }

                if (TB_Hasta.Text == "")
                {
                    TB_Hasta.Text = "9999";
                }

                ReportDocument reporte = new ListadoCursos();

                VistaPrevia rp = new VistaPrevia();
                rp.CargarReporte(reporte, "{Tema.Curso}>=" + TB_Desde.Text.Trim() + " AND {Tema.Curso}<=" + TB_Hasta.Text.Trim() + " AND {Tema.Curso}>0");
                rp.ShowDialog();
            }
            catch (Exception err)
            {
                MessageBox.Show(err.Message, "Error", MessageBoxButtons.OK, MessageBoxIcon.Error);
            }
        }
コード例 #3
0
        private VistaPrevia _PrepararReporte()
        {
            if (TB_DesdeSector.Text.Trim() == "")
            {
                TB_DesdeSector.Text = "0";
            }
            if (TB_HastaSector.Text.Trim() == "")
            {
                TB_HastaSector.Text = "9999";
            }

            // Eliminamos posibles nulos, actualizamos descripciones y reseteamos datos.
            _NormalizarDatos();

            string WDesdeSector = TB_DesdeSector.Text;
            string WHastaSector = TB_HastaSector.Text;

            DataTable WDatos = _ProcesarLegajos(WDesdeSector, WHastaSector);

            progressBar1.Visible = false;
            progressBar1.Value   = 0;

            VistaPrevia frm = new VistaPrevia();

            frm.CargarReporte(new wPromedioCalificacion(), "{Legajo.Renglon} = 1 AND {Legajo.PromedioII} = 1");
            return(frm);
        }
コード例 #4
0
        private void BT_Imprimir_Click(object sender, EventArgs e)
        {
            VistaPrevia frm = _PrepararVistaPrevia();

            frm.Imprimir();
            Close();
        }
コード例 #5
0
        private VistaPrevia _PrepararReporte()
        {
            if (TB_Desde.Text == "")
            {
                TB_Desde.Text = "1";
            }
            if (TB_Hasta.Text == "")
            {
                TB_Hasta.Text = "9999";
            }

            int Desd;

            int.TryParse(TB_Desde.Text, out Desd);
            int Hast;

            int.TryParse(TB_Hasta.Text, out Hast);

            ReportDocument reporte = new imprelegajo();

            if (rbSi.Checked)
            {
                reporte = new imprelegajoii();
            }

            VistaPrevia frm = new VistaPrevia();

            frm.CargarReporte(reporte,
                              "{Legajo.Codigo} in " + Desd + " to " + Hast + " AND {Legajo.FEgreso} in '' to '00/00/0000'");
            return(frm);
        }
コード例 #6
0
        private VistaPrevia _PrepararReporte()
        {
            if (TB_Desde.Text == "")
            {
                TB_Desde.Text = "1";
            }

            if (TB_Hasta.Text == "")
            {
                TB_Hasta.Text = "9999";
            }

            ReportDocument reporte = new ListadoLegajos();

            string WFiltro = " AND ({Legajo.FEgreso} = '  /  /    ' OR {Legajo.FEgreso} = '00/00/0000') ";

            if (!checkBox1.Checked)
            {
                WFiltro = "";
            }

            VistaPrevia rp = new VistaPrevia();

            rp.CargarReporte(reporte, "{Legajo.Codigo}>=" + TB_Desde.Text + " AND {Legajo.Codigo}<=" + TB_Hasta.Text + " AND {Legajo.Renglon}=1" + WFiltro);
            return(rp);
        }
コード例 #7
0
ファイル: Aplicador.cs プロジェクト: yovanych/Neurohipot
 public void Cerrar_Vista_Previa()
 {
     if (this.VistaPrevia != null)
     {
         VistaPrevia.Stop();
     }
 }
コード例 #8
0
        private void BT_Imprimir_Click(object sender, EventArgs e)
        {
            try
            {
                if (TB_Desde.Text == "")
                {
                    TB_Desde.Text = "1";
                }

                if (TB_Hasta.Text == "")
                {
                    TB_Hasta.Text = "9999";
                }

                ReportDocument reporte = new ListadoTemas();

                VistaPrevia rp = new VistaPrevia();
                rp.CargarReporte(reporte, "{Curso.Codigo}>=" + TB_Desde.Text.Trim() + " AND {Curso.Codigo}<=" + TB_Hasta.Text.Trim() + " AND {Curso.Codigo}>0");
                rp.Imprimir();

                TB_Desde.Text = "";
                TB_Hasta.Text = "";

                TB_Desde.Focus();
            }
            catch (Exception err)
            {
                MessageBox.Show(err.Message, "Error", MessageBoxButtons.OK, MessageBoxIcon.Error);
            }
        }
コード例 #9
0
 private void imprimirMorososToolStripMenuItem_Click(object sender, EventArgs e)
 {
     VistaPrevia.Document = ImprimirMorosos;
     if (VistaPrevia.ShowDialog() == DialogResult.OK)
     {
         ImprimirMorosos.Print();
     }
 }
コード例 #10
0
        private void btnImprimir_Click(object sender, EventArgs e)
        {
            ReportDocument reporte = new ListadoPerfiles();

            VistaPrevia rp = new VistaPrevia();

            rp.CargarReporte(reporte);
            rp.ShowDialog();
        }
コード例 #11
0
        private VistaPrevia _PrepararReporte()
        {
            // Actualizamos los datos de Personas y horas realizadas.
            Helper.ActualizarCantidadPersonasHoras(txtAno.Text);

            VistaPrevia frm = new VistaPrevia();

            frm.CargarReporte(new PlanCapacitacionAnual(), "{CronogramaII.Ano} = " + txtAno.Text + " AND {CronogramaII.Curso} = {Curso.Codigo}");
            return(frm);
        }
コード例 #12
0
        //Update the list view of the dictionary after an item has been added or removed
        public void UpdateItemsOnListaPreviaDeNumeros()
        {
            VistaPrevia.ItemsSource = Jugada_Puntos;
            VistaPrevia.Items.Refresh();
            VistaPrevia.SelectedIndex = VistaPrevia.Items.Count - 1;
            VistaPrevia.ScrollIntoView(VistaPrevia.SelectedItem);
            int    itemsTotal = Jugada_Puntos.Sum(v => v.Value);
            string price      = (itemsTotal.ToString() + ".00 € ");

            totalSum.Text = price;
        }
コード例 #13
0
        private VistaPrevia _PrepararVistaPrevia()
        {
            Helper.ActualizarCantidadPersonasHoras(txtAno.Text);
            Helper.ActualizarTipoCursada();

            CursosPendientesPorSector reporte = _PrepararReporte();

            VistaPrevia frm = new VistaPrevia();

            frm.CargarReporte(reporte);
            return(frm);
        }
コード例 #14
0
        private void BT_Imprimir_Click(object sender, EventArgs e)
        {
            try
            {
                VistaPrevia frm = _PrepararReporte();

                frm.Imprimir();
            }
            catch (Exception ex)
            {
                MessageBox.Show(ex.Message);
            }
        }
コード例 #15
0
ファイル: Aplicador.cs プロジェクト: yovanych/Neurohipot
 public void Vsita_Previa_PVA(Control c, Color[] colores, ImageSet listaIMG)
 {
     try
     {
         if (VistaPrevia != null)
         {
             VistaPrevia.Stop();
         }
         this.VistaPrevia = new Vista_Previa_PVA(c, colores, listaIMG);
         VistaPrevia.Start();
     }
     catch (Exception)
     {
         throw new Exception(Resources.MSG_PreviewNotLoaded);
     }
 }
コード例 #16
0
ファイル: Aplicador.cs プロジェクト: yovanych/Neurohipot
 public void Vsita_Previa_AP(Control c)
 {
     try
     {
         if (VistaPrevia != null)
         {
             VistaPrevia.Stop();
         }
         this.VistaPrevia = new Vista_Previa_AP(c);
         VistaPrevia.Start();
     }
     catch (Exception)
     {
         throw new Exception(Resources.MSG_PreviewNotLoaded);
     }
 }
コード例 #17
0
        private void btnAplicar_Click(object sender, EventArgs e)
        {
            if (cbHoja.ValueInt == 0)
            {
                System.Drawing.Printing.PaperSize paperSize = new System.Drawing.Printing.PaperSize("A4", 827, 1169);
                documento1.DefaultPageSettings.PaperSize = paperSize;
            }
            else
            {
                System.Drawing.Printing.PaperSize paperSize = new System.Drawing.Printing.PaperSize("Ticket", (int)(this.txtWidth.ValueInt / 0.254), (int)(this.txtHeight.ValueInt / 0.254) * EntradaCantidad.ValueInt);

                documento1.DefaultPageSettings.PaperSize = paperSize;
            }
            VistaPrevia.Document = documento1;
            VistaPrevia.Refresh();
            UpdateData();
        }
コード例 #18
0
ファイル: Aplicador.cs プロジェクト: yovanych/Neurohipot
 public void Vsita_Previa_ASS_Letras_Colores(Control c)
 {
     try
     {
         if (VistaPrevia != null)
         {
             VistaPrevia.Stop();
         }
         this.VistaPrevia = new Vista_Previa_AS_Letras_Colores(this.Configuracion.Letras_CASS_L[this.Configuracion.Letra_Diana_CASS_L].ToString(),
                                                               this.Configuracion.Color_LetraDiana_CASS_L, c);
         VistaPrevia.Start();
     }
     catch (Exception)
     {
         throw new Exception(Resources.MSG_PreviewNotLoaded);
     }
 }
コード例 #19
0
ファイル: Aplicador.cs プロジェクト: yovanych/Neurohipot
 public void Vsita_Previa_ASC_L(Control c)
 {
     try
     {
         this.VistaPrevia = new Vista_Previa_AS_Letras
                            (
             this.Configuracion.Color_Fondo_ASC_L,
             this.Configuracion.Color_Letras_ASC_L,
             this.Configuracion.Letras_ASC_L, c
                            );
         VistaPrevia.Start();
     }
     catch (Exception)
     {
         throw new Exception(Resources.MSG_PreviewNotLoaded);
     }
 }
コード例 #20
0
        private VistaPrevia _PrepararReporte()
        {
            Helper.ActualizarTipoCursada(ref progressBar1);

            TB_Mes.Text = TB_Mes.Text.PadLeft(2, '0');
            _ActualizarHorasCursadasNoProgramadas(TB_Año.Text, TB_Mes.Text);


            string WDesde = TB_Año.Text + "0131";
            string WHasta = TB_Año.Text + TB_Mes.Text.PadLeft(2, '0') + "31";

            VistaPrevia frm = new VistaPrevia();

            frm.CargarReporte(new PlanillaTemasNoProgramados(),
                              "{Cursadas.Curso} = {Curso.Codigo} AND {Cursadas.TipoCursada} = 1 AND {Cursadas.OrdFecha} in '" + WDesde +
                              "' to '" + WHasta + "'");
            return(frm);
        }
コード例 #21
0
ファイル: Aplicador.cs プロジェクト: yovanych/Neurohipot
 public void Vsita_Previa_ET(Control c, int intervaloSalida,
                             int anchoEstimulo, int altoEstimulo, int zonaOpaca, int areaCorrecta,
                             Color estimulo, Color colorZonaOpaca)
 {
     try
     {
         if (VistaPrevia != null)
         {
             VistaPrevia.Stop();
         }
         this.VistaPrevia = new Vista_Previa_ET(c, intervaloSalida, anchoEstimulo, altoEstimulo, zonaOpaca, areaCorrecta, estimulo, colorZonaOpaca);
         VistaPrevia.Start();
     }
     catch (Exception)
     {
         throw new Exception(Resources.MSG_PreviewNotLoaded);
     }
 }
コード例 #22
0
        private void btnImprimir_Click(object sender, EventArgs e)
        {
            if (!_ExisteCursada(txtCodigo.Text))
            {
                MessageBox.Show("No existe ninguna cursada con el codigo indicado");
                return;
            }

            if (MessageBox.Show("¿Desea Imprimir la Planilla?", "", MessageBoxButtons.YesNo, MessageBoxIcon.Question) == DialogResult.Yes)
            {
                // Imprimimos la planilla con las personas indicadas.
                VistaPrevia frm = new VistaPrevia();
                frm.CargarReporte(new planillacursada(), "{Cursadas.Curso} = {Curso.Codigo} AND {Cursadas.Legajo} = {Legajo.Codigo} AND {Legajo.Renglon} = 1 AND {Cursadas.Codigo} = " + txtCodigo.Text);
                frm.Imprimir();
            }

            btnLimpiar.PerformClick();
        }
コード例 #23
0
        private void Imprimir()
        {
            try
            {
                if (TB_Prove.Text == "")
                {
                    throw new Exception("Se debe ingresar el proveedor");
                }

                if (TB_Desde.Text == "")
                {
                    throw new Exception("Se debe ingresar la fecha desde donde se desea filtrar");
                }

                if (TB_Hasta.Text == "")
                {
                    throw new Exception("Se debe ingresar la fecha hasta donde se desea filtrar");
                }

                string PeriodoDesde = TB_Desde.Text.Substring(6, 4) + TB_Desde.Text.Substring(3, 2);

                string PeriodoHasta = TB_Hasta.Text.Substring(6, 4) + TB_Hasta.Text.Substring(3, 2);

                VistaPrevia frm = new VistaPrevia();
                frm.CargarReporte(new listaevaluatransportista(), "{EvaluaI.Periodo} IN '" + PeriodoDesde + "' to '" + PeriodoHasta + "' AND {EvaluaI.Proveedor} = '" + TB_Prove.Text + "' AND {EvaluaI.Proveedor} = {Proveedor.Proveedor}");
                if (Tipo == "Pantalla")
                {
                    frm.Show();
                }
                if (Tipo == "Imprimir")
                {
                    frm.Imprimir();
                }
                //DataTable dtEva = ETBOL.ListaListaProveFecha(PeriodoDesde, PeriodoHasta, TB_Prove.Text);

                //ImpreEvaTransp Impre = new ImpreEvaTransp(dtEva, Tipo, TB_Prove.Text, TB_DescProve.Text);
                //Impre.ShowDialog();
            }
            catch (Exception err)
            {
                MessageBox.Show(err.Message, "Error", MessageBoxButtons.OK, MessageBoxIcon.Error);
            }
        }
コード例 #24
0
        private void btnAceptar_Click(object sender, EventArgs e)
        {
            if (txtFecha.Text.Replace(" ", "").Length < 10)
            {
                return;
            }

            DataTable legajos = _TraerLegajos();

            VistaPrevia frm = new VistaPrevia();

            ReportDocument rpt = new ReporteListadoLegajosAActualizarAFecha();

            rpt.SetDataSource(legajos);
            rpt.SetParameterValue("Fecha", txtFecha.Text);

            frm.CargarReporte(rpt);
            frm.Show(this);
        }
コード例 #25
0
        private void btnImprimir_Click(object sender, EventArgs e)
        {
            VistaPrevia frm = new VistaPrevia();

            Reporte rpt = new Reporte();

            Detalles tabla = new Detalles();

            foreach (DataRow row in dtInformeDetalle.Rows)
            {
                DataRow _r = tabla.Tables[0].NewRow();

                _r["Clave"]               = row["Clave"];
                _r["Informe"]             = row["Informe"];
                _r["Orden"]               = row["Orden"];
                _r["Articulo"]            = row["Articulo"];
                _r["Aprobado"]            = (_EsPorDesvio(row["Laudo"].ToString()) || _DeterminarRechazado(row["Devuelta"].ToString()) == "") ? 1 : 0;
                _r["Desvio"]              = _EsPorDesvio(row["Laudo"].ToString()) ? 1 : 0;
                _r["Rechazado"]           = _DeterminarRechazado(row["Devuelta"].ToString()) == "X" ? 1 : 0;
                _r["Atraso"]              = _CalcularAtraso(Helper.OrdenarFecha(row["Fecha"].ToString()), Helper.OrdenarFecha(row["Fecha2"].ToString()));;
                _r["Cantidad"]            = double.Parse(row["Cantidad"].ToString());
                _r["SaldoOC"]             = double.Parse(row["SaldoOC"].ToString());
                _r["DesconOC"]            = double.Parse(row["DesconOC"].ToString());
                _r["EnvaseOC"]            = row["EnvaseOC"];
                _r["DescEnvaseOC"]        = row["DescEnvaseOC"];
                _r["FechaEntrega"]        = row["Fecha"];
                _r["FechaPosibleEntrega"] = "";
                _r["Proveedor"]           = WCodProv;
                _r["Plantas"]             = WPlantas;
                _r["Periodo"]             = WPeriodo;

                tabla.Tables[0].Rows.Add(_r);
            }

            rpt.SetDataSource(tabla);

            frm.CargarReporte(rpt);

            frm.Show();
        }
コード例 #26
0
        private VistaPrevia _PrepararReporteIII()
        {
            ReportDocument reporte = new imprelegajo();

            if (rbSi.Checked)
            {
                reporte = new imprelegajoii();
            }

            string WFiltro = "{Legajo.Perfil} = " + cmbPerfiles.SelectedValue;

            if (cmbPerfiles.SelectedIndex == 0)
            {
                WFiltro = "{Legajo.Perfil} in 0 to 9999";
            }

            VistaPrevia frm = new VistaPrevia();

            frm.CargarReporte(reporte,
                              "{Legajo.Codigo} in 0 to 9999 AND {Legajo.FEgreso} in '' to '00/00/0000' AND " + WFiltro);
            return(frm);
        }
コード例 #27
0
        private VistaPrevia _PrepararReporte()
        {
            ReportDocument reporte = new imprelegajo();

            if (CB_Observ.SelectedIndex == 1)
            {
                reporte = new imprelegajoii();
            }

            string WFiltroSectores = "{Legajo.Sector} = " + cmbSectores.SelectedValue;

            if (cmbSectores.SelectedIndex == 0)
            {
                WFiltroSectores = "{Legajo.Sector} in 0 to 9999";
            }

            VistaPrevia frm = new VistaPrevia();

            frm.CargarReporte(reporte,
                              "{Legajo.Codigo} in 0 to 9999 AND {Legajo.FEgreso} in '' to '00/00/0000' AND " + WFiltroSectores);
            return(frm);
        }
コード例 #28
0
        private VistaPrevia _PrepararReporte()
        {
            string WMes = TB_Mes.Text.PadLeft(2, '0');
            string WAno = TB_Año.Text;

            string WDesdeFecha = WAno + "0131";
            string WHastaFecha = WAno + WMes + "31";

            string ZCurso = "";
            int    ZPersonas = 0, ZPersonasRealizado = 0, ZPersonasRealizadoII = 0, ZMesesI = 0, ZMesesII = 0, ZPaso = 0;
            double ZHoras = 0, ZHorasRealizado = 0, ZHorasRealizadoII = 0, ZHorasII = 0, ZHorasRealizadosIII = 0;
            string ZCorte = "";

            DataTable WCronogramaII = new DataTable();

            DataTable WCronograma = new DataTable();

            WCronograma.Columns.Add("Legajo", typeof(string));
            WCronograma.Columns.Add("Curso", typeof(string));
            WCronograma.Columns.Add("Horas", typeof(double));

            using (SqlConnection conn = new SqlConnection())
            {
                conn.ConnectionString = ConfigurationManager.ConnectionStrings["Surfactan"].ConnectionString;
                conn.Open();

                using (SqlCommand cmd = new SqlCommand())
                {
                    WCronogramaII.Rows.Clear();

                    cmd.Connection  = conn;
                    cmd.CommandText =
                        "SELECT Curso, Mes1, Mes2, Mes3, Mes4, Mes5, Mes6, Mes7, Mes8, Mes9, Mes10, Mes11, Mes12 FROM CronogramaII WHERE Ano = '" +
                        WAno + "'";

                    using (SqlDataReader dr = cmd.ExecuteReader())
                    {
                        if (dr.HasRows)
                        {
                            WCronogramaII.Load(dr);
                        }
                    }

                    progressBar1.Visible = true;
                    progressBar1.Value   = 0;
                    progressBar1.Maximum = WCronogramaII.Rows.Count;

                    Helper.ActualizarTipoCursada(ref progressBar1);

                    foreach (DataRow WCurso in WCronogramaII.Rows)
                    {
                        ZPersonas            = 0;
                        ZHoras               = 0;
                        ZPersonasRealizado   = 0;
                        ZHorasRealizado      = 0;
                        ZHorasII             = 0;
                        ZPersonasRealizadoII = 0;
                        ZHorasRealizadoII    = 0;
                        ZMesesI              = 0;
                        ZMesesII             = 0;
                        ZCorte               = "";

                        ZCurso = WCurso["Curso"].ToString();
                        //string ZAno = WCurso["Ano"].ToString();

                        cmd.CommandText = "SELECT Legajo, Curso, Horas, Realizado FROM Cronograma WHERE Curso = '" + ZCurso +
                                          "' AND Ano = '" + WAno + "' ORDER BY Legajo, Curso";

                        WCronograma.Rows.Clear();

                        using (SqlDataReader dr = cmd.ExecuteReader())
                        {
                            if (dr.HasRows)
                            {
                                while (dr.Read())
                                {
                                    string TempRealizado = dr["Realizado"] == null ? "0" : dr["Realizado"].ToString();
                                    string TempHoras     = dr["Horas"] == null ? "0" : dr["Horas"].ToString();

                                    if (ZCorte != dr["Legajo"].ToString())
                                    {
                                        ZPersonas++;
                                        if (double.Parse(TempRealizado) > double.Parse(TempHoras))
                                        {
                                            ZPersonasRealizado++;
                                        }
                                        ZCorte = dr["Legajo"].ToString();
                                    }

                                    ZHoras          += double.Parse(TempHoras);
                                    ZHorasRealizado += double.Parse(TempRealizado);

                                    DataRow ZRow = WCronograma.NewRow();

                                    ZRow["Legajo"] = dr["Legajo"] == null ? "0" : dr["Legajo"].ToString();
                                    ZRow["Curso"]  = dr["Curso"] == null ? "0" : dr["Curso"].ToString();
                                    ZRow["Horas"]  = dr["Horas"] == null ? "0" : dr["Horas"].ToString();

                                    WCronograma.Rows.Add(ZRow);
                                }
                            }
                        }

                        for (int i = 1; i < 12; i++)
                        {
                            string XMes = WCurso["Mes" + i].ToString();

                            if (XMes.ToUpper() == "X")
                            {
                                ZMesesI++;

                                if (int.Parse(i.ToString()) <= int.Parse(WMes))
                                {
                                    ZMesesII++;
                                }
                            }
                        }

                        ZCorte = "";
                        ZPersonasRealizadoII = 0;

                        foreach (DataRow XCurso in WCronograma.Rows)
                        {
                            ZHorasRealizadosIII = 0;
                            ZCurso = XCurso["Curso"].ToString();

                            cmd.CommandText =
                                "SELECT isnull(Horas, 0) as Horas FROM Cursadas WHERE TIpoCursada = 0 AND Legajo = '" +
                                XCurso["Legajo"] + "' AND Curso = '" + ZCurso + "' AND OrdFecha BETWEEN " + WDesdeFecha +
                                " AND " + WHastaFecha + " ORDER BY Legajo";

                            using (SqlDataReader dr = cmd.ExecuteReader())
                            {
                                if (dr.HasRows)
                                {
                                    while (dr.Read())
                                    {
                                        ZHorasRealizadoII   += double.Parse(dr["Horas"].ToString());
                                        ZHorasRealizadosIII += double.Parse(dr["Horas"].ToString());
                                    }
                                }
                            }

                            if (ZCorte != XCurso["Legajo"].ToString())
                            {
                                ZCorte = XCurso["Legajo"].ToString();
                                if (ZHorasRealizadosIII >= double.Parse(XCurso["Horas"].ToString()))
                                {
                                    ZPersonasRealizadoII++;
                                }
                            }
                        }

                        ZHorasII = 0;

                        if (ZMesesI != 0)
                        {
                            ZHorasII = Math.Round((ZHoras / ZMesesI) * ZMesesII, 0);
                        }

                        double ZPorce = 0, ZPorceII = 0;

                        if (ZHorasII != 0)
                        {
                            ZPorce = ZHorasRealizadoII / (ZHorasII / 100);
                        }

                        cmd.CommandText = "UPDATE CronogramaII SET "
                                          + " Personas = '" + ZPersonas + "',"
                                          + " PersonasRealizado = '" + ZPersonasRealizado + "',"
                                          + " PersonasRealizadoII = '" + ZPersonasRealizadoII + "',"
                                          + " Horas = '" + ZHoras.ToString().Replace(',', '.') + "',"
                                          + " HorasII = '" + ZHorasII.ToString().Replace(',', '.') + "',"
                                          + " HorasRealizado = '" + ZHorasRealizado.ToString().Replace(',', '.') + "',"
                                          + " HorasRealizadoII = '" + ZHorasRealizadoII.ToString().Replace(',', '.') + "',"
                                          + " Mes = '" + TB_Mes.Text + "',"
                                          + " Porce = '" + ZPorce.ToString().Replace(',', '.') + "',"
                                          + " PorceII = '" + ZPorceII.ToString().Replace(',', '.') + "'"
                                          + " WHERE Ano = '" + WAno + "'"
                                          + " AND "
                                          + " Curso = '" + ZCurso + "'";

                        cmd.ExecuteNonQuery();

                        progressBar1.Increment(1);
                    }
                }
            }

            progressBar1.Visible = false;

            VistaPrevia frm = new VistaPrevia();

            frm.CargarReporte(new wlistaevolucionTemasProgramados(),
                              "{CronogramaII.Curso} = {Curso.Codigo} AND {CronogramaII.Ano} In " + WAno + " To " + WAno);
            return(frm);
        }
コード例 #29
0
        private VistaPrevia _PrepararReporte()
        {
            string hastaFecha = "31/05/" + (int.Parse(TB_AñoDesde.Text) + 1);
            string desdeFecha = "01/06/" + TB_AñoDesde.Text;

            Helper.PurgarOrdFechaCursadas();
            Helper._ReprocesoCursosProgramadosYNoProgramados(desdeFecha, hastaFecha, 1);

            string WDesdeOrd = Helper.OrdenarFecha(desdeFecha);
            string WHastaOrd = Helper.OrdenarFecha(hastaFecha);

            DataTable WCursadas = new DataTable();

            progressBar1.Value   = 0;
            progressBar1.Visible = true;

            using (SqlConnection conn = new SqlConnection())
            {
                conn.ConnectionString = ConfigurationManager.ConnectionStrings["Surfactan"].ConnectionString;
                conn.Open();

                using (SqlCommand cmd = new SqlCommand())
                {
                    cmd.Connection  = conn;
                    cmd.CommandText = "UPDATE Legajo SET Horas = 0, HorasTotal = 0, Puntaje = 9";
                    cmd.ExecuteNonQuery();

                    cmd.CommandText =
                        "SELECT c.Curso, c.Legajo, c.Horas, c.Fecha, c.Clave, c.Tema, l.Descripcion, l.Puntaje, l.FEgreso, Activo = case l.Fegreso WHEN '00/00/0000' THEN 'S' WHEN '  /  /    ' THEN 'S' ELSE 'N' END FROM Cursadas c LEFT OUTER JOIN Legajo l ON L.Codigo = C.Legajo AND L.Renglon = 1 WHERE c.Ordfecha BETWEEN '" + WDesdeOrd + "' And '" + WHastaOrd + "' ORDER BY c.Clave";

                    using (SqlDataReader dr = cmd.ExecuteReader())
                    {
                        if (dr.HasRows)
                        {
                            WCursadas.Load(dr);
                        }
                    }

                    progressBar1.Maximum = WCursadas.Rows.Count + 10;

                    foreach (DataRow WLegajo in WCursadas.Rows)
                    {
                        string WFEgreso = Helper.OrDefault(WLegajo["FEgreso"].ToString(), "00/00/0000").ToString();

                        WLegajo["Puntaje"] = "0";

                        if (CB_Tipo.SelectedIndex == 1)
                        {
                            if (WFEgreso != "  /  /    " && WFEgreso != "00/00/0000")
                            {
                                WLegajo["Puntaje"] = "9";
                            }
                        }

                        cmd.CommandText = "UPDATE Legajo SET Puntaje = '" + WLegajo["Puntaje"] + "', Horas = Horas +'" + WLegajo["Horas"].ToString().Replace(',', '.') +
                                          "' WHERE Codigo = '" + WLegajo["Legajo"] + "'";
                        cmd.ExecuteNonQuery();

                        cmd.CommandText = "UPDATE Legajo SET HorasTotal = HorasTotal + '" +
                                          WLegajo["Horas"].ToString().Replace(',', '.') + "' WHERE Descripcion = '" +
                                          WLegajo["Descripcion"] + "'";
                        cmd.ExecuteNonQuery();

                        progressBar1.Increment(1);
                    }

                    //if (CB_Tipo.SelectedIndex == 0)
                    //{
                    //    cmd.CommandText =
                    //        "UPDATE Legajo SET Puntaje = '0' WHERE RIGHT(ISNULL(FEgreso, '00/00/0000'), 4)*1 = 0 Or RIGHT(FEgreso, 4)*1 < " +
                    //       Helper.Right(TB_AñoDesde.Text, 4) + "";
                    //    cmd.ExecuteNonQuery();
                    //    progressBar1.Increment(9);
                    //}

                    //if (CB_Tipo.SelectedIndex == 1)
                    //{
                    //    cmd.CommandText = "UPDATE Legajo SET Puntaje = '9' WHERE ISNULL(FEgreso, '  /  /    ') NOT IN ('00/00/0000', '  /  /    ')";
                    //    cmd.ExecuteNonQuery();
                    //    progressBar1.Increment(9);
                    //}
                }
            }

            progressBar1.Visible = false;
            progressBar1.Value   = 0;

            VistaPrevia frm = new VistaPrevia();

            frm.CargarReporte(new wHorasCursadasPorLegajo(),
                              "{Legajo.Renglon} = 1 AND {Legajo.Descripcion} <> '' AND {Legajo.HorasTotal} IN 0 TO 9999 AND {Legajo.Puntaje} = 0");
            return(frm);
        }
コード例 #30
0
 private void vistaPreviaToolStripMenuItem_Click(object sender, EventArgs e)
 {
     VistaPrevia.Document = ImprimirMorosos;
     VistaPrevia.ShowDialog();
 }