public MakeResult Create(MakeParam param) { Data.Entity.Make entity = MakeParamConverter.Convert(param, null); MakeDao.Save(entity); return(MakeResultConverter.Convert(entity)); }
public ApiResponse Create(MakeParam param) { MakeProcessor = new MakeProcessor(); Response = new ApiResponse(); try { Response.text = JsonConverter.JsonConverter.ObjToJson(MakeProcessor.Create(param)); Response.result = true; return(Response); } catch { Response.text = "Something went wrong :("; Response.result = false; return(Response); } }
public ApiResponse Update(long id, MakeParam param) { MakeProcessor = new MakeProcessor(); Response = new ApiResponse(); try { MakeProcessor.Update(id, param); Response.text = "Entity was successfully updated"; Response.result = true; return(Response); } catch { Response.text = "Unfortunately something went wrong :("; Response.result = false; return(Response); } }
public Data.Entity.Make Convert(MakeParam param, Data.Entity.Make oldentity) { Data.Entity.Make entity = null; if (oldentity != null) { entity = oldentity; } else { entity = new Data.Entity.Make { Code = param.Code, Id = param.Id, Description = param.Description, Name = param.Name }; } return(entity); }
public void ValidateParameters(MakeParam param) { throw new NotImplementedException(); }
public void Update(long id, MakeParam param) { Data.Entity.Make oldEntity = MakeDao.Find(id); Data.Entity.Make newEntity = MakeParamConverter.Convert(param, null); MakeDao.Update(newEntity); }