コード例 #1
0
ファイル: CalendarBuilder.cs プロジェクト: juminen/Calendar
        private void CreateIndividualMonthValues()
        {
            StringBuilder sb = new StringBuilder();

            sb.AppendLine(CellValueDetails.GetHeaders());
            foreach (Year year in years)
            {
                foreach (Month month in year.GetMonthsInOrder().ToList())
                {
                    string filename =
                        IndividualMonthSettings.FilenameTemplate.Replace("[YEAR]", year.Number.ToString())
                        .Replace("[MONTH]", month.Number.ToString("00"));
                    MonthGrid mg = new MonthGrid(
                        month,
                        new Coordinate(IndividualMonthSettings.TopLeftX, IndividualMonthSettings.TopLeftY, 0),
                        GridCalculator.CalculateMonthGridSize(IndividualMonthSettings.CellSize));
                    foreach (ICalendarCell cell in mg.Cells)
                    {
                        CellValueDetails cvd = new CellValueDetails(cell, filename);
                        sb.AppendLine(cvd.ToString());
                    }
                }
            }
            IndividualMonthValues = sb.ToString();
        }
コード例 #2
0
 public void ClearAllData()
 {
     YearsGrid.DataSource = null;
     YearsGrid.DataBind();
     YearsGrid_Values.DataSource = null;
     YearsGrid_Values.DataBind();
     MonthGrid.DataSource = null;
     MonthGrid.DataBind();
     MonthGrid_Values.DataSource = null;
     MonthGrid_Values.DataBind();
     DaysGrid.DataSource = null;
     DaysGrid.DataBind();
     DateUpdate.Update();
 }
コード例 #3
0
    private void LoadAllForVehicleFile(DataBlock dataBlock, List <int> selectedIds, List <int> yearsList)
    {
        YearsGrid.DataSource = GetYearsDataTable(yearsList);
        YearsGrid.DataBind();
        YearsGrid_Values.DataSource = GetVehicleYearsValuesDataTable(dataBlock, selectedIds, yearsList);
        YearsGrid_Values.DataBind();

        MonthGrid.DataSource = GetMonthDataTable();
        MonthGrid.DataBind();
        if (yearsList.Count > 0)
        {
            MonthGrid_Values.DataSource = GetVehicleMonthValuesDataTable(dataBlock, selectedIds, yearsList[0]);
            MonthGrid_Values.DataBind();
        }

        if (yearsList.Count > 0)
        {
            DaysGrid.DataSource = GetVehicleDayValuesDataTable(dataBlock, selectedIds, yearsList[0], 1);
            DaysGrid.DataBind();
        }
    }