Esempio n. 1
0
 public bool ModificarDB(ba_Catalogo_Info info)
 {
     try
     {
         EntitiesBanco context   = new EntitiesBanco();
         var           contenido = context.ba_Catalogo.FirstOrDefault(var => var.IdCatalogo == info.IdCatalogo);
         if (contenido != null)
         {
             contenido.ca_descripcion = info.ca_descripcion;
             contenido.ca_orden       = info.ca_orden;
             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());
     }
 }
 public Boolean AnularDB(ba_Catalogo_Info Info)
 {
     try
     {
         using (EntitiesBanco context = new EntitiesBanco())
         {
             var contact = context.ba_Catalogo.FirstOrDefault(var => var.IdCatalogo == Info.IdCatalogo && var.IdTipoCatalogo == Info.IdTipoCatalogo);
             if (contact != null)
             {
                 contact.ca_estado = "I";
                 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());
     }
 }
 public ba_Catalogo_Info get_info(string IdTipoCatalogo, string IdCatalogo)
 {
     try
     {
         ba_Catalogo_Info info = new ba_Catalogo_Info();
         using (Entities_banco Context = new Entities_banco())
         {
             ba_Catalogo Entity = Context.ba_Catalogo.FirstOrDefault(q => q.IdTipoCatalogo == IdTipoCatalogo && q.IdCatalogo == IdCatalogo);
             if (Entity == null)
             {
                 return(null);
             }
             info = new ba_Catalogo_Info
             {
                 IdTipoCatalogo = Entity.IdTipoCatalogo,
                 IdCatalogo     = Entity.IdCatalogo,
                 ca_descripcion = Entity.ca_descripcion,
                 ca_estado      = Entity.ca_estado
             };
         }
         return(info);
     }
     catch (Exception)
     {
         throw;
     }
 }
 public Boolean GuardarDB(ref ba_Catalogo_Info Info)
 {
     try
     {
         using (EntitiesBanco Context = new EntitiesBanco())
         {
             var Address = new ba_Catalogo();
             Address.IdCatalogo     = Info.IdCatalogo;
             Address.IdTipoCatalogo = Info.IdTipoCatalogo;
             Address.ca_descripcion = Info.ca_descripcion;
             Address.ca_estado      = "A";
             Context.ba_Catalogo.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.InnerException + " " + ex.Message;
         return(false);
     }
 }
        public ba_Catalogo_Info Get_Info_Catalogo(string id)
        {
            EntitiesBanco    context      = new EntitiesBanco();
            ba_Catalogo_Info ba_cata_Info = new ba_Catalogo_Info();

            try
            {
                var contenido = context.ba_Catalogo.FirstOrDefault(var => var.IdCatalogo == id);
                if (contenido != null)
                {
                    ba_cata_Info.IdCatalogo     = contenido.IdCatalogo;
                    ba_cata_Info.IdTipoCatalogo = contenido.IdTipoCatalogo;
                    ba_cata_Info.ca_descripcion = contenido.ca_descripcion;
                    ba_cata_Info.ca_estado      = contenido.ca_estado;
                }
                return(ba_cata_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);
                oDataLog.Guardar_Log_Error(Log_Error_sis, ref mensaje);
                mensaje = ex.InnerException + " " + ex.Message;
                throw new Exception(ex.InnerException.ToString());
            }
        }
        public List <ba_Catalogo_Info> Get_List_Catalogo(string cod)
        {
            List <ba_Catalogo_Info> lista   = new List <ba_Catalogo_Info>();
            EntitiesBanco           context = new EntitiesBanco();

            try
            {
                var Existe = from q in context.ba_Catalogo
                             where q.IdTipoCatalogo == cod
                             select q;

                foreach (var item in Existe)
                {
                    ba_Catalogo_Info info = new ba_Catalogo_Info();

                    info.IdCatalogo     = item.IdCatalogo;
                    info.IdTipoCatalogo = item.IdTipoCatalogo;
                    info.ca_descripcion = item.ca_descripcion;
                    info.ca_estado      = item.ca_estado;
                    lista.Add(info);
                }
                return(lista);
            }
            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;
                return(new List <ba_Catalogo_Info>());
            }
        }
Esempio n. 7
0
        public ActionResult Index(string IdTipoCatalogo = "")
        {
            #region Validar Session
            if (string.IsNullOrEmpty(SessionFixed.IdTransaccionSession))
            {
                return(RedirectToAction("Login", new { Area = "", Controller = "Account" }));
            }
            SessionFixed.IdTransaccionSession       = (Convert.ToDecimal(SessionFixed.IdTransaccionSession) + 1).ToString();
            SessionFixed.IdTransaccionSessionActual = SessionFixed.IdTransaccionSession;
            #endregion
            #region Permisos
            seg_Menu_x_Empresa_x_Usuario_Info info = bus_permisos.get_list_menu_accion(Convert.ToInt32(SessionFixed.IdEmpresa), SessionFixed.IdUsuario, "Banco", "CatalogoTipoBanco", "Index");
            ViewBag.Nuevo = info.Nuevo;
            #endregion

            ba_Catalogo_Info model = new ba_Catalogo_Info
            {
                IdTransaccionSession = Convert.ToDecimal(SessionFixed.IdTransaccionSession),
                IdTipoCatalogo       = IdTipoCatalogo
            };

            var lst = bus_catalogo.get_list(model.IdTipoCatalogo, true);
            Lista_Catalogo.set_list(lst, model.IdTransaccionSession);

            ViewBag.IdTipoCatalogo = IdTipoCatalogo;
            return(View());
        }
        public List <ba_Catalogo_Info> Get_List_Catalogo()
        {
            List <ba_Catalogo_Info> lista = new List <ba_Catalogo_Info>();
            EntitiesBanco           oEnt  = new EntitiesBanco();

            try
            {
                var select = from q in oEnt.ba_Catalogo
                             select q;

                foreach (var item in select)
                {
                    ba_Catalogo_Info info = new ba_Catalogo_Info();
                    info.IdCatalogo     = item.IdCatalogo;
                    info.ca_descripcion = item.ca_descripcion;

                    lista.Add(info);
                }
                return(lista);
            }
            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());
            }
        }
        public bool modificarDB(ba_Catalogo_Info info)
        {
            try
            {
                using (Entities_banco Context = new Entities_banco())
                {
                    ba_Catalogo Entity = Context.ba_Catalogo.FirstOrDefault(q => q.IdTipoCatalogo == info.IdTipoCatalogo && q.IdCatalogo == info.IdCatalogo);
                    if (Entity == null)
                    {
                        return(false);
                    }
                    Entity.IdTipoCatalogo = info.IdTipoCatalogo;
                    Entity.ca_descripcion = info.ca_descripcion;

                    Entity.IdUsuarioUltMod = info.IdUsuarioUltMod;
                    Entity.Fecha_UltMod    = DateTime.Now;
                    Context.SaveChanges();
                }
                return(true);
            }
            catch (Exception)
            {
                throw;
            }
        }
Esempio n. 10
0
 public Boolean AnularDB(ref ba_Catalogo_Info Info)
 {
     try { return(oData.AnularDB(Info)); }
     catch (Exception ex)
     {
         oLog.Log_Error(ex.ToString());
         mensaje = "Error al Anular .." + ex.Message;
         return(false);
     }
 }
        public ActionResult Nuevo(string IdTipoCatalogo = "")
        {
            ba_Catalogo_Info model = new ba_Catalogo_Info
            {
                IdTipoCatalogo = IdTipoCatalogo
            };

            cargar_combos();
            return(View(model));
        }
 public ActionResult Modificar(ba_Catalogo_Info model)
 {
     if (!bus_catalogo.modificarDB(model))
     {
         ViewBag.IdTipoCatalogo = model.IdTipoCatalogo;
         cargar_combos();
         return(View(model));
     }
     return(RedirectToAction("Index", new { IdTipoCatalogo = model.IdTipoCatalogo }));
 }
 public bool anularDB(ba_Catalogo_Info info)
 {
     try
     {
         return(odata.anularDB(info));
     }
     catch (Exception)
     {
         throw;
     }
 }
 public ActionResult Anular(ba_Catalogo_Info model)
 {
     model.IdUsuarioUltAnu = SessionFixed.IdUsuario;
     if (!bus_catalogo.anularDB(model))
     {
         ViewBag.IdTipoCatalogo = model.IdTipoCatalogo;
         cargar_combos();
         return(View(model));
     }
     return(RedirectToAction("Index", new { IdTipoCatalogo = model.IdTipoCatalogo }));
 }
        public ActionResult Modificar(string IdTipoCatalogo = "", string IdCatalogo = "")
        {
            ba_Catalogo_Info model = bus_catalogo.get_info(IdTipoCatalogo, IdCatalogo);

            if (model == null)
            {
                return(RedirectToAction("Index", new { IdCatalogo_tipo = IdTipoCatalogo }));
            }
            ViewBag.IdTipoCatalogo = IdTipoCatalogo;
            cargar_combos();
            return(View(model));
        }
Esempio n. 16
0
        public ActionResult Nuevo(string IdTipoCatalogo = "")
        {
            #region Permisos
            seg_Menu_x_Empresa_x_Usuario_Info info = bus_permisos.get_list_menu_accion(Convert.ToInt32(SessionFixed.IdEmpresa), SessionFixed.IdUsuario, "Banco", "CatalogoTipoBanco", "Index");
            if (!info.Nuevo)
            {
                return(RedirectToAction("Index"));
            }
            #endregion

            ba_Catalogo_Info model = new ba_Catalogo_Info
            {
                IdTipoCatalogo = IdTipoCatalogo
            };
            cargar_combos();
            return(View(model));
        }
Esempio n. 17
0
        public ActionResult Anular(string IdTipoCatalogo = "", string IdCatalogo = "")
        {
            #region Permisos
            seg_Menu_x_Empresa_x_Usuario_Info info = bus_permisos.get_list_menu_accion(Convert.ToInt32(SessionFixed.IdEmpresa), SessionFixed.IdUsuario, "Banco", "CatalogoTipoBanco", "Index");
            if (!info.Anular)
            {
                return(RedirectToAction("Index"));
            }
            #endregion

            ba_Catalogo_Info model = bus_catalogo.get_info(IdTipoCatalogo, IdCatalogo);
            if (model == null)
            {
                return(RedirectToAction("Index", new { IdCatalogo_tipo = IdTipoCatalogo }));
            }
            ViewBag.IdTipoCatalogo = IdTipoCatalogo;
            cargar_combos();
            return(View(model));
        }
        public ActionResult Nuevo(ba_Catalogo_Info model)
        {
            model.IdUsuario = Session["IdUsuario"].ToString();
            if (bus_catalogo.validar_existe_IdCatalogo(model.IdCatalogo))
            {
                ViewBag.mensaje        = "El código ya se encuentra registrado";
                ViewBag.IdTipoCatalogo = model.IdTipoCatalogo;
                cargar_combos();
                return(View(model));
            }

            if (!bus_catalogo.guardarDB(model))
            {
                ViewBag.IdTipoCatalogo = model.IdTipoCatalogo;
                cargar_combos();
                return(View(model));
            }

            return(RedirectToAction("Index", new { IdTipoCatalogo = model.IdTipoCatalogo }));
        }
 public bool guardarDB(ba_Catalogo_Info info)
 {
     try
     {
         using (Entities_banco Context = new Entities_banco())
         {
             ba_Catalogo Entity = new ba_Catalogo
             {
                 IdTipoCatalogo = info.IdTipoCatalogo,
                 IdCatalogo     = info.IdCatalogo,
                 ca_descripcion = info.ca_descripcion,
                 ca_estado      = info.ca_estado = "A"
             };
             Context.ba_Catalogo.Add(Entity);
             Context.SaveChanges();
         }
         return(true);
     }
     catch (Exception)
     {
         throw;
     }
 }