public Response Create(AlertStatusParam param) { Response response = new Response(); try { response.Text = "This entity has been added :" + Environment.NewLine + JsonConverter.JsonConverter.ObjToJson(Processor.Create(param)); response.Result = true; } catch { response.Text = "Unfortunately something went wrong. Are you sure that the entity you are trying to create doesn't already exist ?"; response.Result = false; } return(response); }
public Response Update(long id, AlertStatusParam param) { Response response = new Response(); try { Processor.Update(id, param); response.Text = "The entity has been updated."; response.Result = true; } catch { response.Text = "The command was unable to execute. Are you sure the entity you want to update exists."; response.Result = false; } return(response); }
public void Update(long id, AlertStatusParam param) { Data.Entity.AlertStatus oldEntity = Dao.Find(id); Data.Entity.AlertStatus newEntity = ParamConverter.Convert(param, oldEntity); Dao.Update(newEntity); }
public AlertStatusResult Create(AlertStatusParam param) { Data.Entity.AlertStatus entity = ParamConverter.Convert(param, null); entity = Dao.Save(entity); return(ResultConverter.Convert(entity)); }
public void ValidateParameters(AlertStatusParam param) { throw new NotImplementedException(); }