コード例 #1
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);
        }