Ejemplo n.º 1
0
        /// <summary>
        ///
        /// </summary>
        /// <param name="model"></param>
        /// <returns></returns>
        public static TrainingHistoryModel Create(TrainingHistoryModel model)
        {
            // init entity
            var entity = new hr_TrainingHistory();

            // fill entity
            model.FillEntity(ref entity);

            // create
            return(new TrainingHistoryModel(hr_TrainingHistoryServices.Create(entity)));
        }
Ejemplo n.º 2
0
        /// <summary>
        ///
        /// </summary>
        /// <param name="model"></param>
        /// <returns></returns>
        public static TrainingHistoryModel Update(TrainingHistoryModel model)
        {
            // int entity
            var entity = hr_TrainingHistoryServices.GetById(model.Id);

            if (entity == null)
            {
                return(null);
            }

            // fill entity
            model.FillEntity(ref entity);

            // update
            return(new TrainingHistoryModel(hr_TrainingHistoryServices.Update(entity)));
        }