Exemple #1
0
 public ActionResult Modificar(ro_cargo_Info info)
 {
     try
     {
         info.IdUsuarioUltMod = SessionFixed.IdUsuario;
         if (ModelState.IsValid)
         {
             if (!bus_cargo.modificarDB(info))
             {
                 return(View(info));
             }
             else
             {
                 return(RedirectToAction("Index"));
             }
         }
         else
         {
             return(View(info));
         }
     }
     catch (Exception)
     {
         throw;
     }
 }
Exemple #2
0
 public ActionResult Nuevo(ro_cargo_Info info)
 {
     try
     {
         info.IdUsuario = SessionFixed.IdUsuario;
         if (ModelState.IsValid)
         {
             info.IdEmpresa = GetIdEmpresa();
             if (!bus_cargo.guardarDB(info))
             {
                 return(View(info));
             }
             else
             {
                 return(RedirectToAction("Index"));
             }
         }
         else
         {
             return(View(info));
         }
     }
     catch (Exception)
     {
         throw;
     }
 }
Exemple #3
0
        public ro_cargo_Info get_info(int IdEmpresa, int IdCargo)
        {
            try
            {
                ro_cargo_Info info = new ro_cargo_Info();

                using (Entities_rrhh Context = new Entities_rrhh())
                {
                    ro_cargo Entity = Context.ro_cargo.FirstOrDefault(q => q.IdEmpresa == IdEmpresa && q.IdCargo == IdCargo);
                    if (Entity == null) return null;

                    info = new ro_cargo_Info
                    {
                        IdEmpresa = Entity.IdEmpresa,
                        IdCargo = Entity.IdCargo,
                        ca_descripcion = Entity.ca_descripcion,
                        Estado = Entity.Estado,
                    };
                }

                return info;
            }
            catch (Exception)
            {

                throw;
            }
        }
Exemple #4
0
        public bool guardarDB(ro_cargo_Info info)
        {
            try
            {
                using (Entities_rrhh Context = new Entities_rrhh())
                {
                    ro_cargo Entity = new ro_cargo
                    {
                        IdEmpresa = info.IdEmpresa,
                        IdCargo = info.IdCargo = get_id(info.IdEmpresa),
                        ca_descripcion = info.ca_descripcion,
                        Estado = info.Estado = "A",
                        IdUsuario = info.IdUsuario,
                        Fecha_Transac = info.Fecha_Transac = DateTime.Now
                    };
                    Context.ro_cargo.Add(Entity);
                    Context.SaveChanges();
                }
                return true;
            }
            catch (Exception)
            {

                throw;
            }
        }
Exemple #5
0
        public bool anularDB(ro_cargo_Info info)
        {
            try
            {
                using (Entities_rrhh Context = new Entities_rrhh())
                {
                    ro_cargo Entity = Context.ro_cargo.FirstOrDefault(q => q.IdEmpresa == info.IdEmpresa && q.IdCargo == info.IdCargo);
                    if (Entity == null)
                    {
                        return(false);
                    }
                    Entity.Estado = info.Estado = "I";

                    Entity.IdUsuarioUltAnu = info.IdUsuarioUltAnu;
                    Entity.Fecha_UltAnu    = info.Fecha_UltAnu = DateTime.Now;
                    Context.SaveChanges();
                }

                return(true);
            }
            catch (Exception)
            {
                throw;
            }
        }
Exemple #6
0
 public bool anularDB(ro_cargo_Info info)
 {
     try
     {
         return(odata.anularDB(info));
     }
     catch (Exception)
     {
         throw;
     }
 }
Exemple #7
0
 public ActionResult Nuevo()
 {
     try
     {
         ro_cargo_Info info = new ro_cargo_Info();
         return(View(info));
     }
     catch (Exception)
     {
         throw;
     }
 }
 public ActionResult Nuevo()
 {
     try
     {
         ro_cargo_Info info = new ro_cargo_Info();
         info.IdEmpresa = Convert.ToInt32(SessionFixed.IdEmpresa);
         return(View(info));
     }
     catch (Exception)
     {
         throw;
     }
 }
Exemple #9
0
 public ActionResult Anular(ro_cargo_Info info)
 {
     try
     {
         if (!bus_cargo.anularDB(info))
         {
             return(View(info));
         }
         else
         {
             return(RedirectToAction("Index"));
         }
     }
     catch (Exception)
     {
         throw;
     }
 }
Exemple #10
0
 public ActionResult Anular(ro_cargo_Info info)
 {
     try
     {
         info.IdUsuarioUltMod = SessionFixed.IdUsuario;
         if (!bus_cargo.anularDB(info))
         {
             return(View(info));
         }
         else
         {
             return(RedirectToAction("Index"));
         }
     }
     catch (Exception)
     {
         throw;
     }
 }
Exemple #11
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

            ro_cargo_Info model = new ro_cargo_Info
            {
                IdEmpresa            = Convert.ToInt32(SessionFixed.IdEmpresa),
                IdTransaccionSession = Convert.ToDecimal(SessionFixed.IdTransaccionSession)
            };

            List <ro_cargo_Info> lista = bus_cargo.get_list(model.IdEmpresa, true);
            Lista_Cargo.set_list(lista, Convert.ToDecimal(SessionFixed.IdTransaccionSession));

            return(View(model));
        }
Exemple #12
0
        public bool modificarDB(ro_cargo_Info info)
        {
            try
            {
                using (Entities_rrhh Context = new Entities_rrhh())
                {
                    ro_cargo Entity = Context.ro_cargo.FirstOrDefault(q => q.IdEmpresa == info.IdEmpresa && q.IdCargo == info.IdCargo);
                    if (Entity == null)
                        return false;
                    Entity.ca_descripcion = info.ca_descripcion;
                    Entity.IdUsuarioUltMod = info.IdUsuarioUltMod;
                    Entity.Fecha_UltMod = info.Fecha_UltMod = DateTime.Now;
                    Context.SaveChanges();
                }

                return true;
            }
            catch (Exception)
            {

                throw;
            }
        }