Esempio n. 1
0
        public IssueResult Create(IssueParam param)
        {
            Data.Entity.Issue entity = IssueParamConverter.Convert(param, null);
            IssueDao.Save(entity);

            return(IssueResultConverter.Convert(entity));
        }
        public ApiResponse Create(IssueParam param)
        {
            IssueProcessor = new IssueProcessor();
            Response       = new ApiResponse();

            try
            {
                Response.text   = JsonConverter.JsonConverter.ObjToJson(IssueProcessor.Create(param));
                Response.result = true;

                return(Response);
            }

            catch
            {
                Response.text   = "Something went wrong :(";
                Response.result = false;

                return(Response);
            }
        }
        public ApiResponse Update(long id, IssueParam param)
        {
            IssueProcessor = new IssueProcessor();
            Response       = new ApiResponse();

            try
            {
                IssueProcessor.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.Issue Convert(IssueParam param, Data.Entity.Issue oldentity)
        {
            Data.Entity.Issue entity = null;

            if (oldentity != null)
            {
                entity = oldentity;
            }
            else
            {
                entity = new Data.Entity.Issue
                {
                    Code        = param.Code,
                    Id          = param.Id,
                    Description = param.Description,
                    Name        = param.Name
                };
            }

            return(entity);
        }
Esempio n. 5
0
 public void Update(long id, IssueParam param)
 {
     Data.Entity.Issue oldEntity = IssueDao.Find(id);
     Data.Entity.Issue newEntity = IssueParamConverter.Convert(param, null);
     IssueDao.Update(newEntity);
 }
 public void ValidateParameters(IssueParam param)
 {
     throw new NotImplementedException();
 }