コード例 #1
0
        public int Graba_FormulacionDetalle_Personal(Model.Formulacion_Detalle_Personal obj)
        {
            int       intIdFormulacion_Detalle_Personal = 0;
            DataTable dt = new DataTable();

            try
            {
                dt = SqlHelper.ExecuteDataTable(strConnection, "Formulacion.spp_ins_mvto_Formulacion_Detalle_Personal", obj.IidFormulacion_Detalle,
                                                obj.CañoProceso,
                                                obj.Cversion,
                                                obj.CcodCeCo,
                                                obj.CcodCeCo_Gestor,
                                                obj.CcodPosPre,
                                                obj.CTipoOrden,
                                                obj.CNumeroOrden,
                                                obj.CcodFuenteFinanciamiento,
                                                obj.CcodConcepto,
                                                obj.CcodTipoFormulacion,
                                                obj.CcodProyecto,
                                                obj.CcodClaseGasto,
                                                obj.TdescripcionGasto,
                                                obj.IcodTipoInserccion,
                                                obj.FvalorAnterior,
                                                obj.FvalorRestoActual,
                                                obj.Fmes_01,
                                                obj.Fmes_02,
                                                obj.Fmes_03,
                                                obj.Fmes_04,
                                                obj.Fmes_05,
                                                obj.Fmes_06,
                                                obj.Fmes_07,
                                                obj.Fmes_08,
                                                obj.Fmes_09,
                                                obj.Fmes_10,
                                                obj.Fmes_11,
                                                obj.Fmes_12,
                                                obj.FvalorFormulacion,
                                                obj.FvalorFormulacionUno,
                                                obj.FvalorFormulacionDos,
                                                obj.Cusuario
                                                );
                intIdFormulacion_Detalle_Personal = Convert.ToInt32(dt.Rows[0][0]);
            }
            catch
            {
                intIdFormulacion_Detalle_Personal = 0;
            }
            return(intIdFormulacion_Detalle_Personal);
        }
コード例 #2
0
        private void Btn_Guardar_Click(object sender, EventArgs e)
        {
            //-- Boton Guardar Documento

            SplashScreenManager.ShowForm(this, typeof(WaitForm1), true, true, false);
            SplashScreenManager.Default.SetWaitFormDescription("Grabando información...");

            Model.Formulacion_Detalle_Personal   MFDP = new Model.Formulacion_Detalle_Personal();
            Service.Formulacion_Detalle_Personal SFDP = new Service.Formulacion_Detalle_Personal();

            workbook = spreadsheetControl.Document;
            Worksheet worksheet_HojaTrabajo = workbook.Worksheets[0];

            int _Rows = 9;
            int intIdFormulacion_Detalle_Personal = 0;

            while (true)
            {
                if (string.IsNullOrEmpty(Convert.ToString(worksheet_HojaTrabajo.Cells[_Rows, 3].Value.TextValue)))
                {
                    break;
                }



                MFDP.IidFormulacion_Detalle_Personal = Convert.ToInt32(worksheet_HojaTrabajo.Cells[_Rows, 30].Value.NumericValue);
                MFDP.CañoProceso     = strAñoProceso;
                MFDP.Cversion        = strVersion;
                MFDP.CcodCeCo        = Convert.ToString(worksheet_HojaTrabajo.Cells[_Rows, 6].Value.TextValue);
                MFDP.CcodCeCo_Gestor = strCodCentroCosto;
                MFDP.CcodPosPre      = Convert.ToString(worksheet_HojaTrabajo.Cells[_Rows, 6].Value.TextValue);
                MFDP.CcodConcepto    = FS.TraerDescripcion_DataTable(DS_Concepto.Tables[0],
                                                                     1,
                                                                     0,
                                                                     Convert.ToString(worksheet_HojaTrabajo.Cells[_Rows, 9].Value.TextValue)
                                                                     );
                if (string.IsNullOrEmpty(Convert.ToString(worksheet_HojaTrabajo.Cells[_Rows, 10].Value.TextValue)))
                {
                    MFDP.CTipoOrden   = "";
                    MFDP.CNumeroOrden = "";
                }
                else
                {
                    MFDP.CTipoOrden   = Convert.ToString(worksheet_HojaTrabajo.Cells[_Rows, 10].Value.TextValue).Substring(0, 2);
                    MFDP.CNumeroOrden = Convert.ToString(worksheet_HojaTrabajo.Cells[_Rows, 10].Value.TextValue).Substring(3, 10);
                }


                MFDP.CcodFuenteFinanciamiento = "001";
                MFDP.CcodTipoFormulacion      = strCodTipoFormulacion;

                //MFDP.CcodProyecto = strCodProyecto;
                MFDP.CcodProyecto         = "CORPORATIVOS  ";
                MFDP.CcodClaseGasto       = "02";
                MFDP.TdescripcionGasto    = Convert.ToString(worksheet_HojaTrabajo.Cells[_Rows, 11].Value.TextValue);
                MFDP.FvalorAnterior       = Convert.ToDouble(worksheet_HojaTrabajo.Cells[_Rows, 12].Value.NumericValue);
                MFDP.FvalorRestoActual    = Convert.ToDouble(worksheet_HojaTrabajo.Cells[_Rows, 13].Value.NumericValue);
                MFDP.FvalorFormulacion    = Convert.ToDouble(worksheet_HojaTrabajo.Cells[_Rows, 26].Value.NumericValue);
                MFDP.FvalorFormulacionUno = Convert.ToDouble(worksheet_HojaTrabajo.Cells[_Rows, 27].Value.NumericValue);
                MFDP.FvalorFormulacionDos = Convert.ToDouble(worksheet_HojaTrabajo.Cells[_Rows, 28].Value.NumericValue);

                if (Convert.ToString(worksheet_HojaTrabajo.Cells[_Rows, 1].Value.TextValue) == "Año Anterior")
                {
                    MFDP.IcodTipoInserccion = 2; // 2 Automatico
                }
                else
                {
                    MFDP.IcodTipoInserccion = 1; //- 1 Manual
                }
                MFDP.Cusuario = MyStuff.CodigoEmpleado;

                MFDP.Fmes_01 = Convert.ToDouble(worksheet_HojaTrabajo.Cells[_Rows, 14].Value.NumericValue);
                MFDP.Fmes_02 = Convert.ToDouble(worksheet_HojaTrabajo.Cells[_Rows, 15].Value.NumericValue);
                MFDP.Fmes_03 = Convert.ToDouble(worksheet_HojaTrabajo.Cells[_Rows, 16].Value.NumericValue);
                MFDP.Fmes_04 = Convert.ToDouble(worksheet_HojaTrabajo.Cells[_Rows, 17].Value.NumericValue);
                MFDP.Fmes_05 = Convert.ToDouble(worksheet_HojaTrabajo.Cells[_Rows, 18].Value.NumericValue);
                MFDP.Fmes_06 = Convert.ToDouble(worksheet_HojaTrabajo.Cells[_Rows, 19].Value.NumericValue);
                MFDP.Fmes_07 = Convert.ToDouble(worksheet_HojaTrabajo.Cells[_Rows, 20].Value.NumericValue);
                MFDP.Fmes_08 = Convert.ToDouble(worksheet_HojaTrabajo.Cells[_Rows, 21].Value.NumericValue);
                MFDP.Fmes_09 = Convert.ToDouble(worksheet_HojaTrabajo.Cells[_Rows, 22].Value.NumericValue);
                MFDP.Fmes_10 = Convert.ToDouble(worksheet_HojaTrabajo.Cells[_Rows, 23].Value.NumericValue);
                MFDP.Fmes_11 = Convert.ToDouble(worksheet_HojaTrabajo.Cells[_Rows, 24].Value.NumericValue);
                MFDP.Fmes_12 = Convert.ToDouble(worksheet_HojaTrabajo.Cells[_Rows, 25].Value.NumericValue);

                if (ValidaLineaGrabacion(MFDP, _Rows) == false)
                {
                    if (MFDP.IidFormulacion_Detalle_Personal == 0)
                    {
                        if (MyStuff.UsaWCF == true)
                        {
                            intIdFormulacion_Detalle_Personal = objWCF.Graba_FormulacionDetalle_Personal(MFDP);
                        }
                        else
                        {
                            intIdFormulacion_Detalle_Personal = SFDP.Graba_FormulacionDetalle_Personal(MFDP);
                        }
                        string Rango = traeRangoCelda(1, _Rows + 1, 1, _Rows + 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[_Rows, 30].Value = intIdFormulacion_Detalle_Personal;
                    }
                    else
                    {
                        if (MyStuff.UsaWCF == true)
                        {
                            intIdFormulacion_Detalle_Personal = objWCF.Modifica_FormulacionDetalle_Personal(MFDP);
                        }
                        else
                        {
                            intIdFormulacion_Detalle_Personal = SFDP.Modifica_FormulacionDetalle_Personal(MFDP);
                        }
                    }
                }

                _Rows++;
            }

            SplashScreenManager.CloseForm();
        }
コード例 #3
0
        private Boolean ValidaLineaGrabacion(Model.Formulacion_Detalle_Personal MFDP, int Linea)
        {
            Boolean blnFilaErrada = false;

            workbook = spreadsheetControl.Document;
            Worksheet worksheet_HojaTrabajo = workbook.Worksheets[0];

            if (MFDP.FvalorFormulacion == 0)
            {
                pintarError(Linea, "Z", true);
                blnFilaErrada = true;
            }
            else
            {
                pintarError(Linea, "Z", false);
            }

            if (string.IsNullOrEmpty(Convert.ToString(worksheet_HojaTrabajo.Cells[Linea, 2].Value.TextValue)))
            {
                pintarError(Linea, "C", true);
                blnFilaErrada = true;
            }
            else
            {
                pintarError(Linea, "C", false);
            }

            if (string.IsNullOrEmpty(Convert.ToString(worksheet_HojaTrabajo.Cells[Linea, 3].Value.TextValue)))
            {
                pintarError(Linea, "D", true);
                blnFilaErrada = true;
            }
            else
            {
                pintarError(Linea, "D", false);
            }

            if (string.IsNullOrEmpty(Convert.ToString(worksheet_HojaTrabajo.Cells[Linea, 4].Value.TextValue)))
            {
                pintarError(Linea, "E", true);
                blnFilaErrada = true;
            }
            else
            {
                pintarError(Linea, "E", false);
            }

            if (string.IsNullOrEmpty(Convert.ToString(worksheet_HojaTrabajo.Cells[Linea, 6].Value.TextValue)))
            {
                pintarError(Linea, "G", true);
                blnFilaErrada = true;
            }
            else
            {
                pintarError(Linea, "G", false);
            }

            if (string.IsNullOrEmpty(Convert.ToString(worksheet_HojaTrabajo.Cells[Linea, 8].Value.TextValue)))
            {
                pintarError(Linea, "I", true);
                blnFilaErrada = true;
            }
            else
            {
                pintarError(Linea, "I", false);
            }

            if (string.IsNullOrEmpty(Convert.ToString(worksheet_HojaTrabajo.Cells[Linea, 9].Value.TextValue)))
            {
                pintarError(Linea, "J", true);
                blnFilaErrada = true;
            }
            else
            {
                pintarError(Linea, "J", false);
            }

            if (string.IsNullOrEmpty(Convert.ToString(worksheet_HojaTrabajo.Cells[Linea, 11].Value.TextValue)))
            {
                pintarError(Linea, "L", true);
                blnFilaErrada = true;
            }
            else
            {
                pintarError(Linea, "L", false);
            }

            return(blnFilaErrada);
        }
コード例 #4
0
        public int Modifica_FormulacionDetalle_Personal(Model.Formulacion_Detalle_Personal obj)
        {
            Repository.Formulacion_Detalle_Personal objDs = new Repository.Formulacion_Detalle_Personal();

            return(objDs.Modifica_FormulacionDetalle_Personal(obj));
        }