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