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)); }
public EntityCargo Update(EntityCargo oEntityCargo) { try { return(CargoService.Update(oEntityCargo)); } catch (Exception ex) { throw ex; } }
public EntityCargo Insert(EntityCargo oEntityCargo) { try { return(CargoService.Insert(oEntityCargo)); } catch (Exception ex) { throw ex; } }
public IList <EntityCargo> Select(EntityCargo oEntityCargo) { try { return(CargoService.Select(oEntityCargo)); } catch (Exception ex) { throw ex; } }
public EntityCargo Update(EntityCargo oEntityCargo) { try { return(CargoApp.Update(oEntityCargo)); } catch (Exception) { throw new FaultException("Error al actualizar Cargos"); } }
public EntityCargo Insert(EntityCargo oEntityCargo) { try { return(CargoApp.Insert(oEntityCargo)); } catch (Exception) { throw new FaultException("Error al insertar Cargos"); } }
public IList <EntityCargo> Select(EntityCargo oEntityCargo) { try { return(CargoApp.Select(oEntityCargo)); } catch (Exception) { throw new FaultException("Error al seleccionar Cargos"); } }
public EntityCargo Delete(EntityCargo oEntityCargo) { try { return(CargoApp.Delete(oEntityCargo)); } catch (Exception) { throw new FaultException("Error al eliminar Cargos"); } }
public EntityCargo Delete(EntityCargo oEntityCargo, CTransaction oCTransaction) { try { DataCargoRepository data = new DataCargoRepository(oEntityCargo, "cargo"); return(data.Delete(oCTransaction)); } catch (Exception ex) { throw ex; } }
public IList <EntityCargo> Select(EntityCargo oEntityCargo, CTransaction oCTransaction) { try { DataCargoRepository data = new DataCargoRepository(oEntityCargo, "cargo"); return(data.Select(oCTransaction)); } catch (Exception ex) { throw ex; } }
public EntityCargo Insert(EntityCargo oEntityCargo) { try { CTransaction oCTransaction = CTransaction.Empty; return(Repo.Insert(oEntityCargo, oCTransaction)); } catch (Exception ex) { throw ex; } }
public IList <EntityCargo> Select(EntityCargo oEntityCargo) { try { CTransaction oCTransaction = CTransaction.Empty; return(Repo.Select(oEntityCargo, oCTransaction)); } catch (Exception ex) { throw ex; } }
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)); }