Exemple #1
0
 public Boolean AnularDB(ba_prestamo_Info _Info)
 {
     try
     {
         using (EntitiesBanco Entity = new EntitiesBanco())
         {
             ba_prestamo cabecera = Entity.ba_prestamo.FirstOrDefault(v => v.IdPrestamo == _Info.IdPrestamo && v.IdEmpresa == _Info.IdEmpresa);
             if (cabecera != null)
             {
                 cabecera.IdUsuarioUltAnu = _Info.IdUsuarioUltAnu;
                 cabecera.Fecha_UltAnu    = _Info.Fecha_UltAnu;
                 cabecera.MotiAnula       = _Info.MotiAnula;
                 cabecera.Estado          = "I";
                 Entity.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());
     }
 }
Exemple #2
0
        public Boolean GuardarDB(ba_prestamo_Info Item, ref decimal Id, ref string msg)
        {
            try
            {
                using (EntitiesBanco Context = new EntitiesBanco())
                {
                    ba_prestamo Cabe = new ba_prestamo();

                    Cabe.IdEmpresa         = Item.IdEmpresa;
                    Cabe.IdPrestamo        = Id = GetIdPrestamo(Item.IdEmpresa);
                    Cabe.IdBanco           = Item.IdBanco;
                    Cabe.CodPrestamo       = Item.CodPrestamo;
                    Cabe.IdMotivo_Prestamo = Item.IdMotivo_Prestamo;
                    Cabe.Fecha             = Convert.ToDateTime(Item.Fecha.ToShortDateString());
                    Cabe.MontoSol          = Item.MontoSol;
                    Cabe.TasaInteres       = Item.TasaInteres;
                    Cabe.TotalPrestamo     = Item.TotalPrestamo;
                    Cabe.NumCuotas         = Item.NumCuotas;
                    Cabe.IdTipo_Pago       = Item.IdTipo_Pago;
                    Cabe.IdMetCalc         = Item.IdMetCalc;
                    Cabe.Fecha_PriPago     = Item.Fecha_PriPago;
                    Cabe.Observacion       = Item.Observacion;
                    Cabe.IdUsuario         = Item.IdUsuario;
                    Cabe.Estado            = "A";
                    Cabe.Fecha_Transac     = Item.Fecha_Transac;
                    Cabe.nom_pc            = Item.nom_pc;
                    Cabe.ip           = Item.ip;
                    Cabe.Pago_contado = Item.Pago_contado;
                    Cabe.IdTipoFlujo  = Item.IdTipoFlujo;
                    Cabe.IdCtaCble    = Item.IdCtaCble;
                    Cabe.IdCliente    = Item.IdCliente;
                    Context.ba_prestamo.Add(Cabe);
                    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.InnerException + " " + ex.Message;
                msg     = ex.InnerException + " " + ex.Message;
                throw new Exception(ex.InnerException.ToString());
            }
        }
Exemple #3
0
        }//haac 08/10/13

        public Boolean ModificarDB(ba_prestamo_Info Info)
        {
            try
            {
                using (EntitiesBanco Entity = new EntitiesBanco())
                {
                    ba_prestamo prestamo = Entity.ba_prestamo.FirstOrDefault(v => v.IdPrestamo == Info.IdPrestamo && v.IdEmpresa == Info.IdEmpresa);
                    if (prestamo != null)
                    {
                        prestamo.CodPrestamo       = Info.CodPrestamo;
                        prestamo.Fecha             = Info.Fecha;
                        prestamo.IdMotivo_Prestamo = Info.IdMotivo_Prestamo;
                        prestamo.MontoSol          = Info.MontoSol;
                        prestamo.TasaInteres       = Info.TasaInteres;
                        prestamo.TotalPrestamo     = Info.TotalPrestamo;
                        prestamo.IdTipo_Pago       = Info.IdTipo_Pago;
                        prestamo.Fecha_PriPago     = Info.Fecha_PriPago;
                        prestamo.Observacion       = Info.Observacion;
                        prestamo.Fecha_UltMod      = DateTime.Now;//Info.Fecha_UltMod;
                        prestamo.IdUsuarioUltMod   = Info.IdUsuarioUltMod;
                        prestamo.IdTipoFlujo       = Info.IdTipoFlujo;
                        prestamo.Pago_contado      = Info.Pago_contado;
                        prestamo.IdCtaCble         = Info.IdCtaCble;
                        prestamo.IdCliente         = Info.IdCliente;
                        Entity.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());
            }
        }