Пример #1
0
        /// <summary>
        ///
        /// </summary>
        /// <param name="model"></param>
        /// <returns></returns>
        public static DisciplineModel Create(DisciplineModel model)
        {
            // init entity
            var entity = new hr_Discipline();

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

            // create
            return(new DisciplineModel(hr_DisciplineServices.Create(entity)));
        }
Пример #2
0
        /// <summary>
        ///
        /// </summary>
        /// <param name="model"></param>
        /// <returns></returns>
        public static DisciplineModel Update(DisciplineModel model)
        {
            // int entity
            var entity = hr_DisciplineServices.GetById(model.Id);

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

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

            // update
            return(new DisciplineModel(hr_DisciplineServices.Update(entity)));
        }