Esempio n. 1
0
        public void MakeReport(int idsar, string title)
        {
            var table_sar = MyData.DataSetKlons.TIMESHEET_LISTS;
            var dr_sar    = table_sar.FindByID(idsar);

            if (dr_sar == null)
            {
                return;
            }
            var   drs_r    = dr_sar.GetTIMESHEET_LISTS_RRows();
            var   dt1      = new DateTime(dr_sar.YR, dr_sar.MT, 1);
            var   dt2      = dt1.LastDayOfMonth();
            var   sickc    = new SickDayCalcRow();
            int   vacdays  = 0;
            float vachours = 0.0f;

            ReportRows  = new List <TimeReportRow2>();
            ReportRowsA = new List <TimeReportRow2a>();

            foreach (var dr_r in drs_r)
            {
                var trr  = new TimeReportRow2();
                var trr2 = new TimeReportRow2a(trr);

                var pdat     = DataTasks.GetPersonNameAndPK(dr_r.IDP);
                var postitle = DataTasks.GetPositionTitle(dr_r.IDAM);
                trr.Caption = string.Format("{0} {1}, {2}",
                                            pdat[0], pdat[1], postitle);

                var rowset = dr_r.GetDLRowSet();
                rowset.CountPlan(trr, dt1, dt2);
                rowset.CountFact(trr, dt1, dt2);

                rowset.CountSickDays2(dt1, dt2, out int sickdaysA, out int sickdaysB, out int sickdaysN);
                trr._SICKDAYS  = sickdaysA;
                trr2.SickdaysA = sickdaysA;
                trr2.SickdaysB = sickdaysB;
                trr2.SickdaysN = sickdaysN;

                rowset.CountVacationTime(dt1, dt2, out vacdays, out vachours);
                trr._VACATION_DAYS_CURRENT  = vacdays;
                trr._VACATION_HOURS_CURRENT = vachours;

                ReportRows.Add(trr);
                ReportRowsA.Add(trr2);
            }

            ShowReport(dt1.Year, dt1.Month, dr_sar.DESCR);
        }
Esempio n. 2
0
 public TimeReportRow2a(TimeReportRow2 r)
 {
     Row = r;
 }