示例#1
0
        //public FacultyStatusProcessor(IFacultyStatusDao dao, IFacultyStatusParamConverter paramConverter,
        //    IFacultyStatusResultConverter resultConverter)
        //{
        //    this.Dao = dao;
        //    this.ParamConverter = paramConverter;
        //    this.ResultConverter = resultConverter;
        //}

        public FacultyStatusResult Create(FacultyStatusParam param)
        {
            Model.FacultyStatus entity = ParamConverter.Convert(param, null);

            entity = Dao.Save(entity);

            return(ResultConverter.Convert(entity));
        }
示例#2
0
        public void Update(long id, FacultyStatusParam param)
        {
            Model.FacultyStatus oldEntity = Dao.Find(id);

            if (oldEntity != null)
            {
                Dao.Delete(oldEntity);
                Dao.Update(ParamConverter.Convert(param, null));
            }
            else
            {
                Console.WriteLine($"No entity with Id = {id}  was found");
            }
        }
示例#3
0
        public Model.FacultyStatus Convert(FacultyStatusParam param,
                                           Model.FacultyStatus oldEntity)
        {
            Model.FacultyStatus entity = null;

            if (oldEntity != null)
            {
                entity = oldEntity;
            }
            else
            {
                entity = new Model.FacultyStatus
                {
                    Code        = param.Code,
                    Id          = param.Id,
                    Description = param.Description,
                    Name        = param.Name
                };
            }

            return(entity);
        }