Beispiel #1
0
        protected virtual void OnChangeYear(int year)
        {
            if (_year != year)
            {
                // ask to save data
                SaveData();
                _year = year;

                AllowEdit = Year >= _TodayYear;
                _yearwrapper = new YearWrapper(Year);
                deMonday.Properties.MinValue = _yearwrapper.BeginYearDate;
                deMonday.Properties.MaxValue = _yearwrapper.EndYearDate;

                if (_TodayYear < Year)
                {
                    CurrentMondayDate = _yearwrapper.BeginYearDate; 
                }
                else if (_TodayYear > Year)
                {
                    CurrentMondayDate = DateTimeHelper.GetMonday(_yearwrapper.EndYearDate); 
                }
                else
                    CurrentMondayDate = DateTimeHelper.GetMonday(DateTime.Today); 

                LoadHolidaysInfo();
                ChangeView();
                // load new data
            }
        }
Beispiel #2
0
        public UCAbsencePlanning()
        {
            InitializeComponent();
            CurrentMondayDate = DateTimeHelper.GetMonday(DateTime.Today);
            _TodayYear = DateTimeHelper.GetYearByDate(DateTime.Today);
            _emptyworld.WorldName = String.Empty;// "All worlds";
            _emptyworld.ID = Int64.MinValue;

            _staticColumns = new List<BandedGridColumn>();
            _staticColumns.Add(gc_Employee);
            _staticColumns.Add(gc_HWGR);
            _staticColumns.Add(gc_NewHolidays) ;
            _staticColumns.Add(gc_OldHolidays);
            _staticColumns.Add(gc_AvailableHolidays) ;
            _staticColumns.Add(gc_UsedHolidays) ;
            _staticColumns.Add(gc_SpareHolidaysExc) ;
            _staticColumns.Add(gc_SpareHolidaysInc);

            gc_HWGR.Visible = false;

            _yearwrapper = new YearWrapper(_TodayYear);
            gcAbsencePlanning.ContextMenuStrip = cmAbsencePlanning;
            int[] years = new int[60];
            int y=0;
            for (int i = 2000; i <= 2059; i++)
            {
                years[y++] = i;
            }
            cbYears.Properties.Items.AddRange(years);

            cbYears.SelectedItem = Year;
            deMonday.Properties.MinValue = _yearwrapper.BeginYearDate;
            deMonday.Properties.MaxValue = _yearwrapper.EndYearDate;

            AllowEdit = Year >= _TodayYear;

            btn_TakeFromPrevYear.Enabled = false;
            lookUpEditStores.Properties.PopupFormWidth = 250;
        }
Beispiel #3
0
 protected void Init(IList<BzEmployeeHoliday> content, int year)
 {
     m_Wrapper = new YearWrapper(year);
     m_Table = new DataTable();
     BuildStaticColumns();
     BuildDynamicColumns();
     BuildSumsDiction();
     foreach (BzEmployeeHoliday holiday in content)
     {
         DataRow row = m_Table.NewRow();
         ApplyStaticEmployeeValues(holiday, row);
         ApplyDynamicValues(holiday, row);
         ApplySums(holiday);
         m_Table.Rows.Add(row);
     }
 }