コード例 #1
0
        /// <summary>
        ///
        /// </summary>
        /// <param name="model"></param>
        /// <returns></returns>
        public static TimeSheetReportModel Create(TimeSheetReportModel model)
        {
            var entity = new hr_TimeSheetReport();

            model.FillEntity(ref entity);

            return(new TimeSheetReportModel(hr_TimeSheetReportServices.Create(entity)));
        }
コード例 #2
0
        /// <summary>
        ///
        /// </summary>
        /// <param name="model"></param>
        /// <returns></returns>
        public static TimeSheetReportModel Update(TimeSheetReportModel model)
        {
            var entity = hr_TimeSheetReportServices.GetById(model.Id);

            if (entity == null)
            {
                return(null);
            }
            //Edit data
            model.FillEntity(ref entity);
            entity.EditedDate = DateTime.Now;
            return(new TimeSheetReportModel(hr_TimeSheetReportServices.Update(entity)));
        }