Ejemplo n.º 1
0
        public void ShowMe(string cCodCompañia,
                           string strcodCentroCosto,
                           string strNomCentroCosto,
                           int intLinea
                           )
        {
            this.Text = "Proyecto y Fuente de Financiamiento para la linea: " + Convert.ToString(intLinea);

            strCodCompañia = cCodCompañia;

            string strCodCentroCosto = MyStuff.CodigoCentroCosto;

            Service.DataGeneral SDG = new Service.DataGeneral();
            if (MyStuff.UsaWCF == true)
            {
                DS_Proyecto = objWCF.Ayuda_Proyecto_Spring(strCodCompañia, strCodCentroCosto);
                this.Txt_CodProyecto.nombreDS = DS_Proyecto;
                //DS_FuenteFinanciamiento = objWCF.Ayuda_Proyecto_FuenteFinanciamiento( "00000", "NULL");
                this.Txt_CodFuenteFinanciamiento.nombreDS = DS_FuenteFinanciamiento;
            }
            else
            {
                DS_Proyecto = SDG.Ayuda_Proyecto_Spring(strCodCompañia, strCodCentroCosto);
                this.Txt_CodProyecto.nombreDS             = DS_Proyecto;
                DS_FuenteFinanciamiento                   = SDG.Ayuda_Proyecto_FuenteFinanciamiento(strCodCompañia, "NULL");
                this.Txt_CodFuenteFinanciamiento.nombreDS = DS_FuenteFinanciamiento;
            }

            this.ShowDialog();
        }
 private void Frm_ConsultaSaldos_Load(object sender, EventArgs e)
 {
     if (MyStuff.UsaWCF == true)
     {
         this.Cbo_AñoProceso.CargaDT(objWCF.Combo_AñoProceso("000000"));
         DS_CentroCosto = objWCF.Ayuda_Proyecto_CentroCosto(MyStuff.CodigoCentroGestor, MyStuff.DigitoCentroGestor, MyStuff.CodigoEmpleado);
         this.Txt_CodCentroCosto.nombreDS = DS_CentroCosto;
     }
     else
     {
         Service.DataGeneral          SDG = new Service.DataGeneral();
         Service.Formulacion_Cabecera SFC = new Service.Formulacion_Cabecera();
         this.Cbo_AñoProceso.CargaDT(SFC.Combo_AñoProceso("000000"));
         DS_CentroCosto = SDG.Ayuda_Proyecto_CentroCosto(MyStuff.CodigoCentroGestor, MyStuff.DigitoCentroGestor, MyStuff.CodigoEmpleado);
         this.Txt_CodCentroCosto.nombreDS = DS_CentroCosto;
     }
     if (DS_CentroCosto.Tables[0].Rows.Count > 1)
     {
         this.Txt_CodCentroCosto.Enabled = true;
     }
     else
     {
         this.Txt_CodCentroCosto.Enabled = false;
         this.Txt_CodCentroCosto.Value   = Convert.ToString(DS_CentroCosto.Tables[0].Rows[0][0]);
         this.Txt_NomCentroCosto.Value   = Convert.ToString(DS_CentroCosto.Tables[0].Rows[0][1]);
     }
 }
Ejemplo n.º 3
0
        private void MostrarDataFiltro()
        {
            if (MyStuff.UsaWCF == true)
            {
                this.Cbo_AñoProceso.CargaDT(objWCF.Combo_AñoProceso("000000"));
            }
            else
            {
                Service.Formulacion_Cabecera SFC = new Service.Formulacion_Cabecera();
                this.Cbo_AñoProceso.CargaDT(SFC.Combo_AñoProceso("000000"));
            }

            if (MyStuff.UsaWCF == true)
            {
                DS_FuenteFinanciamiento = objWCF.Ayuda_FuenteFinanciamiento_Reporte("000000");
                DS_CentroCosto          = objWCF.Ayuda_CentroCosto_Reporte("");
                DS_Proyecto             = objWCF.Ayuda_Proyecto_Reporte("", "");
            }
            else
            {
                Service.DataGeneral SDG = new Service.DataGeneral();
                DS_FuenteFinanciamiento = SDG.Ayuda_FuenteFinanciamiento_Reporte("000000");
                DS_CentroCosto          = SDG.Ayuda_CentroCosto_Reporte("");
                DS_Proyecto             = SDG.Ayuda_Proyecto_Reporte("", "");
            }
            this.Txt_CodFuenteFinanciamiento.nombreDS = DS_FuenteFinanciamiento;
            this.Txt_CodCentroCosto.nombreDS          = DS_CentroCosto;
            this.Txt_CodProyecto.nombreDS             = DS_Proyecto;
        }
Ejemplo n.º 4
0
        private void Txt_CodCentroCosto_Leave(object sender, EventArgs e)
        {
            if (strDato_CentroCosto.TrimEnd() != Convert.ToString(this.Txt_CodCentroCosto.Value).TrimEnd())
            {
                //if (string.IsNullOrEmpty(Convert.ToString(this.Txt_CodCentroCosto.Value)) == false)
                //{
                if (MyStuff.UsaWCF == true)
                {
                    DS_Proyecto = objWCF.Ayuda_Proyecto_Reporte(Convert.ToString(this.Txt_CodFuenteFinanciamiento.Value),
                                                                Convert.ToString(this.Txt_CodCentroCosto.Value)
                                                                );
                }
                else
                {
                    Service.DataGeneral objSDG = new Service.DataGeneral();
                    DS_Proyecto = objSDG.Ayuda_Proyecto_Reporte(Convert.ToString(this.Txt_CodFuenteFinanciamiento.Value),
                                                                Convert.ToString(this.Txt_CodCentroCosto.Value)
                                                                );
                }
                this.Txt_CodProyecto.nombreDS = DS_Proyecto;
                //}
                //else
                //{
                //    if (MyStuff.UsaWCF == true)
                //    {
                //        DS_Proyecto = objWCF.Ayuda_Proyecto_Reporte("");
                //    }
                //    else
                //    {
                //        Service.DataGeneral objSDG = new Service.DataGeneral();
                //        DS_Proyecto = objSDG.Ayuda_Proyecto_Reporte("");

                //    }
                //    this.Txt_CodProyecto.nombreDS = DS_Proyecto;
                //}
                this.Txt_NomCentroCosto.Value = FS.TraerDescripcion_DataTable(DS_CentroCosto.Tables[0],
                                                                              0,
                                                                              1,
                                                                              Convert.ToString(this.Txt_CodCentroCosto.Value)
                                                                              );
                string strNomProyecto = FS.TraerDescripcion_DataTable(DS_Proyecto.Tables[0],
                                                                      0,
                                                                      1,
                                                                      Convert.ToString(this.Txt_CodProyecto.Value)
                                                                      );

                if (string.IsNullOrEmpty(strNomProyecto))
                {
                    this.Txt_CodProyecto.Value = "";
                    this.Txt_NomProyecto.Value = "";
                }
                strDato_CentroCosto = Convert.ToString(this.Txt_CodCentroCosto.Value);
            }
        }
Ejemplo n.º 5
0
        public void ShowMe()
        {
            Model.Formulacion_Cabecera   MFC = new Model.Formulacion_Cabecera();
            Service.Formulacion_Cabecera SFC = new Service.Formulacion_Cabecera();

            if (MyStuff.UsaWCF == true)
            {
                MFC = objWCF.Recupera_FormulacionCabecera(MyStuff.AñoProceso);
            }
            else
            {
                MFC = SFC.Recupera_FormulacionCabecera(MyStuff.AñoProceso);
            }


            string strCodCentroCosto = MyStuff.CodigoCentroCosto;

            this.Txt_Año.Value     = MyStuff.AñoProceso;
            this.Txt_Empresa.Value = MyStuff.Empresa;
            this.Txt_Version.Value = MFC.Cversion;

            this.Txt_CodProyecto.Value = strCodProyecto;
            this.Txt_NomProyecto.Value = strNomProyecto;

            Service.DataGeneral SDG = new Service.DataGeneral();

            if (MyStuff.UsaWCF == true)
            {
                DS_CentroCosto = objWCF.Ayuda_Proyecto_CentroCosto(MyStuff.CodigoCentroGestor, MyStuff.DigitoCentroGestor);
                this.Txt_CodCentroCosto.nombreDS = DS_CentroCosto;
            }
            else
            {
                DS_CentroCosto = SDG.Ayuda_Proyecto_CentroCosto(MyStuff.CodigoCentroGestor, MyStuff.DigitoCentroGestor);
                this.Txt_CodCentroCosto.nombreDS = DS_CentroCosto;
            }
            if (DS_CentroCosto.Tables[0].Rows.Count > 1)
            {
                this.Txt_CodCentroCosto.Enabled = true;
            }
            else
            {
                this.Txt_CodCentroCosto.Enabled = false;
                this.Txt_CodCentroCosto.Value   = Convert.ToString(DS_CentroCosto.Tables[0].Rows[0][0]);
                this.Txt_NomCentroCosto.Value   = Convert.ToString(DS_CentroCosto.Tables[0].Rows[0][1]);
            }

            this.ShowDialog();
        }
        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);
        }
Ejemplo n.º 7
0
        private void MostrarDataFiltro()
        {
            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
            {
                Service.Formulacion_Cabecera SFC = new Service.Formulacion_Cabecera();
                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)
            {
                DS_FuenteFinanciamiento = objWCF.Ayuda_FuenteFinanciamiento_Reporte("000000");
                DS_CentroCosto          = objWCF.Ayuda_CentroCosto_Reporte("");
                DS_Proyecto             = objWCF.Ayuda_Proyecto_Reporte("", "");
            }
            else
            {
                Service.DataGeneral SDG = new Service.DataGeneral();
                DS_FuenteFinanciamiento = SDG.Ayuda_FuenteFinanciamiento_Reporte("000000");
                DS_CentroCosto          = SDG.Ayuda_CentroCosto_Reporte("");
                DS_Proyecto             = SDG.Ayuda_Proyecto_Reporte("", "");
            }
            this.Txt_CodFuenteFinanciamiento.nombreDS = DS_FuenteFinanciamiento;
            this.Txt_CodCentroCosto.nombreDS          = DS_CentroCosto;
            this.Txt_CodProyecto.nombreDS             = DS_Proyecto;
            this.Opt_Grupo.CheckedIndex = 0;
        }
Ejemplo n.º 8
0
 public Frm_Cierra_Version()
 {
     InitializeComponent();
     Service.DataGeneral SDG = new Service.DataGeneral();
     if (MyStuff.UsaWCF == true)
     {
         DS_CentroCosto = objWCF.Ayuda_Proyecto_CentroCosto(MyStuff.CodigoCentroGestor, MyStuff.DigitoCentroGestor);
     }
     else
     {
         DS_CentroCosto = SDG.Ayuda_Proyecto_CentroCosto(MyStuff.CodigoCentroGestor, MyStuff.DigitoCentroGestor);
     }
     this.Txt_CodCentroCosto.nombreDS = DS_CentroCosto;
     txt_Fecha.Text                  = DateTime.Now.ToString("dd/MM/yyyy");
     txt_Fecha.Enabled               = false;
     btn_Grabar.ImageOptions.Image   = imageCollection16.Images[1];
     btn_Cancelar.ImageOptions.Image = imageCollection16.Images[2];
 }
        public void ShowMe(string cCodCompañia,
                           string cTipoOrden,
                           string cNumeroOrden
                           )
        {
            SplashScreenManager.ShowForm(this, typeof(WaitForm1), true, true, false);
            SplashScreenManager.Default.SetWaitFormDescription("Recopilando informaciòn...");

            this.Text      = "Lista de Conformidades de la Orden " + cNumeroOrden;
            strCodCompañia = cCodCompañia;
            strTipoOrden   = cTipoOrden;
            strNumeroOrden = cNumeroOrden;

            Service.DataGeneral SDG = new Service.DataGeneral();

            DataTable DT = new DataTable();

            if (MyStuff.UsaWCF == true)
            {
                DT = objWCF.Lista_Conformidad_Pago(strCodCompañia,
                                                   strTipoOrden,
                                                   strNumeroOrden
                                                   ).Tables[0];
            }
            else
            {
                DT = SDG.Lista_Conformidad_Pago(strCodCompañia,
                                                strTipoOrden,
                                                strNumeroOrden
                                                ).Tables[0];
            }

            this.Grd_mvto_Mayor_FuenteFinanciamiento.DataSource = DT;
            if (blnMuestraFormato == false)
            {
                this.FormatoGrid();
                this.blnMuestraFormato = true;
            }
            SplashScreenManager.CloseForm();

            this.ShowDialog();
        }
Ejemplo n.º 10
0
        public void ShowMe(string strCodCompañia,
                           string strNumConformidad,
                           string strTipoOrden,
                           string strNumOrden
                           )
        {
            SplashScreenManager.ShowForm(this, typeof(WaitForm1), true, true, false);
            SplashScreenManager.Default.SetWaitFormDescription("Recopilando informaciòn...");

            Service.DataGeneral SDG            = new Service.DataGeneral();
            DataSet             DS_Conformidad = new DataSet();


            if (MyStuff.UsaWCF == true)
            {
                DS_Conformidad = objWCF.Formato_Conformidad(strCodCompañia,
                                                            strNumConformidad,
                                                            strTipoOrden,
                                                            strNumOrden
                                                            );
            }
            else
            {
                DS_Conformidad = SDG.Formato_Conformidad(strCodCompañia,
                                                         strNumConformidad,
                                                         strTipoOrden,
                                                         strNumOrden
                                                         );
            }


            Formato.CrystalReport.Rpt_Conformidad crpt = new Formato.CrystalReport.Rpt_Conformidad();

            crpt.Database.Tables["Orden"].SetDataSource(DS_Conformidad.Tables[0]);
            crpt.Database.Tables["Conformidad"].SetDataSource(DS_Conformidad.Tables[1]);
            crpt.Database.Tables["ConformidadProceso"].SetDataSource(DS_Conformidad.Tables[2]);
            crpt.Database.Tables["ConformidadDetalle"].SetDataSource(DS_Conformidad.Tables[3]);
            Crv_Requerimiento.ReportSource = null;
            Crv_Requerimiento.ReportSource = crpt;
            SplashScreenManager.CloseForm();
            this.ShowDialog();
        }
Ejemplo n.º 11
0
        private void MostrarOrdenes()
        {
            if (string.IsNullOrEmpty(Convert.ToString(this.Txt_NomClasificador.Value)))
            {
                MessageBox.Show("Debe Elegir un Clasificador");
            }
            else
            {
                SplashScreenManager.ShowForm(this, typeof(WaitForm1), true, true, false);
                SplashScreenManager.Default.SetWaitFormDescription("Recopilando informaciòn...");

                double dblImporte       = Convert.ToDouble(this.Txt_Importe.Value);
                Service.DataGeneral SDG = new Service.DataGeneral();
                if (MyStuff.UsaWCF == true)
                {
                    DT_Proyecto = objWCF.Lista_Proyecto_SaldoAñoAnterior_Clasificador(strCodCompañia,
                                                                                      strCodClasificador,
                                                                                      dblImporte,
                                                                                      strOrdenesElegidas
                                                                                      ).Tables[0];
                }
                else
                {
                    DT_Proyecto = SDG.Lista_Proyecto_SaldoAñoAnterior_Clasificador(strCodCompañia,
                                                                                   strCodClasificador,
                                                                                   dblImporte,
                                                                                   strOrdenesElegidas
                                                                                   ).Tables[0];
                }
                this.Grd_mvto_Mayor_FuenteFinanciamiento.DataSource = DT_Proyecto;
                if (blnMuestraFormato == true)
                {
                    blnMuestraFormato = false;
                    this.FormatoGrid();
                }

                this.AdicionaImagenesGrilla();
                SplashScreenManager.CloseForm();
            }
        }
Ejemplo n.º 12
0
 private void BuscarProyecto()
 {
     if (strDato_Proyecto.TrimEnd() != Convert.ToString(this.Txt_CodProyecto.Value).TrimEnd())
     {
         if (string.IsNullOrEmpty(Convert.ToString(this.Txt_CodProyecto.Value)) == false)
         {
             if (MyStuff.UsaWCF == true)
             {
                 DS_FuenteFinanciamiento = objWCF.Ayuda_Proyecto_FuenteFinanciamiento(strCodCompañia, Convert.ToString(this.Txt_CodProyecto.Value));
             }
             else
             {
                 Service.DataGeneral objSDG = new Service.DataGeneral();
                 DS_FuenteFinanciamiento = objSDG.Ayuda_Proyecto_FuenteFinanciamiento(strCodCompañia, Convert.ToString(this.Txt_CodProyecto.Value));
             }
             this.Txt_CodCentroCosto.nombreDS = DS_FuenteFinanciamiento;
         }
         else
         {
             if (MyStuff.UsaWCF == true)
             {
                 DS_FuenteFinanciamiento = objWCF.Ayuda_Proyecto_FuenteFinanciamiento(strCodCompañia, "NULL");
             }
             else
             {
                 Service.DataGeneral objSDG = new Service.DataGeneral();
                 DS_FuenteFinanciamiento = objSDG.Ayuda_Proyecto_FuenteFinanciamiento(strCodCompañia, "NULL");
             }
             this.Txt_CodFuenteFinanciamiento.nombreDS = DS_FuenteFinanciamiento;
         }
         this.Txt_NomProyecto.Value = FS.TraerDescripcion_DataTable(DS_Proyecto.Tables[0],
                                                                    0,
                                                                    1,
                                                                    Convert.ToString(this.Txt_CodProyecto.Value)
                                                                    );
     }
 }
Ejemplo n.º 13
0
        public void ShowMe(Model.Requerimiento_Cabecera _MRC,
                           Model.Requerimiento_Detalle _MRD,
                           Model.Requerimiento_Detalle_Bien _MRDB,
                           Model.Requerimiento_Detalle_Servicio _MRDS,
                           string strNomFuenteFinanciamiento,
                           string strNomCentroCosto,
                           string strNomProyecto,
                           string strNomPosicionPresupuestal,
                           string strNomClasificador,
                           string strNomTipoGasto,
                           string strNomMaterial,
                           string strNomServicio,
                           Infragistics.Win.UltraWinGrid.UltraGrid Grid,
                           Infragistics.Win.UltraWinEditors.UltraTextEditor text
                           )
        {
            if (_MRC.CcodTipoAdquisicion.TrimEnd() == "B")
            {
                this.UTC_Principal.SelectedTab = this.UTC_Principal.Tabs["Bien"];
                this.Text = "REQUERIMIENTO DE BIEN";
            }
            else
            {
                this.UTC_Principal.SelectedTab = this.UTC_Principal.Tabs["Servicio"];
                this.Text = "REQUERIMIENTO DE SERVICIO";
            }



            MRC  = _MRC;
            MRD  = _MRD;
            MRDB = _MRDB;
            MRDS = _MRDS;

            m_Grid = Grid;
            m_text = text;

            Model.PosicionPresupuestal   MPP = new Model.PosicionPresupuestal();
            Service.PosicionPresupuestal SPP = new Service.PosicionPresupuestal();
            Service.Clasificacion        SC  = new Service.Clasificacion();

            if (MyStuff.UsaWCF == true)
            {
                DS_Bien     = objWCF.Ayuda_Material("");
                DS_Servicio = objWCF.Ayuda_Servicio("");
                this.Cbo_CodUnidadMedida.CargaDT(objWCF.Combo_UnidadMedida().Tables[0]);
            }
            else
            {
                Service.Material    SM  = new Service.Material();
                Service.DataGeneral SDG = new Service.DataGeneral();

                DS_Bien     = SM.Ayuda_Material("");
                DS_Servicio = SM.Ayuda_Servicio("");
                this.Cbo_CodUnidadMedida.CargaDT(SDG.Combo_UnidadMedida().Tables[0]);
            }

            this.Txt_CodMaterial.nombreDS = DS_Bien;
            this.Txt_CodServicio.nombreDS = DS_Servicio;

            if (MRD.IidRequerimiento_Detalle != 0)
            {
                this.Btn_Grabar_Salir.Visible = false;

                this.Txt_CodFuenteFinanciamiento.Value = MRD.CcodFuenteFinanciamiento;
                this.Txt_NomFuenteFinanciamiento.Value = strNomFuenteFinanciamiento;
                this.Txt_CodCentroCosto.Value          = MRD.CcodCeCo;
                this.Txt_NomCentroCosto.Value          = strNomCentroCosto;
                this.Txt_CodProyecto.Value             = MRD.CcodProyecto;
                this.Txt_NomProyecto.Value             = strNomProyecto;
                this.Txt_CodPosicionPresupuestal.Value = MRD.CcodPosPre;
                this.Txt_NomPosicionPresupuestal.Value = strNomPosicionPresupuestal;
                this.Txt_CodClasificacion.Value        = MRD.CcodClasificador;
                this.Txt_NomClasificacion.Value        = strNomClasificador;
                this.Txt_CodTipoGasto.Value            = MRD.CcodTipoGasto;
                this.Txt_NomTipoGasto.Value            = strNomTipoGasto;

                if (MRC.CcodTipoAdquisicion.TrimEnd() == "B")
                {
                    this.Txt_CodMaterial.Value             = MRDB.CcodMaterial;
                    this.Txt_NomMaterial.Value             = strNomMaterial;
                    this.Txt_Stock.Value                   = MRDB.Fstock;
                    this.Edt_EspecificacionTecnica.Value   = MRDB.TespecificacionTecnica;
                    this.Txt_Cantidad.Value                = MRDB.Fcantidad;
                    this.Cbo_CodUnidadMedida.SelectedValue = MRDB.CcodUnidadMedida;
                    this.Txt_Precio.Value                  = MRDB.FprecioUnitario;
                    this.Txt_ImporteTotal_B.Value          = MRD.FimporteTotal;
                }
                else
                {
                    this.Txt_CodServicio.Value            = MRDS.CcodServicio;
                    this.Txt_NomServicio.Value            = strNomServicio;
                    this.Txt_EspecificacionServicio.Value = MRDS.TespecificacionTecnica;
                    this.Txt_ImporteTotal_S.Value         = MRD.FimporteTotal;
                }
            }

            this.ShowDialog();
        }
Ejemplo n.º 14
0
        private void MostrarFiltro(Boolean blnSalir)
        {
            WINformulacion.Movimiento.Frm_ActualizaFormulacion_Personal_Filtro frm = new WINformulacion.Movimiento.Frm_ActualizaFormulacion_Personal_Filtro();
            frm.ShowMe();
            if (frm.blnProcesaExcel == true)
            {
                SplashScreenManager.ShowForm(this, typeof(WaitForm1), true, true, false);
                SplashScreenManager.Default.SetWaitFormDescription("Recopilando informaciòn...");

                //Habilita Opciones

                this.Btn_BuscaClasificador.Enabled        = true;
                this.Btn_DistribuyeLineaFormulada.Enabled = true;
                this.Btn_Guardar.Enabled  = true;
                this.Btn_Imprimir.Enabled = true;

                //Traer Dato de la tabla



                Model.Formulacion_Cabecera   MFC = new Model.Formulacion_Cabecera();
                Service.Formulacion_Cabecera SFC = new Service.Formulacion_Cabecera();

                if (MyStuff.UsaWCF == true)
                {
                    MFC = objWCF.Recupera_FormulacionCabecera(MyStuff.AñoProceso);
                }
                else
                {
                    MFC = SFC.Recupera_FormulacionCabecera(MyStuff.AñoProceso);
                }


                strAñoProceso         = MFC.CañoProceso;
                strVersion            = MFC.Cversion;
                strCodTipoFormulacion = "05";
                strCodCentroCosto     = frm.strCodCentroCosto;

                //-- Recuperar Datos



                Service.DataGeneral SDG = new Service.DataGeneral();
                Service.CentroCosto SCC = new Service.CentroCosto();

                if (MyStuff.UsaWCF == true)
                {
                    DS_CentroCosto = objWCF.Ayuda_CentroCosto_Todos();

                    DS_Concepto = objWCF.Ayuda_Concepto();
                }
                else
                {
                    DS_CentroCosto = SCC.Ayuda_CentroCosto_Todos();

                    DS_Concepto = SDG.Ayuda_Concepto();
                }

                Service.Formulacion_Detalle_Personal SFDP = new Service.Formulacion_Detalle_Personal();
                if (MyStuff.UsaWCF == true)
                {
                    DS_Formulacion = objWCF.Lista_FormulacionDetalle_Personal("000000", strCodCentroCosto, strCodTipoFormulacion);
                }
                else
                {
                    DS_Formulacion = SFDP.Lista_FormulacionDetalle_Personal("000000", strCodCentroCosto, strCodTipoFormulacion);
                }

                workbook = spreadsheetControl.Document;
                string sRutaInterna = Path.Combine(AppDomain.CurrentDomain.BaseDirectory, @"Excel\Formulacion_Personal.xlsx");
                //workbook.LoadDocument(@"Excel\Formulacion_Proyecto_Inversion.xlsx", DocumentFormat.Xlsx);
                workbook.LoadDocument(sRutaInterna, DocumentFormat.Xlsx);

                Worksheet worksheet_HojaTrabajo = workbook.Worksheets[0];

                worksheet_HojaTrabajo.Cells[3, 2].Value = frm.strNomProyecto;
                worksheet_HojaTrabajo.Cells[4, 2].Value = frm.strNomCentroCosto;



                worksheet_HojaTrabajo.Cells[2, 26].Value = MFC.CañoProceso;
                worksheet_HojaTrabajo.Cells[3, 26].Value = MFC.Cversion;
                worksheet_HojaTrabajo.Cells[4, 26].Value = "Gastos de Personal";

                DV_Excel = DS_Formulacion.Tables[0].DefaultView;
                worksheet_HojaTrabajo.DataBindings.BindToDataSource(DV_Excel, 9, 1);

                //int intLinea = 9;
                //foreach (DataRow oRow1 in DS_Formulacion.Tables[0].Rows)
                //{
                //    string Rango = traeRangoCelda(1, intLinea + 1, 1, intLinea + 1);
                //    workbook = spreadsheetControl.Document;
                //    Range range = worksheet_HojaTrabajo.Range[Rango];
                //    Formatting rangeFormatting = range.BeginUpdateFormatting();
                //    rangeFormatting.Fill.BackgroundColor = Color.Green;
                //    range.EndUpdateFormatting(rangeFormatting);

                //    worksheet_HojaTrabajo.Cells[intLinea, 1].Value = Convert.ToString(oRow1["vNomTipoInserccion"]);
                //    worksheet_HojaTrabajo.Cells[intLinea, 2].Value = Convert.ToString(oRow1["vNomCentroCosto"]);
                //    worksheet_HojaTrabajo.Cells[intLinea, 3].Value = Convert.ToString(oRow1["vNomClaseGasto"]);
                //    worksheet_HojaTrabajo.Cells[intLinea, 4].Value = Convert.ToString(oRow1["cCodClasificador"]);
                //    worksheet_HojaTrabajo.Cells[intLinea, 5].Value = Convert.ToString(oRow1["vNomClasificador"]);
                //    worksheet_HojaTrabajo.Cells[intLinea, 6].Value = Convert.ToString(oRow1["cCodPosPre"]);
                //    worksheet_HojaTrabajo.Cells[intLinea, 7].Value = Convert.ToString(oRow1["vNomPosPre"]);
                //    worksheet_HojaTrabajo.Cells[intLinea, 8].Value = Convert.ToString(oRow1["vNomFuenteFinanciamiento"]);
                //    worksheet_HojaTrabajo.Cells[intLinea, 9].Value = Convert.ToString(oRow1["vNomConcepto"]);
                //    worksheet_HojaTrabajo.Cells[intLinea, 10].Value = Convert.ToString(oRow1["Orden"]);
                //    worksheet_HojaTrabajo.Cells[intLinea, 11].Value = Convert.ToString(oRow1["tDescripcionGasto"]);
                //    worksheet_HojaTrabajo.Cells[intLinea, 12].Value = Convert.ToDouble(oRow1["fValorAnterior"]);
                //    worksheet_HojaTrabajo.Cells[intLinea, 13].Value = Convert.ToDouble(oRow1["fValorRestoActual"]);
                //    worksheet_HojaTrabajo.Cells[intLinea, 14].Value = Convert.ToDouble(oRow1["fMes_01"]);
                //    worksheet_HojaTrabajo.Cells[intLinea, 15].Value = Convert.ToDouble(oRow1["fMes_02"]);
                //    worksheet_HojaTrabajo.Cells[intLinea, 16].Value = Convert.ToDouble(oRow1["fMes_03"]);
                //    worksheet_HojaTrabajo.Cells[intLinea, 17].Value = Convert.ToDouble(oRow1["fMes_04"]);
                //    worksheet_HojaTrabajo.Cells[intLinea, 18].Value = Convert.ToDouble(oRow1["fMes_05"]);
                //    worksheet_HojaTrabajo.Cells[intLinea, 19].Value = Convert.ToDouble(oRow1["fMes_06"]);
                //    worksheet_HojaTrabajo.Cells[intLinea, 20].Value = Convert.ToDouble(oRow1["fMes_07"]);
                //    worksheet_HojaTrabajo.Cells[intLinea, 21].Value = Convert.ToDouble(oRow1["fMes_08"]);
                //    worksheet_HojaTrabajo.Cells[intLinea, 22].Value = Convert.ToDouble(oRow1["fMes_09"]);
                //    worksheet_HojaTrabajo.Cells[intLinea, 23].Value = Convert.ToDouble(oRow1["fMes_10"]);
                //    worksheet_HojaTrabajo.Cells[intLinea, 24].Value = Convert.ToDouble(oRow1["fMes_11"]);
                //    worksheet_HojaTrabajo.Cells[intLinea, 25].Value = Convert.ToDouble(oRow1["fMes_12"]);
                //    worksheet_HojaTrabajo.Cells[intLinea, 26].Value = Convert.ToDouble(oRow1["fValorFormulacion"]);
                //    worksheet_HojaTrabajo.Cells[intLinea, 27].Value = Convert.ToDouble(oRow1["fValorFormulacionUno"]);
                //    worksheet_HojaTrabajo.Cells[intLinea, 28].Value = Convert.ToDouble(oRow1["fValorFormulacionDos"]);
                //    worksheet_HojaTrabajo.Cells[intLinea, 29].Value = Convert.ToDouble(oRow1["Distribucion"]);
                //    worksheet_HojaTrabajo.Cells[intLinea, 30].Value = Convert.ToInt32(oRow1["iidFormulacion_Detalle_Personal"]);

                //    //worksheet_HojaTrabajo.Cells[intLinea, 1000].Value = Convert.ToString(oRow1["vNomFuenteFinanciamiento"]);

                //    this.FormatoCeldas(intLinea);
                //    intLinea = intLinea + 1;
                //    //}
                //}

                this.ValidarColumnas();

                SplashScreenManager.CloseForm();
            }
            else
            {
                //if (blnSalir == true)
                //this.Close();
            }
        }
        public void ShowMe()
        {
            Model.Formulacion_Cabecera   MFC = new Model.Formulacion_Cabecera();
            Service.Formulacion_Cabecera SFC = new Service.Formulacion_Cabecera();

            if (MyStuff.UsaWCF == true)
            {
                MFC = objWCF.Recupera_FormulacionCabecera(MyStuff.AñoProceso);
            }
            else
            {
                MFC = SFC.Recupera_FormulacionCabecera(MyStuff.AñoProceso);
            }


            string strCodCentroCosto = MyStuff.CodigoCentroCosto;

            Service.DataGeneral SDG = new Service.DataGeneral();

            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)
            {
                DS_CentroCosto = objWCF.Ayuda_Proyecto_CentroCosto(MyStuff.CodigoCentroGestor, MyStuff.DigitoCentroGestor);
                this.Txt_CodCentroCosto.nombreDS = DS_CentroCosto;
            }
            else
            {
                DS_CentroCosto = SDG.Ayuda_Proyecto_CentroCosto(MyStuff.CodigoCentroGestor, MyStuff.DigitoCentroGestor);
                this.Txt_CodCentroCosto.nombreDS = DS_CentroCosto;
            }
            if (DS_CentroCosto.Tables[0].Rows.Count > 1)
            {
                this.Txt_CodCentroCosto.Enabled = true;
            }
            else
            {
                this.Txt_CodCentroCosto.Enabled = true;
                this.Txt_CodCentroCosto.Value   = Convert.ToString(DS_CentroCosto.Tables[0].Rows[0][0]);
                this.Txt_NomCentroCosto.Value   = Convert.ToString(DS_CentroCosto.Tables[0].Rows[0][1]);
            }

            //this.ShowDialog();
        }