Exemple #1
0
        public bool GrabarDB()
        {
            try
            {
                bool Bandera = false;

                if (Archivo_Bus.GrabarDB(Archivo_Info, ref IdArchivo))
                {
                    MessageBox.Show("Registro Guardado Correctamente", param.Nombre_sistema, MessageBoxButtons.OK, MessageBoxIcon.Information);
                    Bandera = true;
                    return(Bandera);
                }
                else
                {
                    MessageBox.Show("No se pudo guardar el registro", param.Nombre_sistema, MessageBoxButtons.OK, MessageBoxIcon.Error);
                    Bandera = false;
                    return(Bandera);
                }

                return(Bandera);
            }
            catch (Exception ex)
            {
                MessageBox.Show(ex.ToString());
                Log_Error_bus.Log_Error(ex.ToString());
                return(false);
            }
        }
 public Boolean Grabar()
 {
     try
     {
         int  archivo   = 0;
         bool resultado = false;
         ba_Archivo_Transferencia_Info            ArchivoInfo        = new ba_Archivo_Transferencia_Info();
         List <ba_Archivo_Transferencia_Det_Info> DetalleArchivoInfo = new List <ba_Archivo_Transferencia_Det_Info>();
         ArchivoInfo = Get_Archivo();
         if (BusTransfer.GrabarDB(ArchivoInfo, ref archivo))
         {
             DetalleArchivoInfo = GetList_Archivo_Detalle(archivo);
             if (ArchivoDeta_Bus.GrabarDB(DetalleArchivoInfo))
             {
                 GetArchivoPlano();
                 TarjetaBus.Generar_Solicitud_Tarjeta_Banco_Guayaquil(Lista_Tarjeta, patch, NombreArchivo);
                 MessageBox.Show("Datos guardados exitosamente", "Sistemas", MessageBoxButtons.OK, MessageBoxIcon.Information);
                 resultado = true;
             }
         }
         return(resultado);
     }
     catch (Exception ex)
     {
         Log_Error_bus.Log_Error(ex.ToString());
         mensaje = ex.Message.ToString();
         MessageBox.Show("Error " + mensaje, "Sistemas", MessageBoxButtons.OK, MessageBoxIcon.Information);
         throw new Exception();
     }
 }
Exemple #3
0
        public Boolean GrabarBD(ro_Archivos_Bancos_Generacion_Info info, ref decimal id, ref string mensaje)
        {
            try
            {
                Boolean valorDevolver = false;
                int     ida           = 0;
                //GRABAR
                info.UsuarioIngresa = param.IdUsuario;
                info.FechaIngresa   = param.Fecha_Transac;
                valorDevolver       = oData.GrabarBD(info, ref id, ref mensaje);
                // grabando detalle
                foreach (var item in info.oListRo_archivos_bancos_generacion_x_empleado_Info)
                {
                    item.IdEmpresa = info.IdEmpresa;
                    item.IdArchivo = id;
                    bus_detalle.GuardarBD(item, ref mensaje);
                }


                if (valorDevolver)
                {
                    info_archivo  = Get_archivo(info);
                    valorDevolver = Archivo_Bus.GrabarDB(info_archivo, ref ida);
                    if (valorDevolver)// si grabo en el modulo banco
                    {
                        info.IdEmpesa_mod_banco  = param.IdEmpresa;
                        info.IdArchivo_mod_banco = ida;
                        info.IdArchivo           = id;
                        oData.ModificarBD_id_mod_banco(info);
                    }
                }



                return(valorDevolver);
            }
            catch (Exception ex)
            {
                Core.Erp.Info.Log_Exception.LoggingManager.Logger.Log(Core.Erp.Info.Log_Exception.LoggingCategory.Error, ex.Message);
                throw new Core.Erp.Info.Log_Exception.DalException(string.Format("", "GrabarBD", ex.Message), ex)
                      {
                          EntityType = typeof(ro_Archivos_Bancos_Generacion_Bus)
                      };
            }
        }
Exemple #4
0
        public Boolean GrabarBD(ro_Archivos_Bancos_Generacion_Info info, ref decimal id, ref string mensaje)
        {
            try
            {
                Boolean valorDevolver = false;
                int     ida           = 0;

                // bus_detalle.EliminarBD(info.IdEmpresa, info.IdArchivo, ref mensaje);

                if (oData.GetExiste(info, ref mensaje))
                {//MODIFICAR
                    info.UsuarioModifica = param.IdUsuario;
                    info.FechaModifica   = param.Fecha_Transac;
                    valorDevolver        = oData.ModificarBD(info, ref mensaje);
                    id = info.IdArchivo;


                    // grabando detalle

                    foreach (var item in info.oListRo_archivos_bancos_generacion_x_empleado_Info)
                    {
                        if (bus_detalle.SiExiste(info.IdEmpresa, info.IdNomina, info.IdNominaTipo, info.IdPeriodo, item.IdEmpleado))
                        {
                            bus_detalle.ActulizarDB(info.IdEmpresa, info.IdNomina, info.IdNominaTipo, info.IdPeriodo, item.IdEmpleado, item.Valor);
                        }
                        else
                        {
                            item.IdEmpresa = info.IdEmpresa;
                            item.IdArchivo = info.IdArchivo;
                            bus_detalle.GuardarBD(item, ref mensaje);
                        }
                    }
                }
                else
                {
                    //GRABAR
                    info.UsuarioIngresa = param.IdUsuario;
                    info.FechaIngresa   = param.Fecha_Transac;
                    valorDevolver       = oData.GrabarBD(info, ref id, ref mensaje);

                    // grabando detalle

                    foreach (var item in info.oListRo_archivos_bancos_generacion_x_empleado_Info)
                    {
                        item.IdEmpresa = info.IdEmpresa;
                        item.IdArchivo = id;
                        bus_detalle.GuardarBD(item, ref mensaje);
                    }


                    if (valorDevolver)
                    {
                        info_archivo = Get_archivo(info);

                        valorDevolver = Archivo_Bus.GrabarDB(info_archivo, ref ida);
                    }
                }

                return(valorDevolver);
            }
            catch (Exception ex)
            {
                Core.Erp.Info.Log_Exception.LoggingManager.Logger.Log(Core.Erp.Info.Log_Exception.LoggingCategory.Error, ex.Message);
                throw new Core.Erp.Info.Log_Exception.DalException(string.Format("", "GrabarBD", ex.Message), ex)
                      {
                          EntityType = typeof(ro_Archivos_Bancos_Generacion_Bus)
                      };
            }
        }