Exemplo n.º 1
0
 public ct_grupocble_Info get_info(string IdGrupoCble)
 {
     try
     {
         ct_grupocble_Info info = new ct_grupocble_Info();
         using (Entities_contabilidad Context = new Entities_contabilidad())
         {
             ct_grupocble Entity = Context.ct_grupocble.FirstOrDefault(q => q.IdGrupoCble == IdGrupoCble);
             if (Entity == null)
             {
                 return(null);
             }
             info = new ct_grupocble_Info
             {
                 IdGrupoCble          = Entity.IdGrupoCble,
                 IdGrupo_Mayor        = Entity.IdGrupo_Mayor,
                 gc_estado_financiero = Entity.gc_estado_financiero,
                 gc_GrupoCble         = Entity.gc_GrupoCble,
                 gc_Orden             = Entity.gc_Orden,
                 gc_signo_operacion   = Entity.gc_signo_operacion,
                 Estado = Entity.Estado
             };
         }
         return(info);
     }
     catch (Exception)
     {
         throw;
     }
 }
Exemplo n.º 2
0
 public bool guardarDB(ct_grupocble_Info info)
 {
     try
     {
         using (Entities_contabilidad Context = new Entities_contabilidad())
         {
             ct_grupocble Entity = new ct_grupocble
             {
                 IdGrupoCble          = info.IdGrupoCble,
                 IdGrupo_Mayor        = info.IdGrupo_Mayor,
                 gc_estado_financiero = info.gc_estado_financiero,
                 gc_GrupoCble         = info.gc_GrupoCble,
                 gc_Orden             = info.gc_Orden,
                 gc_signo_operacion   = info.gc_signo_operacion,
                 Estado = info.Estado = "A"
             };
             Context.ct_grupocble.Add(Entity);
             Context.SaveChanges();
         }
         return(true);
     }
     catch (Exception)
     {
         throw;
     }
 }
Exemplo n.º 3
0
        public ActionResult Index()
        {
            #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, "Contabilidad", "GrupoContable", "Index");
            ViewBag.Nuevo     = info.Nuevo;
            ViewBag.Modificar = info.Modificar;
            ViewBag.Anular    = info.Anular;
            #endregion

            ct_grupocble_Info model = new ct_grupocble_Info
            {
                IdTransaccionSession = Convert.ToDecimal(SessionFixed.IdTransaccionSession)
            };

            var lst = bus_grupo_cble.get_list(true);
            Lista_GrupoCont.set_list(lst, model.IdTransaccionSession);
            return(View(model));
        }
Exemplo n.º 4
0
        public ActionResult Consultar(string IdGrupoCble = "", bool Exito = false)
        {
            ct_grupocble_Info model = bus_grupo_cble.get_info(IdGrupoCble);

            if (model == null)
            {
                return(RedirectToAction("Index"));
            }

            #region Permisos
            seg_Menu_x_Empresa_x_Usuario_Info info = bus_permisos.get_list_menu_accion(Convert.ToInt32(SessionFixed.IdEmpresa), SessionFixed.IdUsuario, "Contabilidad", "GrupoContable", "Index");
            if (model.Estado == "I")
            {
                info.Modificar = false;
                info.Anular    = false;
            }
            model.Nuevo     = (info.Nuevo == true ? 1 : 0);
            model.Modificar = (info.Modificar == true ? 1 : 0);
            model.Anular    = (info.Anular == true ? 1 : 0);
            #endregion

            if (Exito)
            {
                ViewBag.MensajeSuccess = MensajeSuccess;
            }

            cargar_combos();
            return(View(model));
        }
Exemplo n.º 5
0
        public ActionResult Nuevo()
        {
            ct_grupocble_Info model = new ct_grupocble_Info();

            cargar_combos();
            return(View(model));
        }
Exemplo n.º 6
0
 public ActionResult Nuevo(ct_grupocble_Info model)
 {
     if (!bus_grupo_cble.guardarDB(model))
     {
         return(View(model));
     }
     return(RedirectToAction("Consultar", new { IdGrupoCble = model.IdGrupoCble, Exito = true }));
 }
Exemplo n.º 7
0
 public ActionResult Nuevo(ct_grupocble_Info model)
 {
     if (!bus_grupo_cble.guardarDB(model))
     {
         return(View(model));
     }
     return(RedirectToAction("Index"));
 }
Exemplo n.º 8
0
 public ActionResult Anular(ct_grupocble_Info model)
 {
     if (!bus_grupo_cble.anularDB(model))
     {
         cargar_combos();
         return(View(model));
     }
     return(RedirectToAction("Index"));
 }
Exemplo n.º 9
0
 public ActionResult Modificar(ct_grupocble_Info model)
 {
     if (!bus_grupo_cble.modificarDB(model))
     {
         cargar_combos();
         return(View(model));
     }
     return(RedirectToAction("Consultar", new { IdGrupoCble = model.IdGrupoCble, Exito = true }));
 }
Exemplo n.º 10
0
 public bool anularDB(ct_grupocble_Info info)
 {
     try
     {
         return(odata.anularDB(info));
     }
     catch (Exception)
     {
         throw;
     }
 }
Exemplo n.º 11
0
        public ActionResult Anular(string IdGrupoCble = "")
        {
            ct_grupocble_Info model = bus_grupo_cble.get_info(IdGrupoCble);

            if (model == null)
            {
                return(RedirectToAction("Index"));
            }
            cargar_combos();
            return(View(model));
        }
Exemplo n.º 12
0
        public ActionResult Nuevo()
        {
            #region Permisos
            seg_Menu_x_Empresa_x_Usuario_Info info = bus_permisos.get_list_menu_accion(Convert.ToInt32(SessionFixed.IdEmpresa), SessionFixed.IdUsuario, "Contabilidad", "GrupoContable", "Index");
            if (!info.Nuevo)
            {
                return(RedirectToAction("Index"));
            }
            #endregion

            ct_grupocble_Info model = new ct_grupocble_Info();
            cargar_combos();
            return(View(model));
        }
Exemplo n.º 13
0
        public ActionResult Anular(string IdGrupoCble = "")
        {
            #region Permisos
            seg_Menu_x_Empresa_x_Usuario_Info info = bus_permisos.get_list_menu_accion(Convert.ToInt32(SessionFixed.IdEmpresa), SessionFixed.IdUsuario, "Contabilidad", "GrupoContable", "Index");
            if (!info.Anular)
            {
                return(RedirectToAction("Index"));
            }
            #endregion

            ct_grupocble_Info model = bus_grupo_cble.get_info(IdGrupoCble);
            if (model == null)
            {
                return(RedirectToAction("Index"));
            }
            cargar_combos();
            return(View(model));
        }
Exemplo n.º 14
0
        public bool anularDB(ct_grupocble_Info info)
        {
            try
            {
                using (Entities_contabilidad Context = new Entities_contabilidad())
                {
                    ct_grupocble Entity = Context.ct_grupocble.FirstOrDefault(q => q.IdGrupoCble == info.IdGrupoCble);
                    if (Entity == null)
                    {
                        return(false);
                    }
                    Entity.Estado = info.Estado = "I";

                    Context.SaveChanges();
                }
                return(true);
            }
            catch (Exception)
            {
                throw;
            }
        }
Exemplo n.º 15
0
        public bool modificarDB(ct_grupocble_Info info)
        {
            try
            {
                using (Entities_contabilidad Context = new Entities_contabilidad())
                {
                    ct_grupocble Entity = Context.ct_grupocble.FirstOrDefault(q => q.IdGrupoCble == info.IdGrupoCble);
                    if (Entity == null)
                    {
                        return(false);
                    }
                    Entity.gc_estado_financiero = info.gc_estado_financiero;
                    Entity.gc_GrupoCble         = info.gc_GrupoCble;
                    Entity.gc_Orden             = info.gc_Orden;

                    Context.SaveChanges();
                }
                return(true);
            }
            catch (Exception)
            {
                throw;
            }
        }