コード例 #1
0
 public static ResultView InsertRows(List <TimesheetUploadItem> timesheetUploadList, int reportId)
 {
     foreach (var item in timesheetUploadList)
     {
         item.AmountPaid     = (decimal)item.Hours * GetHourlySalary(item.JobGroup);
         item.PayPeriodStart = GetPayPeriodStart(item.TimeEntry);
         item.ReportId       = reportId;
     }
     return(TimesheetDA.InsertTimesheetBatch(timesheetUploadList));
 }
コード例 #2
0
        public static List <TimesheetReportItemView> GetTimesheetReportItems()
        {
            var timesheetReportItems = new List <TimesheetReportItemView>();
            var sqlReportList        = TimesheetDA.GetReport();

            if (sqlReportList.Success)
            {
                foreach (TimesheetReportItemSql row in ((List <TimesheetReportItemSql>)sqlReportList.Value))
                {
                    timesheetReportItems.Add(new TimesheetReportItemView()
                    {
                        EmployeeId = row.EmployeeId,
                        PayPeriod  = GetPeriodString(row.PayPeriodStart),
                        AmountPaid = GetCurrency(row.AmountPaid)
                    });
                }
            }

            //TODO: we are loosing the db error return here, consider logging
            return(timesheetReportItems);
        }