コード例 #1
0
 public ResultEnum Insert(WorkingHour hour)
 {
     try
     {
         dao.Insert(hour);
         return(ResultEnum.Success);
     }
     catch (Exception ex)
     {
         Console.WriteLine(ex.Message);
         return(ResultEnum.Fail);
     }
 }
コード例 #2
0
        public void AddRange(WorkingHour[] workingHours)
        {
            RepositoryAction.Transaction((c, t) =>
            {
                var dao = new WorkingHourDao(c, t);

                dao.Delete(workingHours.Select(w => w.Ymd.Value).Distinct().ToArray());

                foreach (var row in workingHours.Where(w => w.IsEmpty == false))
                {
                    dao.Insert(WorkingHourTableRow.FromDomainObjects(row));
                }
            });
        }