Exemple #1
0
        private void MostrarProyectos()
        {
            SplashScreenManager.ShowForm(this, typeof(WaitForm1), true, true, false);
            SplashScreenManager.Default.SetWaitFormDescription("Recopilando informaciòn...");
            string cCodCompañia = "000000";

            Service.Reporte SDG = new Service.Reporte();
            if (MyStuff.UsaWCF == true)
            {
                DT_Proyecto = objWCF.Lista_FormulacionReporteProyecto_CentroCosto(cCodCompañia,
                                                                                  strCodTipoFormulacion,
                                                                                  strCodProyecto,
                                                                                  strCodCentroCosto
                                                                                  ).Tables[0];
            }
            else
            {
                DT_Proyecto = SDG.Lista_FormulacionReporteProyecto_CentroCosto(cCodCompañia,
                                                                               strCodTipoFormulacion,
                                                                               strCodProyecto,
                                                                               strCodCentroCosto
                                                                               ).Tables[0];
            }
            this.gridControlData.DataSource = DT_Proyecto;
            gridViewData.ExpandAllGroups();
            SplashScreenManager.CloseForm();
        }
        private void Cargadatos()
        {
            Service.DataGeneral          SDG = new Service.DataGeneral();
            Service.Reporte              SDR = new Service.Reporte();
            Model.Formulacion_Cabecera   MFC = new Model.Formulacion_Cabecera();
            Service.Formulacion_Cabecera SFC = new Service.Formulacion_Cabecera();
            string strCodCentroCosto         = MyStuff.CodigoCentroCosto;

            if (MyStuff.UsaWCF == true)
            {
                this.Cbo_AñoProceso.CargaDT(objWCF.Combo_AñoProceso("000000"));
                if (string.IsNullOrEmpty(Convert.ToString(this.Cbo_AñoProceso.SelectedValue)))
                {
                    this.Cbo_Version.CargaDT(objWCF.Combo_Version(MyStuff.AñoProceso));
                }
                else
                {
                    this.Cbo_Version.CargaDT(objWCF.Combo_Version(Convert.ToString(this.Cbo_AñoProceso.SelectedValue)));
                }
            }
            else
            {
                this.Cbo_AñoProceso.CargaDT(SFC.Combo_AñoProceso("000000"));
                if (string.IsNullOrEmpty(Convert.ToString(this.Cbo_AñoProceso.SelectedValue)))
                {
                    this.Cbo_Version.CargaDT(SFC.Combo_Version(MyStuff.AñoProceso));
                }
                else
                {
                    this.Cbo_Version.CargaDT(SFC.Combo_Version(Convert.ToString(this.Cbo_AñoProceso.SelectedValue)));
                }
            }

            if (MyStuff.UsaWCF == true)
            {
                DT_Tipo_Formulacion = objWCF.Combo_TipoFormulacion().Tables[0];
                MFC         = objWCF.Recupera_FormulacionCabecera(MyStuff.AñoProceso);
                DS_Proyecto = objWCF.Ayuda_Proyecto_Spring("000000", strCodCentroCosto);
            }
            else
            {
                DT_Tipo_Formulacion = SDG.Combo_TipoFormulacion().Tables[0];
                MFC         = SFC.Recupera_FormulacionCabecera(MyStuff.AñoProceso);
                DS_Proyecto = SDG.Ayuda_Proyecto_Spring("000000", strCodCentroCosto);
            }

            this.Txt_CodProyecto.nombreDS = DS_Proyecto;
            this.cbo_CodTipoFormulacion.CargaDT(DT_Tipo_Formulacion);
        }
        private void button1_Click(object sender, EventArgs e)
        {
            SplashScreenManager.ShowForm(this, typeof(WaitForm1), true, true, false);
            SplashScreenManager.Default.SetWaitFormDescription("Recopilando informaciòn...");

            if (MyStuff.UsaWCF == true)
            {
                DS_Formato4P = objWCF.Formato_4P("000000",
                                                 Convert.ToString(this.Cbo_AñoProceso.SelectedValue),
                                                 Convert.ToString(this.Cbo_Version.SelectedValue),
                                                 Convert.ToString(this.Txt_CodFuenteFinanciamiento.Value),
                                                 Convert.ToString(this.Txt_CodCentroCosto.Value),
                                                 Convert.ToString(this.Txt_CodProyecto.Value)
                                                 );
            }
            else
            {
                Service.Reporte SR = new Service.Reporte();
                DS_Formato4P = SR.Formato_4P("000000",
                                             Convert.ToString(this.Cbo_AñoProceso.SelectedValue),
                                             Convert.ToString(this.Cbo_Version.SelectedValue),
                                             Convert.ToString(this.Txt_CodFuenteFinanciamiento.Value),
                                             Convert.ToString(this.Txt_CodCentroCosto.Value),
                                             Convert.ToString(this.Txt_CodProyecto.Value)
                                             );
            }


            workbook = spreadsheetControl.Document;
            string sRutaInterna = Path.Combine(AppDomain.CurrentDomain.BaseDirectory, @"Excel\Formato4P.xlsx");

            workbook.LoadDocument(sRutaInterna, DocumentFormat.Xlsx);
            Worksheet worksheet_Formato4P = workbook.Worksheets[1];

            DV_Formato4P = DS_Formato4P.Tables[0].DefaultView;
            worksheet_Formato4P.DataBindings.BindToDataSource(DV_Formato4P, 1, 0);

            worksheet_Formato4P.Cells[2, 3].Value = "PRESUPUESTO DE INGRESOS Y EGRESOS AÑO " + Convert.ToString(this.Cbo_AñoProceso.SelectedValue);



            SplashScreenManager.CloseForm();
        }
Exemple #4
0
        private void MostrarContrato()
        {
            SplashScreenManager.ShowForm(this, typeof(WaitForm1), true, true, false);
            SplashScreenManager.Default.SetWaitFormDescription("Recopilando informaciòn...");
            string cCodCompañia = "000000";
            string cNumeroOrden = NroOrden.TrimEnd();
            string cTipoOrden   = TipoOrden.TrimEnd();

            if (MyStuff.UsaWCF == true)
            {
            }
            else
            {
                Service.Reporte SDG = new Service.Reporte();
                DT_Proyecto = SDG.Lista_FormulacionReporteContrato(cCodCompañia, cNumeroOrden, cTipoOrden).Tables[0];
            }
            this.gridControlData.DataSource = DT_Proyecto;
            gridViewData.ExpandAllGroups();
            SplashScreenManager.CloseForm();
        }
        private void MostrarProyectos()
        {
            SplashScreenManager.ShowForm(this, typeof(WaitForm1), true, true, false);
            SplashScreenManager.Default.SetWaitFormDescription("Recopilando informaciòn...");
            string cCodCompañia        = "000000";
            string cAñoProceso         = Convert.ToString(this.Cbo_AñoProceso.SelectedValue);
            string cVersion            = Convert.ToString(this.Cbo_Version.SelectedValue);
            string cCodTipoFormulacion = Convert.ToString(this.cbo_CodTipoFormulacion.SelectedValue);
            string CodProyecto         = Convert.ToString(this.Txt_CodProyecto.Value);

            Service.Reporte SDG = new Service.Reporte();
            if (MyStuff.UsaWCF == true)
            {
                DT_Proyecto = objWCF.Lista_FormulacionReporteProyecto(cCodCompañia, cAñoProceso, cVersion, cCodTipoFormulacion, CodProyecto).Tables[0];
            }
            else
            {
                DT_Proyecto = SDG.Lista_FormulacionReporteProyecto(cCodCompañia, cAñoProceso, cVersion, cCodTipoFormulacion, CodProyecto).Tables[0];
            }
            this.gridControlData.DataSource = DT_Proyecto;
            gridViewData.ExpandAllGroups();
            SplashScreenManager.CloseForm();
        }
 public void Select_Tipo_Formulacion()
 {
     try
     {
         Service.Reporte SDG = new Service.Reporte();
         if (MyStuff.UsaWCF == true)
         {
             DT_Tipo_Formulacion = objWCF.Help_FormulacionTipoFormulacion().Tables[0];
         }
         else
         {
             DT_Tipo_Formulacion = SDG.Help_FormulacionTipoFormulacion().Tables[0];
         }
         lookUpEditTipoFormulacion.Properties.DataSource    = DT_Tipo_Formulacion;
         lookUpEditTipoFormulacion.Properties.ValueMember   = "cCodTipoFormulacion";
         lookUpEditTipoFormulacion.Properties.DisplayMember = "cCodTipoFormulacion";
         lookUpEditTipoFormulacion.Properties.DisplayMember = "vNomTipoFormulacion";
     }
     catch (Exception ex)
     {
         XtraMessageBox.Show(ex.ToString(), "Mensaje", MessageBoxButtons.OK, MessageBoxIcon.Error);
     }
 }
Exemple #7
0
        private void button1_Click(object sender, EventArgs e)
        {
            SplashScreenManager.ShowForm(this, typeof(WaitForm1), true, true, false);
            SplashScreenManager.Default.SetWaitFormDescription("Recopilando informaciòn...");
            string strTipoMovimiento = "";

            if (this.Opt_Gasto.Checked == true)
            {
                strTipoMovimiento = "GASTO";

                if (MyStuff.UsaWCF == true)
                {
                    DS_Formato4P = objWCF.Lista_Formulacion_ResumenClasificador_Gasto("000000",
                                                                                      Convert.ToString(this.Cbo_AñoProceso.SelectedValue),
                                                                                      Convert.ToString(this.Cbo_Version.SelectedValue),
                                                                                      Convert.ToString(this.Txt_CodFuenteFinanciamiento.Value),
                                                                                      Convert.ToString(this.Txt_CodCentroCosto.Value),
                                                                                      Convert.ToString(this.Txt_CodProyecto.Value),
                                                                                      this.Opt_Grupo.CheckedIndex
                                                                                      );
                }
                else
                {
                    Service.Reporte SR = new Service.Reporte();
                    DS_Formato4P = SR.Lista_Formulacion_ResumenClasificador_Gasto("000000",
                                                                                  Convert.ToString(this.Cbo_AñoProceso.SelectedValue),
                                                                                  Convert.ToString(this.Cbo_Version.SelectedValue),
                                                                                  Convert.ToString(this.Txt_CodFuenteFinanciamiento.Value),
                                                                                  Convert.ToString(this.Txt_CodCentroCosto.Value),
                                                                                  Convert.ToString(this.Txt_CodProyecto.Value),
                                                                                  this.Opt_Grupo.CheckedIndex
                                                                                  );
                }
            }
            else
            {
                strTipoMovimiento = "INGRESO";
                if (MyStuff.UsaWCF == true)
                {
                    DS_Formato4P = objWCF.Lista_Formulacion_ResumenClasificador_Ingreso("000000",
                                                                                        Convert.ToString(this.Cbo_AñoProceso.SelectedValue),
                                                                                        Convert.ToString(this.Cbo_Version.SelectedValue),
                                                                                        Convert.ToString(this.Txt_CodFuenteFinanciamiento.Value),
                                                                                        Convert.ToString(this.Txt_CodCentroCosto.Value),
                                                                                        Convert.ToString(this.Txt_CodProyecto.Value),
                                                                                        this.Opt_Grupo.CheckedIndex
                                                                                        );
                }
                else
                {
                    Service.Reporte SR = new Service.Reporte();
                    DS_Formato4P = SR.Lista_Formulacion_ResumenClasificador_Ingreso("000000",
                                                                                    Convert.ToString(this.Cbo_AñoProceso.SelectedValue),
                                                                                    Convert.ToString(this.Cbo_Version.SelectedValue),
                                                                                    Convert.ToString(this.Txt_CodFuenteFinanciamiento.Value),
                                                                                    Convert.ToString(this.Txt_CodCentroCosto.Value),
                                                                                    Convert.ToString(this.Txt_CodProyecto.Value),
                                                                                    this.Opt_Grupo.CheckedIndex
                                                                                    );
                }
            }

            string strNombreFuenteFinanciamiento = Convert.ToString(this.Txt_NomFuenteFinanciamiento.Text);

            if (string.IsNullOrEmpty(Convert.ToString(this.Txt_NomFuenteFinanciamiento.Value)) == true)
            {
                strNombreFuenteFinanciamiento = "Todos";
            }

            string strNombreCentroCosto = Convert.ToString(this.Txt_NomCentroCosto.Text);

            if (string.IsNullOrEmpty(Convert.ToString(this.Txt_NomCentroCosto.Value)) == true)
            {
                strNombreCentroCosto = "Todos";
            }

            string strNombreProyecto = Convert.ToString(this.Txt_NomProyecto.Text);

            if (string.IsNullOrEmpty(Convert.ToString(this.Txt_NomProyecto.Value)) == true)
            {
                strNombreProyecto = "Todos";
            }

            switch (this.Opt_Grupo.CheckedIndex)
            {
            case 0:
                this.Grupo_Clasificador(strTipoMovimiento,
                                        strNombreFuenteFinanciamiento,
                                        strNombreCentroCosto,
                                        strNombreProyecto
                                        );
                break;

            case 1:
                this.Grupo_CentroCostoClasificador(strTipoMovimiento,
                                                   strNombreFuenteFinanciamiento,
                                                   strNombreCentroCosto,
                                                   strNombreProyecto
                                                   );
                break;

            default:
                this.Grupo_ProyectoClasificador(strTipoMovimiento,
                                                strNombreFuenteFinanciamiento,
                                                strNombreCentroCosto,
                                                strNombreProyecto
                                                );
                break;
            }
            SplashScreenManager.CloseForm();
        }
Exemple #8
0
        private void button1_Click(object sender, EventArgs e)
        {
            SplashScreenManager.ShowForm(this, typeof(WaitForm1), true, true, false);
            SplashScreenManager.Default.SetWaitFormDescription("Recopilando informaciòn...");

            if (MyStuff.UsaWCF == true)
            {
                DS_Detalle = objWCF.Reporte_Detalle_Formulacion("000000",
                                                                Convert.ToString(this.Cbo_AñoProceso.SelectedValue),
                                                                Convert.ToString(this.Cbo_Version.SelectedValue),
                                                                Convert.ToString(this.Txt_CodFuenteFinanciamiento.Value),
                                                                Convert.ToString(this.Txt_CodCentroCosto.Value),
                                                                Convert.ToString(this.Txt_CodProyecto.Value)
                                                                );
            }
            else
            {
                Service.Reporte SR = new Service.Reporte();
                DS_Detalle = SR.Reporte_Detalle_Formulacion("000000",
                                                            Convert.ToString(this.Cbo_AñoProceso.SelectedValue),
                                                            Convert.ToString(this.Cbo_Version.SelectedValue),
                                                            Convert.ToString(this.Txt_CodFuenteFinanciamiento.Value),
                                                            Convert.ToString(this.Txt_CodCentroCosto.Value),
                                                            Convert.ToString(this.Txt_CodProyecto.Value)
                                                            );
            }


            workbook = spreadsheetControl.Document;
            string sRutaInterna = Path.Combine(AppDomain.CurrentDomain.BaseDirectory, @"Excel\FormulacionDetalle.xlsx");

            workbook.LoadDocument(sRutaInterna, DocumentFormat.Xlsx);
            Worksheet worksheet_Detalle = workbook.Worksheets[0];

            DV_Detalle = DS_Detalle.Tables[0].DefaultView;
            worksheet_Detalle.DataBindings.BindToDataSource(DV_Detalle, 6, 0);

            worksheet_Detalle.Cells[2, 1].Value = Convert.ToString(this.Cbo_AñoProceso.SelectedValue);
            worksheet_Detalle.Cells[3, 1].Value = Convert.ToString(this.Cbo_Version.SelectedValue);

            Range  boundrange_Detalle = worksheet_Detalle.DataBindings[0].Range;
            int    intFilaInicial     = boundrange_Detalle.TopRowIndex + 1;
            int    intFila            = boundrange_Detalle.BottomRowIndex + 1;
            string strRango           = "";
            string strCelda           = "";
            string strLetra           = "";

            for (var c = 16; c < 33; c++)
            {
                strLetra = traeLetraColumna(c);
                strRango = strLetra.TrimEnd() + Convert.ToString(intFilaInicial) + ":" + strLetra.TrimEnd() + Convert.ToString(intFila);
                strCelda = strLetra.TrimEnd() + Convert.ToString(intFila + 2);
                worksheet_Detalle.Cells[strCelda].Formula   = "= SUM(" + strRango.TrimEnd() + ")";
                worksheet_Detalle.Cells[strCelda].Font.Bold = true;
            }

            ////Creamos una nueva hoja
            //Worksheet pivotWorksheet = workbook.Worksheets.Add();

            //Worksheet worksheetPivot = workbook.Worksheets[1];

            //worksheetPivot.Name = "Pivot";

            ////Creamos un pivot table

            //string strLetraColumnaInicial = traeLetraColumna(boundrange_Detalle.LeftColumnIndex + 1);
            //string strLetraColumnaFinal = traeLetraColumna(boundrange_Detalle.RightColumnIndex + 1);

            //strRango = strLetraColumnaInicial.TrimEnd() + Convert.ToString(intFilaInicial) + ":" + strLetraColumnaFinal.TrimEnd() + Convert.ToString(intFila);

            //PivotTable pivottable = pivotWorksheet.PivotTables.Add(worksheet_Detalle[strRango], pivotWorksheet["A7"]);

            //PivotTable pt = workbook.Worksheets[1].PivotTables[0] as PivotTable;
            //pt.Cache.Refresh();

            SplashScreenManager.CloseForm();
        }