Exemple #1
0
        /// <summary>
        /// 根据id获取数据
        /// </summary>
        /// <param name="id"></param>
        /// <returns></returns>
        public DailyHistoryModel GetDailyHistoryDetailInfo(long id)
        {
            DailyHistoryModel model = _dataAccess.Get(id);

            if (model != null && model.IsDel == FlagEnum.HadOne)
            {
                model = null;
            }

            if (model == null)
            {
                return(null);
            }
            var resourceList = _resourceServer.GetDailyStoryResourceModels(new List <long> {
                id
            });

            model.MediaList = resourceList;
            return(model);
        }
Exemple #2
0
        /// <summary>
        /// 保存数据
        /// </summary>
        /// <param name="id">主键</param>
        /// <param name="number">工作量</param>
        /// <param name="dailyDateTime">工作时间</param>
        /// <param name="dailyContent">工作内容</param>
        /// <param name="userId">用户id</param>
        /// <returns></returns>
        public long SaveModel(long id, decimal number, DateTime dailyDateTime, string dailyContent, long userId)
        {
            var model = new DailyHistoryModel();

            if (id > 0)
            {
                model = _dataAccess.Get(id);
            }
            else
            {
                model.Createtime = DateTime.Now;
            }

            model.DailyDate    = dailyDateTime;
            model.DailyContent = dailyContent.Length > 500 ? dailyContent.Substring(0, 500) : dailyContent;
            model.DailyMonth   = dailyDateTime.Month;
            model.DailyNumber  = number;
            model.DailyYear    = dailyDateTime.Year;
            model.IsDel        = FlagEnum.HadZore;
            model.UpdateTime   = DateTime.Now;
            model.UserId       = userId;
            model.DailyDay     = dailyDateTime.Day;
            return(_dataAccess.SaveModel(model));
        }
Exemple #3
0
 /// <summary>
 /// 保存数据
 /// </summary>
 /// <param name="model"></param>
 /// <returns></returns>
 public long SaveModel(DailyHistoryModel model)
 {
     return(_dataAccess.SaveModel(model));
 }