Example #1
0
        public Boolean ModificarDB(fa_devol_venta_Info info, ref string msgs)
        {
            try
            {
                using (EntitiesFacturacion context = new EntitiesFacturacion())
                {
                    var contact = context.fa_devol_venta.FirstOrDefault(cot => cot.IdEmpresa == info.IdEmpresa && cot.IdDevolucion == info.IdDevolucion && cot.IdSucursal == info.IdSucursal && cot.IdBodega == info.IdBodega);
                    if (contact != null)
                    {
                        contact.mvInv_IdEmpresa         = info.mvInv_IdEmpresa;
                        contact.mvInv_IdSucursal        = info.mvInv_IdSucursal;
                        contact.mvInv_IdBodega          = info.mvInv_IdBodega;
                        contact.mvInv_IdNumMovi         = info.mvInv_IdNumMovi;
                        contact.mvInv_IdMovi_inven_tipo = info.mvInv_IdMovi_inven_tipo;

                        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);
                msgs = ex.ToString();
                oDataLog.Guardar_Log_Error(Log_Error_sis, ref msgs);
                throw new Exception(ex.ToString());
            }
        }
        public in_movi_inve_Info setInventarioMovi(fa_devol_venta_Info Info)
        {
            try
            {
                in_movi_inve_Info invCabInfo = new in_movi_inve_Info();
                fa_parametro_info inf        = new fa_parametro_info();
                fa_parametro_Bus  FaPaBus    = new fa_parametro_Bus();
                invCabInfo.IdEmpresa  = Info.IdEmpresa;
                invCabInfo.IdBodega   = Info.IdBodega;
                invCabInfo.IdSucursal = Info.IdSucursal;
                invCabInfo.IdNumMovi  = Info.IdDevolucion;

                inf = FaPaBus.Get_Info_parametro(param.IdEmpresa);
                invCabInfo.IdMovi_inven_tipo = inf.IdMovi_inven_tipo_Dev_Vta;
                invCabInfo.cm_tipo           = "+";
                invCabInfo.CodMoviInven      = "DEV" + Info.IdDevolucion;
                invCabInfo.cm_observacion    = "DEV VTA " + Info.IdDevolucion + " A LA FAC # " + Info.IdCbteVta + "/" + Info.IdCbteVta + " Al Cliente: " + Info.IdCliente + " por el monto de: " + Info.totalDev;
                invCabInfo.cm_fecha          = Info.dv_fecha;
                invCabInfo.Estado            = Info.Estado;
                invCabInfo.ip        = param.ip;
                invCabInfo.IdUsuario = Info.IdUsuario;
                invCabInfo.nom_pc    = param.nom_pc;

                //detalle movimiento inventario
                List <in_movi_inve_detalle_Info> invList = new List <in_movi_inve_detalle_Info>();

                int secuencia = 0;
                foreach (var item in Info.DetalleDeVta)
                {
                    in_movi_inve_detalle_Info info = new in_movi_inve_detalle_Info();
                    info.IdEmpresa         = item.IdEmpresa;
                    info.IdBodega          = item.IdBodega;
                    info.IdSucursal        = item.IdSucursal;
                    info.IdNumMovi         = invCabInfo.IdNumMovi;
                    info.IdMovi_inven_tipo = inf.IdMovi_inven_tipo_Dev_Vta;
                    //info.IdNumMovi = item.IdCbteVta;
                    secuencia        += 1;
                    info.Secuencia   += secuencia;
                    info.mv_tipo_movi = "+";
                    info.IdProducto   = item.IdProducto;
                    info.dm_cantidad  = +item.dv_cantidad;
                    //info.dm_stock_actu = item.IdSucursal;
                    info.dm_observacion = invCabInfo.cm_observacion;
                    info.mv_costo       = item.dv_costo;
                    invList.Add(info);
                }
                invCabInfo.listmovi_inve_detalle_Info = invList;
                return(invCabInfo);
            }
            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("", "setInventarioMovi", ex.Message), ex)
                      {
                          EntityType = typeof(fa_devol_venta_Bus)
                      };
            }
        }
        public Boolean ModificarDB(List <fa_devol_venta_det_Info> Lista, fa_devol_venta_Info info)
        {
            try
            {
                List <fa_devol_venta_det_Info> listaAux = new List <fa_devol_venta_det_Info>();
                listaAux = Get_List_devol_venta_det(info.IdEmpresa, info.IdSucursal, info.IdBodega, info.IdDevolucion);

                using (EntitiesFacturacion context = new EntitiesFacturacion())
                {
                    foreach (var item in listaAux)
                    {
                        var contact = context.fa_devol_venta_det.FirstOrDefault(cot => cot.IdEmpresa == info.IdEmpresa && cot.IdDevolucion == info.IdDevolucion && cot.IdSucursal == info.IdSucursal && cot.IdBodega == info.IdBodega);
                        if (contact != null)
                        {
                            context.fa_devol_venta_det.Remove(contact);
                            context.SaveChanges();
                        }
                    }

                    foreach (var item in Lista)
                    {
                        var address = new fa_devol_venta_det();
                        address.IdEmpresa      = item.IdEmpresa;
                        address.IdSucursal     = item.IdSucursal;
                        address.IdBodega       = item.IdBodega;
                        address.IdDevolucion   = info.IdDevolucion;
                        address.Secuencia      = item.Secuencia;
                        address.IdProducto     = item.IdProducto;
                        address.dv_cantidad    = item.dv_cantidad;
                        address.dv_valor       = item.dv_valor;
                        address.dv_PorDescUni  = item.dv_PorDescUni;
                        address.dv_descUni     = item.dv_descUni;
                        address.dv_PrecioFinal = item.dv_PrecioFinal;
                        address.dv_subtotal    = item.dv_subtotal;
                        address.dv_iva         = item.dv_iva;
                        address.dv_total       = item.dv_total;
                        address.dv_costo       = item.dv_costo;
                        context.fa_devol_venta_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);
                mensaje = ex.ToString();
                oDataLog.Guardar_Log_Error(Log_Error_sis, ref mensaje);
                throw new Exception(ex.ToString());
            }
        }
 private void gridView1_RowClick(object sender, DevExpress.XtraGrid.Views.Grid.RowClickEventArgs e)
 {
     try
     {
         infoDev = new fa_devol_venta_Info();
         infoDev = GetSelectedRow((DevExpress.XtraGrid.Views.Grid.GridView)sender);
     }
     catch (Exception ex)
     {
         Log_Error_bus.Log_Error(ex.ToString());
     }
 }
Example #5
0
        public fa_devol_venta_Info Get_Info_devol_venta(int IdEmpresa, int IdSucursal, int IdBodega, decimal IdDevolucion, ref string msg)
        {
            try
            {
                fa_devol_venta_Info info = new fa_devol_venta_Info();
                EntitiesFacturacion Dev  = new EntitiesFacturacion();

                var Devo = from C in Dev.fa_devol_venta where C.IdBodega == IdBodega && C.IdSucursal == IdSucursal && C.IdEmpresa == IdEmpresa && C.IdDevolucion == IdDevolucion select C;

                foreach (var item in Devo)
                {
                    info.IdEmpresa               = item.IdEmpresa;
                    info.IdSucursal              = item.IdSucursal;
                    info.IdBodega                = item.IdBodega;
                    info.IdDevolucion            = item.IdDevolucion;
                    info.IdCbteVta               = item.IdCbteVta;
                    info.CodDevolucion           = item.CodDevolucion;
                    info.IdCliente               = item.IdCliente;
                    info.IdVendedor              = item.IdVendedor;
                    info.dv_fecha                = Convert.ToDateTime(item.dv_fecha.ToShortDateString());
                    info.IdCbteVta               = item.IdCbteVta;
                    info.IdNota                  = item.IdNota;
                    info.dv_Observacion          = item.dv_Observacion;
                    info.dv_seguro               = Convert.ToDouble(item.dv_seguro);
                    info.dv_flete                = Convert.ToDouble(item.dv_flete);
                    info.dv_interes              = Convert.ToDouble(item.dv_interes);
                    info.dv_OtroValor1           = Convert.ToDouble(item.dv_OtroValor1);
                    info.dv_OtroValor2           = Convert.ToDouble(item.dv_OtroValor2);
                    info.IdUsuario               = item.IdUsuario;
                    info.Estado                  = item.Estado;
                    info.IdUsuario               = item.IdUsuario;
                    info.mvInv_IdEmpresa         = Convert.ToInt32(item.mvInv_IdEmpresa);
                    info.mvInv_IdSucursal        = Convert.ToInt32(item.mvInv_IdSucursal);
                    info.mvInv_IdBodega          = Convert.ToInt32(item.mvInv_IdBodega);
                    info.mvInv_IdMovi_inven_tipo = Convert.ToInt32(item.mvInv_IdMovi_inven_tipo);
                    info.mvInv_IdNumMovi         = Convert.ToInt32(item.mvInv_IdNumMovi);


                    msg = Convert.ToString(item.CodDevolucion);
                }
                return(info);
            }
            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);
                msg = ex.ToString();
                oDataLog.Guardar_Log_Error(Log_Error_sis, ref msg);
                throw new Exception(ex.ToString());
            }
        }
 public Boolean ModificarDB(fa_devol_venta_Info info, ref string msgs)
 {
     try
     {
         return(data.ModificarDB(info, ref msgs));
     }
     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("", "ModificarCabecera", ex.Message), ex)
               {
                   EntityType = typeof(fa_devol_venta_Bus)
               };
     }
 }
 public Boolean ModificarDB(List <fa_devol_venta_det_Info> Lista, fa_devol_venta_Info info)
 {
     try
     {
         return(oData.ModificarDB(Lista, info));
     }
     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("", "ModificarDetalle", ex.Message), ex)
               {
                   EntityType = typeof(fa_devol_venta_det_Bus)
               };
     }
 }
        public Boolean GuardarDB(fa_devol_venta_Info Info, ref string msg)
        {
            try
            {
                // nota de credito
                fa_notaCredDeb_Bus         BusBNotaDB = new fa_notaCredDeb_Bus();
                in_movi_inve_Info          invCabInfo = new in_movi_inve_Info();
                in_movi_inve_Bus           inBus      = new in_movi_inve_Bus();
                cxc_cobro_Info             Cobro      = new cxc_cobro_Info();
                cl_parametrosGenerales_Bus param      = cl_parametrosGenerales_Bus.Instance;
                string  mensaje_cbte_cble             = "";
                decimal idNota                = 0;
                string  codigoNota            = "";
                string  mensajeDocumentoDupli = "";
                string  mensajeError          = "";
                string  numDocumento          = "";


                if (BusBNotaDB.GuardarDB(Info.InfoNotaCreDeb, ref idNota, ref mensajeDocumentoDupli, ref mensajeError))
                {
                    Info.IdNota = idNota;
                    data.GuardarDB(Info, ref msg);
                    invCabInfo = setInventarioMovi(Info);
                    inBus.GrabarDB(invCabInfo, ref idNota, ref mensaje_cbte_cble, ref msg);
                }


                return(true);
            }
            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("", "GuardarDB", ex.Message), ex)
                      {
                          EntityType = typeof(fa_devol_venta_Bus)
                      };
            }
        }
        public Boolean AnularDevolucion(int idEmpresa, int idSucursal, int idBodega, decimal idDevolucion, DateTime Fecha_Anulacion, string motivo, ref string mensageError)
        {
            try
            {
                in_movi_inve_Bus    MoviInve_Bus = new in_movi_inve_Bus();
                in_movi_inve_Info   InfoMoviAnu  = new in_movi_inve_Info();
                fa_devol_venta_Bus  DevVtaBus    = new fa_devol_venta_Bus();
                fa_devol_venta_Info DevVta_info  = new fa_devol_venta_Info();
                fa_notaCredDeb_Bus  BusBNotaDB   = new fa_notaCredDeb_Bus();
                fa_notaCreDeb_Info  InfoNotaCre  = new fa_notaCreDeb_Info();
                Boolean             resAnuMoviInv;
                Boolean             resAnuDevVta;
                string MensajeError = "";



                Fecha_Anulacion = Convert.ToDateTime(Fecha_Anulacion.ToShortDateString());

                #region "validaciones"
                ct_Periodo_Bus Perbus = new ct_Periodo_Bus();


                if (Perbus.Get_Periodo_Esta_Cerrado(idEmpresa, Fecha_Anulacion, ref MensajeError))
                {
                    mensageError = "no se puede anular por q el periodo esta cerrardo para esta fecha de anulacion";
                    return(false);
                }

                #endregion


                DevVta_info = DevVtaBus.Get_Info_devol_vent(idEmpresa, idSucursal, idBodega, idDevolucion, ref mensageError);

                ///////// optengo el movimiento de inventario q se genero por la devolcuion en vta
                InfoMoviAnu = MoviInve_Bus.Get_Info_Movi_inven
                                  (DevVta_info.mvInv_IdEmpresa, DevVta_info.mvInv_IdSucursal, DevVta_info.mvInv_IdBodega, DevVta_info.mvInv_IdMovi_inven_tipo, DevVta_info.mvInv_IdNumMovi);
                ///////////////

                InfoMoviAnu.MotivoAnulacion = motivo;
                InfoMoviAnu.IdusuarioUltAnu = param.IdUsuario;

                //////////// anula el movimiento de inventario /////////////////////////
                resAnuMoviInv = MoviInve_Bus.AnularDB(InfoMoviAnu, Fecha_Anulacion, ref mensageError);
                //////////// anula el movimiento de inventario /////////////////////////

                //////////// anula el la cabecera de dev vat
                resAnuDevVta = data.AnularDB(idEmpresa, idSucursal, idBodega, idDevolucion, motivo);
                //////////// anula el la cabecera de dev vat

                //////////// anula la nota de credito
                InfoNotaCre                 = BusBNotaDB.Get_Info_notaCreDeb_x_ND(idEmpresa, idSucursal, idBodega, DevVta_info.IdNota);
                InfoNotaCre.MotiAnula       = motivo;
                InfoNotaCre.IdUsuarioUltAnu = param.IdUsuario;
                InfoNotaCre.Fecha_UltAnu    = Fecha_Anulacion;
                BusBNotaDB.AnularDB(InfoNotaCre, ref mensageError);
                //////////// anula la nota de credito

                ///modifica la devolucion

                ///

                return(resAnuMoviInv && resAnuDevVta);
            }
            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("", "AnularDevolucion", ex.Message), ex)
                      {
                          EntityType = typeof(fa_devol_venta_Bus)
                      };
            }
        }
Example #10
0
        public List <fa_devol_venta_Info> Get_List_devol_venta(int IdEmpresa, int IdSucursalIni, int IdSucursalFin, int IdBodegaIni, int IdBodegaFin
                                                               , DateTime FechaIni, DateTime FechaFin)
        {
            try
            {
                List <fa_devol_venta_Info> DEVInfo = new List <fa_devol_venta_Info>();

                EntitiesFacturacion OEFAC = new EntitiesFacturacion();
                //
                var SelectFactura = from q in OEFAC.vwfa_devolucion select q;
                if (IdSucursalIni == 0)
                {
                    SelectFactura = from q in OEFAC.vwfa_devolucion
                                    where q.IdEmpresa == IdEmpresa && q.dv_fecha >= FechaIni && q.dv_fecha <= FechaFin
                                    select q;
                }
                else
                {
                    //
                    SelectFactura = from q in OEFAC.vwfa_devolucion
                                    where q.IdEmpresa == IdEmpresa &&
                                    q.IdBodega >= IdBodegaIni && q.IdBodega <= IdBodegaFin &&
                                    q.IdSucursal >= IdSucursalIni && q.IdSucursal <= IdSucursalFin &&
                                    q.dv_fecha >= FechaIni && q.dv_fecha <= FechaFin
                                    select q;
                }


                var CabeceraFactura = from cab in SelectFactura
                                      group cab by new
                {
                    cab.IdEmpresa,
                    cab.IdSucursal,
                    cab.IdBodega,
                    cab.IdDevolucion,
                    cab.bo_Descripcion,
                    cab.IdCbteVta,
                    cab.IdCliente,
                    cab.dv_fecha,
                    cab.IdUsuario,
                    cab.pe_nombreCompleto,
                    cab.IdVendedor,
                    cab.Ve_Vendedor,
                    cab.Su_Descripcion,
                    cab.IdNota,
                    //cab.dv_iva,
                    //cab.dv_subtotal,
                    cab.vt_NumFactura,
                    cab.vt_serie1,
                    cab.vt_serie2,
                    cab.dv_seguro,
                    cab.dv_flete,
                    cab.dv_interes,
                    cab.dv_OtroValor1,
                    cab.dv_OtroValor2,

                    cab.CodDevolucion,
                    cab.dv_Observacion,
                    cab.Estado
                }
                into grouping
                    select new { grouping.Key, subototal = grouping.Sum(p => p.dv_subtotal), iva = grouping.Sum(p => p.dv_iva), Total = grouping.Sum(p => p.dv_total) };

                foreach (var item in CabeceraFactura)
                {
                    fa_devol_venta_Info info = new fa_devol_venta_Info();

                    List <fa_devol_venta_det_Info> ListDet = new List <fa_devol_venta_det_Info>();


                    info.IdCbteVta      = item.Key.IdCbteVta;
                    info.IdEmpresa      = item.Key.IdEmpresa;
                    info.IdSucursal     = item.Key.IdSucursal;
                    info.IdBodega       = item.Key.IdBodega;
                    info.Bodega         = item.Key.bo_Descripcion;
                    info.IdDevolucion   = item.Key.IdDevolucion;
                    info.Cliente        = item.Key.pe_nombreCompleto;
                    info.Vendedor       = item.Key.Ve_Vendedor;
                    info.Sucursal       = item.Key.Su_Descripcion;
                    info.IdCliente      = item.Key.IdCliente;
                    info.dv_fecha       = item.Key.dv_fecha;
                    info.IdVendedor     = item.Key.IdVendedor;
                    info.IdCbteVta      = item.Key.IdCbteVta;
                    info.IdUsuario      = item.Key.IdUsuario;
                    info.dv_Observacion = item.Key.dv_Observacion;
                    info.Subtotal       = Convert.ToDouble(item.subototal);
                    info.Estado         = item.Key.Estado;
                    info.IVA            = item.iva;
                    info.Total          = item.Total;
                    info.vt_serie1      = item.Key.vt_serie1;
                    info.IdNota         = item.Key.IdNota;
                    info.vt_serie2      = item.Key.vt_serie2;
                    info.vt_NumFactura  = item.Key.vt_NumFactura;
                    info.CodDevolucion  = item.Key.CodDevolucion;
                    info.dv_seguro      = Convert.ToDouble(item.Key.dv_seguro);
                    info.dv_flete       = Convert.ToDouble(item.Key.dv_flete);
                    info.dv_interes     = Convert.ToDouble(item.Key.dv_interes);
                    info.dv_OtroValor1  = Convert.ToDouble(item.Key.dv_OtroValor1);
                    info.dv_OtroValor2  = Convert.ToDouble(item.Key.dv_OtroValor2);
                    DEVInfo.Add(info);
                }

                return(DEVInfo);
            }
            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);
                mensaje = ex.ToString();
                oDataLog.Guardar_Log_Error(Log_Error_sis, ref mensaje);
                throw new Exception(ex.ToString());
            }
        }
Example #11
0
        public Boolean GuardarDB(fa_devol_venta_Info Info, ref string msg)
        {
            try
            {
                using (EntitiesFacturacion context = new EntitiesFacturacion())
                {
                    EntitiesFacturacion Dev = new EntitiesFacturacion();


                    decimal IdDev = 0;
                    try
                    {
                        IdDev = (from C in Dev.fa_devol_venta where C.IdBodega == Info.IdBodega && C.IdSucursal == Info.IdSucursal && C.IdEmpresa == Info.IdEmpresa select C.IdDevolucion).Max() + 1;
                    }
                    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);
                        msg = ex.InnerException + " " + ex.Message;
                        oDataLog.Guardar_Log_Error(Log_Error_sis, ref msg);
                    }
                    if (IdDev == 0)
                    {
                        IdDev = 1;
                    }
                    var addressG = new fa_devol_venta();
                    addressG.IdEmpresa      = Info.IdEmpresa;
                    addressG.IdSucursal     = Info.IdSucursal;
                    addressG.IdBodega       = Info.IdBodega;
                    addressG.IdDevolucion   = Info.IdDevolucion = IdDev;
                    addressG.IdCbteVta      = Info.IdCbteVta;
                    addressG.CodDevolucion  = (Info.CodDevolucion == "") ? "DEV" + IdDev.ToString() : Info.CodDevolucion;
                    addressG.IdCliente      = Info.IdCliente;
                    addressG.IdVendedor     = Info.IdVendedor;
                    addressG.dv_fecha       = Convert.ToDateTime(Info.dv_fecha.ToShortDateString());
                    addressG.IdCbteVta      = Info.IdCbteVta;
                    addressG.IdNota         = Info.IdNota;
                    addressG.dv_Observacion = Info.dv_Observacion;
                    addressG.dv_seguro      = Info.dv_seguro;
                    addressG.dv_flete       = Info.dv_flete;
                    addressG.dv_interes     = Info.dv_interes;
                    addressG.dv_OtroValor1  = Info.dv_OtroValor1;
                    addressG.dv_OtroValor2  = Info.dv_OtroValor2;
                    addressG.IdUsuario      = Info.IdUsuario;
                    addressG.Estado         = Info.Estado;
                    addressG.IdUsuario      = Info.IdUsuario;


                    if (Info.DetalleDeVta != null)
                    {
                        context.fa_devol_venta.Add(addressG);
                        context.SaveChanges();
                        msg = Convert.ToString(IdDev);

                        fa_devol_venta_det_Data oData = new fa_devol_venta_det_Data();
                        oData.GuardarDB(Info.DetalleDeVta, ref msg);
                    }
                }
                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);
                msg = ex.ToString();
                oDataLog.Guardar_Log_Error(Log_Error_sis, ref msg);
                throw new Exception(ex.ToString());
            }
        }