public override bool IsValid(object value) { int actionProposedID; ActionProposed actionProposed; if (value == null) { this.ErrorMessage = "ActionProposedID es requerido"; return(false); } if (!int.TryParse(value.ToString(), out actionProposedID)) { this.ErrorMessage = "ActionProposedID contiene formato inválido"; return(false); } if (actionProposedID == 0 || ActionProposedModel.IsNull(new ActionProposedBLL().GetActionProposedByActionProposedID((int)value), out actionProposed)) { this.ErrorMessage = "ActionProposedID no existente"; return(false); } HttpContext.Current.Items["actionProposed"] = actionProposed; return(true); }
public List <object> GetAll() { return(new ActionProposedBLL().GetAllActionProposeds().Select(instance => ActionProposedModel.GetActionProposedObject(instance)).ToList()); }
public object Get(ActionProposedIDModel actionProposedIDModel) { var actionProposed = (ActionProposed)HttpContext.Current.Items["actionProposed"]; return(ActionProposedModel.GetActionProposedObject(actionProposed)); }