コード例 #1
0
 public Boolean AnularDB(pre_PedidoXPresupuesto_Info info)
 {
     try
     {
         using (EntitiesPresupuesto context = new EntitiesPresupuesto())
         {
             var contact = context.pre_PedidoXPresupuesto.FirstOrDefault(minfo => minfo.IdEmpresa == info.IdEmpresa && minfo.IdPedidoXPre == info.IdPedidoXPre);
             if (contact != null)
             {
                 contact.Estado          = "I";
                 contact.Fecha_UltAnu    = info.Fecha_UltAnu;
                 contact.IdUsuarioUltAnu = info.IdUsuarioUltAnu;
                 contact.MotivoAnulacion = info.MotivoAnulacion;
                 context.SaveChanges();
             }
         }
         return(true);
     }
     catch (Exception ex)
     {
         string arreglo = ToString();
         tb_sis_Log_Error_Vzen_Data oDataLog      = new tb_sis_Log_Error_Vzen_Data();
         tb_sis_Log_Error_Vzen_Info Log_Error_sis = new tb_sis_Log_Error_Vzen_Info(ex.ToString(), "", arreglo, "",
                                                                                   "", "", "", "", DateTime.Now);
         oDataLog.Guardar_Log_Error(Log_Error_sis, ref mensaje);
         mensaje = ex.ToString() + " " + ex.Message;
         throw new Exception(ex.ToString());
     }
 }
コード例 #2
0
        public Boolean AnularDB(pre_ordencompra_local_Info info)
        {
            try
            {
                using (EntitiesPresupuesto context = new EntitiesPresupuesto())
                {
                    var contact = context.pre_ordencompra_local.FirstOrDefault(minfo => minfo.IdEmpresa == info.IdEmpresa && minfo.IdSucursal == info.IdSucursal && minfo.IdOrdenCompra == info.IdOrdenCompra);
                    if (contact != null)
                    {
                        contact.Estado          = "I";
                        contact.FechaHoraAnul   = info.FechaHoraAnul;
                        contact.IdUsuarioUltAnu = info.IdUsuarioUltAnu;
                        contact.MotivoAnulacion = info.MotivoAnulacion;

                        OCDet_D.EliminarLstDB(info.LstPedidoOC_det);

                        context.SaveChanges();
                    }
                }
                return(true);
            }
            catch (Exception ex)
            {
                string arreglo = ToString();
                tb_sis_Log_Error_Vzen_Data oDataLog      = new tb_sis_Log_Error_Vzen_Data();
                tb_sis_Log_Error_Vzen_Info Log_Error_sis = new tb_sis_Log_Error_Vzen_Info(ex.ToString(), "", arreglo, "", "", "", "", "", DateTime.Now);
                oDataLog.Guardar_Log_Error(Log_Error_sis, ref mensaje);
                mensaje = ex.ToString() + " " + ex.Message;
                throw new Exception(ex.ToString());
            }
        }
コード例 #3
0
 public Boolean EliminarDB(pre_PedidoXPresupuesto_det_Info info)
 {
     try
     {
         using (EntitiesPresupuesto context = new EntitiesPresupuesto())
         {
             var contact = context.pre_PedidoXPresupuesto_det.FirstOrDefault(minfo => minfo.IdEmpresa == info.IdEmpresa && minfo.IdPedidoXPre == info.IdPedidoXPre && minfo.Secuencia_reg == info.Secuencia_reg);
             if (contact != null)
             {
                 context.pre_PedidoXPresupuesto_det.Add(contact);
                 context.SaveChanges();
             }
         }
         return(true);
     }
     catch (Exception ex)
     {
         string arreglo = ToString();
         tb_sis_Log_Error_Vzen_Data oDataLog      = new tb_sis_Log_Error_Vzen_Data();
         tb_sis_Log_Error_Vzen_Info Log_Error_sis = new tb_sis_Log_Error_Vzen_Info(ex.ToString(), "", arreglo, "", "", "", "", "", DateTime.Now);
         oDataLog.Guardar_Log_Error(Log_Error_sis, ref mensaje);
         mensaje = ex.ToString() + " " + ex.Message;
         throw new Exception(ex.ToString());
     }
 }
コード例 #4
0
 public Boolean ModificarDBEstadoAprobacion(pre_PedidoXPresupuesto_det_Info info)
 {
     try
     {
         using (EntitiesPresupuesto context = new EntitiesPresupuesto())
         {
             var contact = context.pre_PedidoXPresupuesto_det.FirstOrDefault(minfo => minfo.IdEmpresa == info.IdEmpresa && minfo.IdPedidoXPre == info.IdPedidoXPre && minfo.Secuencia_reg == info.Secuencia_reg);
             if (contact != null)
             {
                 contact.CodEstadoAprobacion = info.CodEstadoAprobacion;
                 contact.Cotizado            = (info.CotizadoB == true) ? "S" : "N";
                 contact.UltiFechaEstadoApro = info.UltiFechaEstadoApro;
                 contact.IdUsuarioEstadoApro = info.IdUsuarioEstadoApro;
                 context.SaveChanges();
             }
         }
         return(true);
     }
     catch (Exception ex)
     {
         string arreglo = ToString();
         tb_sis_Log_Error_Vzen_Data oDataLog      = new tb_sis_Log_Error_Vzen_Data();
         tb_sis_Log_Error_Vzen_Info Log_Error_sis = new tb_sis_Log_Error_Vzen_Info(ex.ToString(), "", arreglo, "",
                                                                                   "", "", "", "", DateTime.Now);
         oDataLog.Guardar_Log_Error(Log_Error_sis, ref mensaje);
         mensaje = ex.ToString() + " " + ex.Message;
         throw new Exception(ex.ToString());
     }
 }
コード例 #5
0
        public Boolean ModificarDB(pre_ordencompra_local_det_Info Info)
        {
            try
            {
                using (EntitiesPresupuesto context = new EntitiesPresupuesto())
                {
                    var Address = context.pre_ordencompra_local_det.FirstOrDefault(minfo => minfo.IdEmpresa == Info.IdEmpresa && minfo.IdSucursal == Info.IdSucursal && minfo.IdOrdenCompra == Info.IdOrdenCompra && minfo.Secuencia == Info.Secuencia);
                    if (Address != null)
                    {
                        Address.do_NumDocumento = Info.do_NumDocumento;
                        Address.do_precioCompra = Info.do_precioCompra;
                        Address.do_porc_des     = Info.do_porc_des;
                        Address.do_descuento    = Info.do_descuento;
                        Address.do_subtotal     = Info.do_subtotal;
                        Address.do_iva          = Info.do_iva;
                        Address.do_total        = Info.do_total;
                        Address.do_ManejaIva    = (Info.do_iva > 0.0) ? "S" : "N";
                        Address.do_observacion  = (Info.do_observacion == null) ? "" : Info.do_observacion;

                        context.SaveChanges();
                    }
                }
                return(true);
            }
            catch (Exception ex)
            {
                string arreglo = ToString();
                tb_sis_Log_Error_Vzen_Data oDataLog      = new tb_sis_Log_Error_Vzen_Data();
                tb_sis_Log_Error_Vzen_Info Log_Error_sis = new tb_sis_Log_Error_Vzen_Info(ex.ToString(), "", arreglo, "",
                                                                                          "", "", "", "", DateTime.Now);
                oDataLog.Guardar_Log_Error(Log_Error_sis, ref mensaje);
                mensaje = ex.ToString() + " " + ex.Message;
                throw new Exception(ex.ToString());
            }
        }
コード例 #6
0
        public Boolean GrabarDB(pre_ordencompra_local_Info Info, ref decimal IdOrdenCompra)
        {
            try
            {
                decimal IdOrdenCompra_ = getIdOrdenCompra(Info.IdEmpresa);
                IdOrdenCompra = IdOrdenCompra_;

                List <pre_ordencompra_local_Info> Lst = new List <pre_ordencompra_local_Info>();
                using (EntitiesPresupuesto Context = new EntitiesPresupuesto())
                {
                    var Address = new pre_ordencompra_local();

                    Address.IdEmpresa          = Info.IdEmpresa;
                    Address.IdSucursal         = Info.IdSucursal;
                    Address.IdOrdenCompra      = IdOrdenCompra_;
                    Address.IdProveedor        = Info.IdProveedor;
                    Address.oc_NumDocumento    = Info.oc_NumDocumento;
                    Address.oc_fecha           = Info.oc_fecha;
                    Address.oc_observacion     = Info.oc_observacion;
                    Address.Estado             = Info.Estado;
                    Address.IdEstadoAprobacion = Info.IdEstadoAprobacion;
                    Address.IdUsuario          = Info.IdUsuario;
                    // Address.co_fecha_aprobacion = null;// Info.co_fecha_aprobacion;
                    // Address.IdUsuario_Aprueba = Info.IdUsuario_Aprueba;
                    // Address.IdUsuario_Reprue = Info.IdUsuario_Reprue;
                    // Address.co_fechaReproba = null;// Info.co_fechaReproba;
                    Address.Fecha_Transac = Info.Fecha_Transac;
                    //Address.Fecha_UltMod = Info.Fecha_UltMod;
                    //Address.FechaHoraAnul = null;//Info.FechaHoraAnul;
                    //Address.IdUsuarioUltAnu = Info.IdUsuarioUltAnu;
                    Address.EstadoRecepcion = Info.EstadoRecepcion;
                    //Address.MotivoAnulacion = Info.MotivoAnulacion;
                    Address.IdTerminoPago = Info.IdTerminoPago;
                    Address.FormaEnvio    = Info.FormaEnvio;
                    Address.CondicionPago = Info.CondicionPago;

                    Context.pre_ordencompra_local.Add(Address);
                    Context.SaveChanges();

                    //Graba el detalle

                    Info.LstPedidoOC_det.ForEach(var => { var.IdEmpresa = Info.IdEmpresa; var.IdSucursal = Info.IdSucursal; var.IdOrdenCompra = IdOrdenCompra_; });
                    OCDet_D.GrabarLstDB(Info.LstPedidoOC_det);
                }
                return(true);
            }
            catch (Exception ex)
            {
                string arreglo = ToString();
                tb_sis_Log_Error_Vzen_Data oDataLog      = new tb_sis_Log_Error_Vzen_Data();
                tb_sis_Log_Error_Vzen_Info Log_Error_sis = new tb_sis_Log_Error_Vzen_Info(ex.ToString(), "", arreglo, "", "", "", "", "", DateTime.Now);
                oDataLog.Guardar_Log_Error(Log_Error_sis, ref mensaje);
                mensaje = ex.ToString() + " " + ex.Message;
                throw new Exception(ex.ToString());
            }
        }
コード例 #7
0
        public Boolean ModificarDB(pre_ordencompra_local_Info Info)
        {
            try
            {
                using (EntitiesPresupuesto context = new EntitiesPresupuesto())
                {
                    var Address = context.pre_ordencompra_local.FirstOrDefault(minfo => minfo.IdEmpresa == Info.IdEmpresa && minfo.IdSucursal == Info.IdSucursal && minfo.IdOrdenCompra == Info.IdOrdenCompra);
                    if (Address != null)
                    {
                        Address.IdProveedor        = Info.IdProveedor;
                        Address.oc_NumDocumento    = Info.oc_NumDocumento;
                        Address.oc_fecha           = Info.oc_fecha;
                        Address.oc_observacion     = Info.oc_observacion;
                        Address.Estado             = Info.Estado;
                        Address.IdEstadoAprobacion = Info.IdEstadoAprobacion;

                        // Address.co_fecha_aprobacion = null;// Info.co_fecha_aprobacion;
                        // Address.IdUsuario_Aprueba = Info.IdUsuario_Aprueba;
                        // Address.IdUsuario_Reprue = Info.IdUsuario_Reprue;
                        // Address.co_fechaReproba = null;// Info.co_fechaReproba;
                        Address.IdUsuarioUltMod = Info.IdUsuarioUltMod;
                        Address.Fecha_UltMod    = Info.Fecha_UltMod;
                        //Address.FechaHoraAnul = null;//Info.FechaHoraAnul;
                        //Address.IdUsuarioUltAnu = Info.IdUsuarioUltAnu;
                        Address.EstadoRecepcion = Info.EstadoRecepcion;
                        //Address.MotivoAnulacion = Info.MotivoAnulacion;
                        Address.IdTerminoPago = Info.IdTerminoPago;
                        Address.FormaEnvio    = Info.FormaEnvio;
                        Address.CondicionPago = Info.CondicionPago;

                        context.SaveChanges();

                        OCDet_D.ModificarLstDB(Info.LstPedidoOC_det);
                    }
                }
                return(true);
            }
            catch (Exception ex)
            {
                string arreglo = ToString();
                tb_sis_Log_Error_Vzen_Data oDataLog      = new tb_sis_Log_Error_Vzen_Data();
                tb_sis_Log_Error_Vzen_Info Log_Error_sis = new tb_sis_Log_Error_Vzen_Info(ex.ToString(), "", arreglo, "", "", "", "", "", DateTime.Now);
                oDataLog.Guardar_Log_Error(Log_Error_sis, ref mensaje);
                mensaje = ex.ToString() + " " + ex.Message;
                throw new Exception(ex.ToString());
            }
        }
コード例 #8
0
        public Boolean GrabarDB(pre_ordencompra_local_det_Info Info)
        {
            try
            {
                List <pre_ordencompra_local_det_Info> Lst = new List <pre_ordencompra_local_det_Info>();
                using (EntitiesPresupuesto Context = new EntitiesPresupuesto())
                {
                    var Address = new pre_ordencompra_local_det();

                    Address.IdEmpresa         = Info.IdEmpresa;
                    Address.IdSucursal        = Info.IdSucursal;
                    Address.IdOrdenCompra     = Info.IdOrdenCompra;
                    Address.Secuencia         = Info.Secuencia;
                    Address.IdPedidoXPre      = Info.IdPedidoXPre;
                    Address.Secuencia_reg_ped = Info.Secuencia_reg_ped;
                    Address.IdPresupuesto_pre = Info.IdPresupuesto_pre;
                    Address.IdAnio_pre        = Info.IdAnio_pre;
                    Address.Secuencia_pre     = Info.Secuencia_pre;
                    Address.Producto          = Info.Producto;
                    Address.do_Cantidad       = Info.do_Cantidad;
                    Address.do_precioCompra   = Info.do_precioCompra;
                    Address.do_porc_des       = Info.do_porc_des;
                    Address.do_descuento      = Info.do_descuento;
                    Address.do_subtotal       = Info.do_subtotal;
                    Address.do_iva            = Info.do_iva;
                    Address.do_total          = Info.do_total;
                    Address.do_ManejaIva      = (Info.do_iva > 0.0) ? "S" : "N";
                    Address.do_observacion    = (Info.do_observacion == null) ? "" : Info.do_observacion;
                    Address.do_NumDocumento   = Info.do_NumDocumento;

                    Context.pre_ordencompra_local_det.Add(Address);
                    Context.SaveChanges();
                }
                return(true);
            }
            catch (Exception ex)
            {
                string arreglo = ToString();
                tb_sis_Log_Error_Vzen_Data oDataLog      = new tb_sis_Log_Error_Vzen_Data();
                tb_sis_Log_Error_Vzen_Info Log_Error_sis = new tb_sis_Log_Error_Vzen_Info(ex.ToString(), "", arreglo, "", "", "", "", "", DateTime.Now);
                oDataLog.Guardar_Log_Error(Log_Error_sis, ref mensaje);
                mensaje = ex.ToString() + " " + ex.Message;
                throw new Exception(ex.ToString());
            }
        }
コード例 #9
0
 public Boolean GrabarDB(pre_PedidoXPresupuesto_Info Info, ref decimal IdPedidoXPre)
 {
     try
     {
         List <pre_PedidoXPresupuesto_Info> Lst = new List <pre_PedidoXPresupuesto_Info>();
         using (EntitiesPresupuesto Context = new EntitiesPresupuesto())
         {
             var Address = new pre_PedidoXPresupuesto();
             IdPedidoXPre           = getIdPedidoXPre(Info.IdEmpresa);
             Address.IdEmpresa      = Info.IdEmpresa;
             Address.IdPedidoXPre   = IdPedidoXPre;
             Address.IdDepartamento = Info.IdDepartamento;
             Address.Fecha          = Convert.ToDateTime(Info.Fecha.ToShortDateString());
             Address.Observacion    = Info.Observacion;
             Address.IdProveedor1   = Info.IdProveedor1;
             Address.IdProveedor2   = Info.IdProveedor2;
             Address.IdProveedor3   = Info.IdProveedor3;
             Address.IdUsuario      = Info.IdUsuario;
             Address.Fecha_Transac  = Info.Fecha_Transac;
             Address.nom_pc         = Info.nom_pc;
             Address.ip             = Info.ip;
             Address.Estado         = Info.Estado;
             Context.pre_PedidoXPresupuesto.Add(Address);
             Context.SaveChanges();
             //guardar detalle
             dat_det.GrabarLista(Info.Lst_PedidoXPre_D, IdPedidoXPre);
         }
         return(true);
     }
     catch (Exception ex)
     {
         string arreglo = ToString();
         tb_sis_Log_Error_Vzen_Data oDataLog      = new tb_sis_Log_Error_Vzen_Data();
         tb_sis_Log_Error_Vzen_Info Log_Error_sis = new tb_sis_Log_Error_Vzen_Info(ex.ToString(), "", arreglo, "",
                                                                                   "", "", "", "", DateTime.Now);
         oDataLog.Guardar_Log_Error(Log_Error_sis, ref mensaje);
         mensaje = ex.ToString() + " " + ex.Message;
         throw new Exception(ex.ToString());
     }
 }
コード例 #10
0
 public Boolean ModificarDB(List <pre_PedidoXPresupuesto_det_Info> Lst, int IdEmpresa, decimal IdPedidoXPre)
 {
     try
     {
         using (EntitiesPresupuesto context = new EntitiesPresupuesto())
         {
             context.Database.ExecuteSqlCommand("delete from pre_PedidoXPresupuesto_det where IdEmpresa =" + IdEmpresa + " and IdPedidoXPre = " + IdPedidoXPre);
             context.SaveChanges();
             GrabarLista(Lst, IdPedidoXPre);
         }
         return(true);
     }
     catch (Exception ex)
     {
         string arreglo = ToString();
         tb_sis_Log_Error_Vzen_Data oDataLog      = new tb_sis_Log_Error_Vzen_Data();
         tb_sis_Log_Error_Vzen_Info Log_Error_sis = new tb_sis_Log_Error_Vzen_Info(ex.ToString(), "", arreglo, "",
                                                                                   "", "", "", "", DateTime.Now);
         oDataLog.Guardar_Log_Error(Log_Error_sis, ref mensaje);
         mensaje = ex.ToString() + " " + ex.Message;
         throw new Exception(ex.ToString());
     }
 }
コード例 #11
0
        public Boolean ModificarDB(pre_PedidoXPresupuesto_Info info)
        {
            try
            {
                using (EntitiesPresupuesto context = new EntitiesPresupuesto())
                {
                    var contact = context.pre_PedidoXPresupuesto.FirstOrDefault(minfo => minfo.IdEmpresa == info.IdEmpresa && minfo.IdPedidoXPre == info.IdPedidoXPre);
                    if (contact != null)
                    {
                        contact.IdDepartamento  = info.IdDepartamento;
                        contact.Fecha           = Convert.ToDateTime(info.Fecha.ToShortDateString());
                        contact.Observacion     = info.Observacion;
                        contact.IdProveedor1    = info.IdProveedor1;
                        contact.IdProveedor2    = info.IdProveedor2;
                        contact.IdProveedor3    = info.IdProveedor3;
                        contact.Estado          = info.Estado;
                        contact.Fecha_UltMod    = info.Fecha_UltMod;
                        contact.IdUsuarioUltMod = info.IdUsuarioUltMod;

                        dat_det.ModificarDB(info.Lst_PedidoXPre_D, info.IdEmpresa, info.IdPedidoXPre);

                        context.SaveChanges();
                    }
                }
                return(true);
            }
            catch (Exception ex)
            {
                string arreglo = ToString();
                tb_sis_Log_Error_Vzen_Data oDataLog      = new tb_sis_Log_Error_Vzen_Data();
                tb_sis_Log_Error_Vzen_Info Log_Error_sis = new tb_sis_Log_Error_Vzen_Info(ex.ToString(), "", arreglo, "",
                                                                                          "", "", "", "", DateTime.Now);
                oDataLog.Guardar_Log_Error(Log_Error_sis, ref mensaje);
                mensaje = ex.ToString() + " " + ex.Message;
                throw new Exception(ex.ToString());
            }
        }
コード例 #12
0
        public Boolean GrabarDB(pre_PedidoXPresupuesto_det_Info Info)
        {
            try
            {
                List <pre_PedidoXPresupuesto_det_Info> Lst = new List <pre_PedidoXPresupuesto_det_Info>();
                using (EntitiesPresupuesto Context = new EntitiesPresupuesto())
                {
                    var Address = new pre_PedidoXPresupuesto_det();

                    Address.IdEmpresa         = Info.IdEmpresa;
                    Address.IdPedidoXPre      = Info.IdPedidoXPre;
                    Address.Secuencia_reg     = Info.Secuencia_reg;
                    Address.IdPresupuesto_pre = Info.IdPresupuesto_pre;
                    Address.IdAnio_pre        = Info.IdAnio_pre;
                    Address.Secuencia_pre     = Info.Secuencia_pre;
                    Address.Producto          = Info.Producto;
                    Address.Cant = Info.Cant;
                    Address.CodEstadoAprobacion = "PEN";
                    Address.Cotizado            = "N";

                    Context.pre_PedidoXPresupuesto_det.Add(Address);
                    Context.SaveChanges();
                }
                return(true);
            }
            catch (Exception ex)
            {
                string arreglo = ToString();
                tb_sis_Log_Error_Vzen_Data oDataLog      = new tb_sis_Log_Error_Vzen_Data();
                tb_sis_Log_Error_Vzen_Info Log_Error_sis = new tb_sis_Log_Error_Vzen_Info(ex.ToString(), "", arreglo, "",
                                                                                          "", "", "", "", DateTime.Now);
                oDataLog.Guardar_Log_Error(Log_Error_sis, ref mensaje);
                mensaje = ex.ToString() + " " + ex.Message;
                throw new Exception(ex.ToString());
            }
        }
コード例 #13
0
 public Boolean GuardarDB(int IdEmpresa, List <pre_presupuesto_Info> lista)
 {
     try
     {
         EntitiesPresupuesto pre = new EntitiesPresupuesto();
         var listaux             = from q in pre.pre_presupuesto
                                   where q.IdEmpresa == IdEmpresa
                                   select q;
         lista.ForEach(x => x.IdAnio = x.IdAnio.Trim());
         foreach (var item in lista)
         {
             using (EntitiesPresupuesto context = new EntitiesPresupuesto())
             {
                 if ((from w in listaux.ToList()
                      where w.IdEmpresa == item.IdEmpresa && w.IdPresupuesto == item.IdPresupuesto && w.IdAnio == item.IdAnio && w.IdTipoRubro == item.IdTipoRubro
                      select w).Count() == 0)
                 {
                     var Obj = new pre_presupuesto();
                     Obj.IdEmpresa     = IdEmpresa;
                     Obj.IdPresupuesto = item.IdPresupuesto;
                     Obj.IdAnio        = item.IdAnio;
                     if (item.Secuencia == 0)
                     {
                         Obj.Secuencia = getSecuencia(IdEmpresa, item.IdAnio, item.IdPresupuesto);
                     }
                     else
                     {
                         Obj.Secuencia = item.Secuencia;
                     }
                     Obj.CodigoPresupuesto = Convert.ToString(item.IdPresupuesto) + "-" + item.IdCtaCble + "-" + item.IdCentroCosto + "-" + item.IdTipoRubro;
                     Obj.IdCtaCble         = item.IdCtaCble;
                     Obj.IdCentroCosto     = item.IdCentroCosto;
                     Obj.IdTipoRubro       = item.IdTipoRubro;
                     Obj.CodRubro          = item.CodRubro;
                     Obj.NombreRubro       = Convert.ToString(item.NombreRubro.Trim());
                     Obj.Enero             = item.Enero;
                     Obj.febrero           = item.febrero;
                     Obj.Marzo             = item.Marzo;
                     Obj.Abril             = item.Abril;
                     Obj.Mayo       = item.Mayo;
                     Obj.Junio      = item.Junio;
                     Obj.Julio      = item.Julio;
                     Obj.Agosto     = item.Agosto;
                     Obj.Septiembre = item.Septiembre;
                     Obj.Octubre    = item.Octubre;
                     Obj.Noviembre  = item.Noviembre;
                     Obj.Diciembre  = item.Diciembre;
                     Obj.Total      = item.Total;
                     context.pre_presupuesto.Add(Obj);
                     try
                     {
                         context.SaveChanges();
                     }
                     catch (Exception ex) {
                         string arreglo = ToString();
                         tb_sis_Log_Error_Vzen_Data oDataLog      = new tb_sis_Log_Error_Vzen_Data();
                         tb_sis_Log_Error_Vzen_Info Log_Error_sis = new tb_sis_Log_Error_Vzen_Info(ex.ToString(), "", arreglo, "", "", "", "", "", DateTime.Now);
                         oDataLog.Guardar_Log_Error(Log_Error_sis, ref mensaje);
                         mensaje = ex.ToString() + " " + ex.Message;
                     }
                 }
                 else
                 {
                     return(false);
                 }
             }
         }
         return(true);
     }
     catch (Exception ex)
     {
         string arreglo = ToString();
         tb_sis_Log_Error_Vzen_Data oDataLog      = new tb_sis_Log_Error_Vzen_Data();
         tb_sis_Log_Error_Vzen_Info Log_Error_sis = new tb_sis_Log_Error_Vzen_Info(ex.ToString(), "", arreglo, "", "", "", "", "", DateTime.Now);
         oDataLog.Guardar_Log_Error(Log_Error_sis, ref mensaje);
         mensaje = ex.ToString() + " " + ex.Message;
         throw new Exception(ex.ToString());
     }
 }