Example #1
0
        public Model.Formulacion_Cabecera Recupera_FormulacionCabecera(string strAñoProceso)
        {
            DataTable dt; // = new DataTable();

            Model.Formulacion_Cabecera obj = new Model.Formulacion_Cabecera();


            dt = SqlHelper.ExecuteDataTable(strConnection, "Formulacion.spp_sel_mvto_Formulacion_Cabecera", strAñoProceso);

            if (dt.Rows.Count == 0)
            {
                obj.IidFormulacion_Cabecera = 0;
                obj.CañoProceso             = "";
                obj.Cversion        = "";
                obj.DfecFormulacion = DateTime.Today;
                obj.Tnota           = "";
                obj.Bactivo         = false;
            }
            else
            {
                obj.IidFormulacion_Cabecera = Convert.ToInt32(dt.Rows[0][0]);;
                obj.CañoProceso             = Convert.ToString(dt.Rows[0][1]);
                obj.Cversion        = Convert.ToString(dt.Rows[0][2]);
                obj.DfecFormulacion = Convert.ToDateTime(dt.Rows[0][3]);
                obj.Tnota           = Convert.ToString(dt.Rows[0][4]);
                obj.Bactivo         = Convert.ToBoolean(dt.Rows[0][5]);
            }
            return(obj);
        }
        private void Frt_FormulacionProyecto_Resumen_Load(object sender, EventArgs e)
        {
            MFC = SFC.Recupera_FormulacionCabecera(MyStuff.AñoProceso);

            this.Txt_Año.Value     = MFC.CañoProceso;
            this.Txt_Version.Value = MFC.Cversion;
        }
Example #3
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);
        }
Example #5
0
        public DataSet Graba_FormulacionCabecera_DataSet(Model.Formulacion_Cabecera obj)
        {
            DataSet ds = new DataSet();

            using (ds = SqlHelper.ExecuteDataset(strConnection, "Formulacion.spp_ins_mvto_Formulacion_Cabecera",
                                                 obj.CañoProceso,
                                                 obj.Cversion,
                                                 obj.cCodTipoDocumento,
                                                 obj.cNumDocumento,
                                                 obj.Tnota,
                                                 obj.Bactivo))
            {
                return(ds);
            }
        }
Example #6
0
        public bool Modifica_mvto_Formulacion_Cabecera(Model.Formulacion_Cabecera obj)
        {
            bool blnResultado = true;

            try
            {
                SqlHelper.ExecuteNonQuery(strConnection,
                                          "[Formulacion].[spp_upd_mvto_Formulacion_Cabecera]", obj.IidFormulacion_Cabecera,
                                          obj.CañoProceso,
                                          obj.Cversion,
                                          obj.cCodTipoDocumento,
                                          obj.cNumDocumento,
                                          obj.Tnota,
                                          obj.Bactivo);
            }
            catch (Exception)
            {
                blnResultado = false;
                throw;
            }
            return(blnResultado);
        }
 public void mostrarDocumento(Model.Formulacion_Cabecera obj)
 {
     this.txt_AñoProceso.Text = MyStuff.AñoProceso;// obj.CañoProceso;
     this.txt_Version.Value   = obj.Cversion;
     this.cbo_CodTipoDocumento.SelectedValue = obj.cCodTipoDocumento;
     this.txt_NumDocumento.Value             = obj.cNumDocumento;
     this.edt_Nota.Value = obj.Tnota;
     if (obj.Bactivo)
     {
         this.btn_Grabar.Enabled   = false;
         this.btn_Nuevo.Enabled    = false;
         this.btn_Eliminar.Enabled = false;
         this.btn_DesHacer.Enabled = false;
     }
     else
     {
         this.btn_Grabar.Enabled   = true;
         this.btn_Nuevo.Enabled    = true;
         this.btn_Eliminar.Enabled = true;
         this.btn_DesHacer.Enabled = true;
     }
 }
Example #8
0
        public int Graba_FormulacionCabecera(Model.Formulacion_Cabecera obj)
        {
            int       intIdFormulacion_Cabecera = 0;
            DataTable dt = new DataTable();

            try
            {
                dt = SqlHelper.ExecuteDataTable(strConnection, "Formulacion.spp_ins_mvto_Formulacion_Cabecera",
                                                obj.CañoProceso,
                                                obj.Cversion,
                                                obj.cCodTipoDocumento,
                                                obj.cNumDocumento,
                                                obj.Tnota,
                                                obj.Bactivo
                                                );
                intIdFormulacion_Cabecera = Convert.ToInt32(dt.Rows[0][0]);
            }
            catch
            {
                intIdFormulacion_Cabecera = 0;
            }
            return(intIdFormulacion_Cabecera);
        }
Example #9
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();
            }
        }
Example #10
0
 public bool Modifica_mvto_Formulacion_Cabecera(Model.Formulacion_Cabecera obj)
 {
     Repository.Formulacion_Cabecera objDs = new Repository.Formulacion_Cabecera();
     return(objDs.Modifica_mvto_Formulacion_Cabecera(obj));
 }
Example #11
0
 public DataSet Graba_FormulacionCabecera_DataSet(Model.Formulacion_Cabecera obj)
 {
     Repository.Formulacion_Cabecera objDs = new Repository.Formulacion_Cabecera();
     return(objDs.Graba_FormulacionCabecera_DataSet(obj));
 }
        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();
        }