Exemplo n.º 1
0
        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);
        }
Exemplo n.º 2
0
        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);
        }
Exemplo n.º 3
0
 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);
 }
Exemplo n.º 4
0
 public AlertStatusResult Create(AlertStatusParam param)
 {
     Data.Entity.AlertStatus entity = ParamConverter.Convert(param, null);
     entity = Dao.Save(entity);
     return(ResultConverter.Convert(entity));
 }
Exemplo n.º 5
0
 public void ValidateParameters(AlertStatusParam param)
 {
     throw new NotImplementedException();
 }