public Response Create(ShareStatusParam 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, ShareStatusParam 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 ValidateParameters(ShareStatusParam param)
 {
     throw new NotImplementedException();
 }
Beispiel #4
0
 public void Update(long id, ShareStatusParam param)
 {
     Data.Entity.ShareStatus oldEntity = Dao.Find(id);
     Data.Entity.ShareStatus newEntity = ParamConverter.Convert(param, oldEntity);
     Dao.Update(newEntity);
 }
Beispiel #5
0
 public ShareStatusResult Create(ShareStatusParam param)
 {
     Data.Entity.ShareStatus entity = ParamConverter.Convert(param, null);
     entity = Dao.Save(entity);
     return(ResultConverter.Convert(entity));
 }