public ContractTypeResult Create(ContractTypeParam param) { Data.Entity.ContractType entity = ContractTypeParamConverter.Convert(param, null); ContractTypeDao.Save(entity); return(ContractTypeResultConverter.Convert(entity)); }
public Data.Entity.ContractType Convert(ContractTypeParam param, Data.Entity.ContractType oldentity) { Data.Entity.ContractType entity = null; if (oldentity != null) { entity = oldentity; } else { entity = new Data.Entity.ContractType { Code = param.Code, Id = param.Id, Description = param.Description, Name = param.Name }; } return(entity); }
public ApiResponse Create(ContractTypeParam param) { ContractTypeProcessor = new ContractTypeProcessor(); Response = new ApiResponse(); try { Response.text = JsonConverter.JsonConverter.ObjToJson(ContractTypeProcessor.Create(param)); Response.result = true; return(Response); } catch { Response.text = "Something went wrong :("; Response.result = false; return(Response); } }
public ApiResponse Update(long id, ContractTypeParam param) { ContractTypeProcessor = new ContractTypeProcessor(); Response = new ApiResponse(); try { ContractTypeProcessor.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 void Update(long id, ContractTypeParam param) { Data.Entity.ContractType oldEntity = ContractTypeDao.Find(id); Data.Entity.ContractType newEntity = ContractTypeParamConverter.Convert(param, null); ContractTypeDao.Update(newEntity); }
public void ValidateParameters(ContractTypeParam param) { throw new NotImplementedException(); }