예제 #1
0
 public void MakeColumnHeaders(CalendarMonthInfo calmt, TimeReportRow1 row)
 {
     string[] daystr = SomeDataDefs.GetDaysStr(calmt.WeekDays);
     for (int i = 0; i < 31; i++)
     {
         var s  = daystr[i] + "\n" + (i + 1);
         var d1 = calmt.WeekDays[i];
         if (d1 == -1)
         {
             s = "";
         }
         row.DX[i] = s;
     }
     row.RowType = 1;
     row.K1      = "Σ";
 }
예제 #2
0
        public void MakeReportA(DLJoinView jview, CalendarMonthInfo calmt)
        {
            ReportRows = new List <TimeReportRow1>();
            int nringroup = 0, idxprev = int.MinValue, idxcur;

            MakeColumnHeadersA(calmt);

            for (int i = 0; i < jview.Count; i++)
            {
                var jr = jview.List[i];
                var dr = jr.BaseRow.Row as KlonsADataSet.TIMESHEETRow;
                var jo = jr.AddedObject as AddToDLJoinViewRow;
                var tr = new TimeReportRow1();
                idxcur = jo.IDX;
                if (idxcur == idxprev)
                {
                    nringroup++;
                }
                else
                {
                    nringroup = 0;
                    idxprev   = idxcur;
                }

                if (nringroup == 0)
                {
                    tr.Caption = jo.Name;
                }
                else if (nringroup == 1)
                {
                    tr.Caption = "  " + jo.Position;
                }

                if (nringroup == 0)
                {
                    tr.BottomBorderVisible = false;
                    if (ReportRows.Count > 2)
                    {
                        ReportRows[ReportRows.Count - 1].BottomBorderVisible = true;
                    }
                }
                else
                {
                    tr.BottomBorderVisible = false;
                    tr.TopBorderVisible    = false;
                }
                if (i == jview.Count - 1)
                {
                    tr.BottomBorderVisible = true;
                }

                tr.Type = SomeDataDefs.DarbaLaiksK1[dr.KIND1].Val;

                int dk = MyData.DataSetKlons.TIMESHEET.D1Column.Ordinal;
                for (int j = 0; j < 31; j++)
                {
                    short daycode = (short)dr[dk + j];
                    float v       = dr.Vx[j];
                    tr.DX[j] = FormatCell(v, daycode, dr.XKind1);
                    var col = ColorCell(v, daycode, dr.XKind1);
                    tr.CX[j] = ColorTranslator.ToHtml(col);
                }

                tr.K1 = dr.K1.ToString();
                ReportRows.Add(tr);
            }
        }