Exemplo n.º 1
0
        public JsonResult Guardar(CargoViewModel oCargoViewModel)
        {
            List <String> resultado = new List <String>();

            resultado.Add("true");
            resultado.Add(Constantes.GuardadoExitoso);

            CargoServicesController oServices = new CargoServicesController();

            try
            {
                EntityCargo oEntityCargoExists = oServices.SelectByKey(oCargoViewModel.EntityCargo.Key);

                if (Constantes.Cero != oEntityCargoExists.Key.IDCargo)
                {
                    oServices.Update(oCargoViewModel.EntityCargo);
                }
                else
                {
                    oServices.Insert(oCargoViewModel.EntityCargo);
                }
            }
            catch (Exception)
            {
                resultado[0] = "false";
                resultado[1] = Constantes.GuardadoNoExitoso;
            }


            return(Json(resultado, JsonRequestBehavior.AllowGet));
        }
Exemplo n.º 2
0
 public EntityCargo Update(EntityCargo oEntityCargo)
 {
     try
     {
         return(CargoService.Update(oEntityCargo));
     }
     catch (Exception ex)
     {
         throw ex;
     }
 }
Exemplo n.º 3
0
 public EntityCargo Insert(EntityCargo oEntityCargo)
 {
     try
     {
         return(CargoService.Insert(oEntityCargo));
     }
     catch (Exception ex)
     {
         throw ex;
     }
 }
Exemplo n.º 4
0
 public IList <EntityCargo> Select(EntityCargo oEntityCargo)
 {
     try
     {
         return(CargoService.Select(oEntityCargo));
     }
     catch (Exception ex)
     {
         throw ex;
     }
 }
Exemplo n.º 5
0
 public EntityCargo Update(EntityCargo oEntityCargo)
 {
     try
     {
         return(CargoApp.Update(oEntityCargo));
     }
     catch (Exception)
     {
         throw new FaultException("Error al actualizar Cargos");
     }
 }
Exemplo n.º 6
0
 public EntityCargo Insert(EntityCargo oEntityCargo)
 {
     try
     {
         return(CargoApp.Insert(oEntityCargo));
     }
     catch (Exception)
     {
         throw new FaultException("Error al insertar Cargos");
     }
 }
Exemplo n.º 7
0
 public IList <EntityCargo> Select(EntityCargo oEntityCargo)
 {
     try
     {
         return(CargoApp.Select(oEntityCargo));
     }
     catch (Exception)
     {
         throw new FaultException("Error al seleccionar Cargos");
     }
 }
Exemplo n.º 8
0
 public EntityCargo Delete(EntityCargo oEntityCargo)
 {
     try
     {
         return(CargoApp.Delete(oEntityCargo));
     }
     catch (Exception)
     {
         throw new FaultException("Error al eliminar Cargos");
     }
 }
Exemplo n.º 9
0
 public EntityCargo Delete(EntityCargo oEntityCargo, CTransaction oCTransaction)
 {
     try
     {
         DataCargoRepository data = new DataCargoRepository(oEntityCargo, "cargo");
         return(data.Delete(oCTransaction));
     }
     catch (Exception ex)
     {
         throw ex;
     }
 }
Exemplo n.º 10
0
 public IList <EntityCargo> Select(EntityCargo oEntityCargo, CTransaction oCTransaction)
 {
     try
     {
         DataCargoRepository data = new DataCargoRepository(oEntityCargo, "cargo");
         return(data.Select(oCTransaction));
     }
     catch (Exception ex)
     {
         throw ex;
     }
 }
Exemplo n.º 11
0
 public EntityCargo Insert(EntityCargo oEntityCargo)
 {
     try
     {
         CTransaction oCTransaction = CTransaction.Empty;
         return(Repo.Insert(oEntityCargo, oCTransaction));
     }
     catch (Exception ex)
     {
         throw ex;
     }
 }
Exemplo n.º 12
0
 public IList <EntityCargo> Select(EntityCargo oEntityCargo)
 {
     try
     {
         CTransaction oCTransaction = CTransaction.Empty;
         return(Repo.Select(oEntityCargo, oCTransaction));
     }
     catch (Exception ex)
     {
         throw ex;
     }
 }
Exemplo n.º 13
0
        public ActionResult Edit(KeyCargo oKey)
        {
            CargoServicesController   oServices        = new CargoServicesController();
            UsuarioServicesController oUsuarioServices = new UsuarioServicesController();

            CargoViewModel oCargoViewModel = new CargoViewModel();

            EntityCargo oEntityCargo = oServices.SelectByKey(oKey);

            oCargoViewModel.EntityCargo = oEntityCargo;

            return(PartialView(Constantes.CargoEdit, oCargoViewModel));
        }