Пример #1
0
 public Boolean AnularDB(ba_Inversion_Info Info, ref string msg)
 {
     try
     {
         using (EntitiesBanco context = new EntitiesBanco())
         {
             ba_Inversion item = new ba_Inversion();
             item = context.ba_Inversion.FirstOrDefault(var => var.IdEmpresa == Info.IdEmpresa && var.IdInversion == Info.IdInversion);
             if (item != null)
             {
                 item.Estado          = "I";
                 item.Fecha_UltAnu    = Info.Fecha_UltAnu;
                 item.IdUsuarioUltAnu = Info.IdUsuarioUltAnu;
                 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;
         msg     = ex.Message + ex.ToString();
         throw new Exception(ex.ToString());
     }
 }
Пример #2
0
 public void setinfo(ba_Inversion_Info info)
 {
     try
     {
         infograbar              = info;
         lblIdInversion.Text     = Convert.ToString(info.IdInversion);
         txtCodigo.Text          = info.Cod_Inversion;
         cmbBanco.EditValue      = info.IdBanco;
         dtpFecha.EditValue      = info.Fecha;
         txtMonto.Text           = Convert.ToString(info.Monto);
         txtPRetencion.EditValue = info.Por_Retencion;
         txtTasa.Text            = Convert.ToString(info.Tasa);
         txtInteres.Text         = Convert.ToString(info.Valor_interes);
         txtPlazo.Text           = Convert.ToString(info.Plazo);
         txtOtros.Text           = Convert.ToString(info.Otros);
         txtCapital.Text         = txtMonto.Text;
         txtTotal.Text           = Convert.ToString(info.Total_recibir);
         txtObservacion.Text     = info.Observacion;
         lblAnulado.Visible      = (info.Estado == "I") ? true : false;
     }
     catch (Exception ex)
     {
         string NameMetodo = System.Reflection.MethodBase.GetCurrentMethod().Name;
         MessageBox.Show(param.Get_Mensaje_sys(enum_Mensajes_sys.Error_comunicarse_con_sistemas) + ex.Message + " ", param.Nombre_sistema, MessageBoxButtons.OK, MessageBoxIcon.Error);
         Log_Error_bus.Log_Error(NameMetodo + " - " + ex.ToString());
     }
 }
Пример #3
0
 public Boolean AnularDB(ba_Inversion_Info Info, ref string msg)
 {
     try
     {
         return(data.AnularDB(Info, ref msg));
     }
     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("", "AnularDB", ex.Message), ex)
               {
                   EntityType = typeof(ba_Inversion_Bus)
               };
     }
 }
Пример #4
0
        public Boolean ModificarDB(ba_Inversion_Info Info, ref string msg)
        {
            Boolean res = false;

            try
            {
                using (EntitiesBanco context = new EntitiesBanco())
                {
                    ba_Inversion item = new ba_Inversion();

                    item = context.ba_Inversion.FirstOrDefault(var => var.IdEmpresa == Info.IdEmpresa && var.IdInversion == Info.IdInversion);
                    if (item != null)
                    {
                        item.Capital         = Info.Capital;
                        item.Cod_Inversion   = Info.Cod_Inversion;
                        item.Fecha           = Info.Fecha;
                        item.Fecha_Transac   = Info.Fecha_Transac;
                        item.Fecha_Vct       = Info.Fecha_Vct;
                        item.Monto           = Info.Monto;
                        item.Observacion     = Info.Observacion;
                        item.Otros           = Info.Otros;
                        item.Plazo           = Info.Plazo;
                        item.Por_Retencion   = Convert.ToDouble(Info.Por_Retencion);
                        item.Tasa            = Convert.ToDouble(Info.Tasa);
                        item.Tasa_interes    = Info.Tasa_interes;
                        item.Total_recibir   = Info.Total_recibir;
                        item.Valor_interes   = Info.Valor_interes;
                        item.Valor_retencion = Info.Valor_retencion;
                        item.Estado          = Info.Estado;
                        context.SaveChanges();
                        res = true;
                    }
                }
                return(res);
            }
            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;

                msg = ex.Message + ex.ToString();
                throw new Exception(ex.ToString());
            }
        }
Пример #5
0
        public Boolean GrabarDB(ba_Inversion_Info Info, ref string msg)
        {
            try
            {
                Boolean res = false;
                try
                {
                    using (EntitiesBanco context = new EntitiesBanco())
                    {
                        ba_Inversion item = new ba_Inversion();

                        item.Capital         = Info.Capital;
                        item.Cod_Inversion   = Info.Cod_Inversion;
                        item.Fecha           = Info.Fecha;
                        item.Fecha_Transac   = Info.Fecha_Transac;
                        item.Fecha_Vct       = Info.Fecha_Vct;
                        item.IdBanco         = Info.IdBanco;
                        item.IdEmpresa       = Info.IdEmpresa;
                        item.IdInversion     = Info.IdInversion = GetId(item.IdEmpresa);
                        item.IdUsuario       = Info.IdUsuario;
                        item.ip              = Info.ip;
                        item.Monto           = Info.Monto;
                        item.nom_pc          = Info.nom_pc;
                        item.Observacion     = Info.Observacion;
                        item.Otros           = Info.Otros;
                        item.Plazo           = Info.Plazo;
                        item.Por_Retencion   = Convert.ToDouble(Info.Por_Retencion);
                        item.Tasa            = Convert.ToDouble(Info.Tasa);
                        item.Tasa_interes    = Info.Tasa_interes;
                        item.Total_recibir   = Info.Total_recibir;
                        item.Valor_interes   = Info.Valor_interes;
                        item.Valor_retencion = Info.Valor_retencion;
                        item.Estado          = "A";
                        context.ba_Inversion.Add(item);
                        context.SaveChanges();
                    }
                    res = true;
                    return(res);
                }
                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.Message + ex.InnerException;
                    throw new Exception(ex.InnerException.ToString());
                }
            }
            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;
                throw new Exception(ex.InnerException.ToString());
            }
        }