private void PageAttendanceChartView_Load(object sender, EventArgs e)
 {
     try
     {
         _EmployeeAttendaceViewer = new ControlEmployeeAttendanceViewer();
         SplitContainerChartView.Panel2.Controls.Clear();
         SplitContainerChartView.Panel2.Controls.Add(_EmployeeAttendaceViewer);
         _EmployeeAttendaceViewer.Dock            = DockStyle.Fill;
         SplitContainerChartView.SplitterDistance = (int)(this.Width * .18);
         //_EmployeesList = new BindingList<SelectListItem>();
         //FormatEmployeeGrid();
         //_AttendanceList = new BindingList<vAttendanceRegister>();
         //FormatAttendanceGrid();
     }
     catch (Exception ex)
     {
         string errMessage = ex.Message;
         if (ex.InnerException != null)
         {
             errMessage += string.Format("\n{0}", ex.InnerException.Message);
         }
         MessageBox.Show(errMessage, "PageAttendanceChartView::PageMonthlyAttendanceManager_Load", MessageBoxButtons.OK, MessageBoxIcon.Error);
     }
 }
Пример #2
0
        public void RefreshTabPage()
        {
            try
            {
                switch (this.SelectedTAB)
                {
                case DB_FORM_IDs.MYPERSONALINFO:
                    if (tabPageMyPersonalInfo == null)
                    {
                        tabPageMyPersonalInfo = new KryptonPage()
                        {
                            Text = "Personal Info", Name = "pagePersonalInfo"
                        };
                        tabMY_INFO.Pages.Add(tabPageMyPersonalInfo);
                        _pagePersonalInfo = new PageMyPersoanlInfo();
                        tabPageMyPersonalInfo.Controls.Add(_pagePersonalInfo);
                        _pagePersonalInfo.Dock    = DockStyle.Fill;
                        tabPageMyPersonalInfo.Tag = SelectedTAB;
                    }
                    tabMY_INFO.SelectedPage = tabPageMyPersonalInfo;

                    break;

                case DB_FORM_IDs.MYLEAVES:
                    if (tabPageMyLeaveApplications == null)
                    {
                        tabPageMyLeaveApplications = new KryptonPage()
                        {
                            Text = "Leave Applications", Name = "pageMyLeaveApplicationc"
                        };
                        tabMY_INFO.Pages.Add(tabPageMyLeaveApplications);
                        _pageLeaveApplications = new PageMyLeaves();
                        tabPageMyLeaveApplications.Controls.Add(_pageLeaveApplications);
                        _pageLeaveApplications.Dock    = DockStyle.Fill;
                        tabPageMyLeaveApplications.Tag = SelectedTAB;
                    }
                    tabMY_INFO.SelectedPage = tabPageMyLeaveApplications;
                    _pageLeaveApplications.PopulateLeavesGrid();
                    break;

                case DB_FORM_IDs.MYADVANCEREQUESTS:
                    if (tabPageMyAdvanceRequests == null)
                    {
                        tabPageMyAdvanceRequests = new KryptonPage()
                        {
                            Text = "Advance Requests", Name = "PageMyAdvanceRequests"
                        };
                        tabMY_INFO.Pages.Add(tabPageMyAdvanceRequests);
                        _pageAdvanceRequests = new PageMyAdvanceRequests();
                        tabPageMyAdvanceRequests.Controls.Add(_pageAdvanceRequests);
                        _pageAdvanceRequests.Dock    = DockStyle.Fill;
                        tabPageMyAdvanceRequests.Tag = SelectedTAB;
                    }
                    tabMY_INFO.SelectedPage = tabPageMyAdvanceRequests;
                    _pageAdvanceRequests.PopulateAdvanceRequestGrid();
                    break;

                case DB_FORM_IDs.MYLOANREQUESTS:
                    if (tabPageMyLoanRequests == null)
                    {
                        tabPageMyLoanRequests = new KryptonPage()
                        {
                            Text = "Loan Applications", Name = "PageMyLoanRequest"
                        };
                        tabMY_INFO.Pages.Add(tabPageMyLoanRequests);
                        _pageLoanRequests = new PageMyLoanRequest();
                        tabPageMyLoanRequests.Controls.Add(_pageLoanRequests);
                        _pageLoanRequests.Dock    = DockStyle.Fill;
                        tabPageMyLoanRequests.Tag = SelectedTAB;
                    }
                    tabMY_INFO.SelectedPage = tabPageMyLoanRequests;
                    break;

                case DB_FORM_IDs.MYATTENDANCE:
                    if (tabPageMyAttendance == null)
                    {
                        tabPageMyAttendance = new KryptonPage()
                        {
                            Text = "Attendance Viewer", Name = "ControlEmployeeAttendanceViewer"
                        };
                        tabMY_INFO.Pages.Add(tabPageMyAttendance);
                        _AttendanceViewer = new ControlEmployeeAttendanceViewer();
                        _AttendanceViewer.AttendanceMonth = AppCommon.GetServerDateTime();
                        _AttendanceViewer.EmployeeID      = Program.CURR_USER.EmployeeID;
                        tabPageMyAttendance.Controls.Add(_AttendanceViewer);
                        _AttendanceViewer.Dock  = DockStyle.Fill;
                        tabPageMyAttendance.Tag = SelectedTAB;
                    }
                    tabMY_INFO.SelectedPage = tabPageMyAttendance;
                    break;

                case DB_FORM_IDs.MYPAYSLIPS:
                    if (tabPageMyPayslips == null)
                    {
                        tabPageMyPayslips = new KryptonPage()
                        {
                            Text = "Payslip Viewer", Name = "PageMyPayslips"
                        };
                        tabMY_INFO.Pages.Add(tabPageMyPayslips);
                        _pageMyPayslips = new PageMyPayslips();
                        tabPageMyPayslips.Controls.Add(_pageMyPayslips);
                        _pageMyPayslips.Dock  = DockStyle.Fill;
                        tabPageMyPayslips.Tag = SelectedTAB;
                    }
                    tabMY_INFO.SelectedPage = tabPageMyPayslips;
                    break;
                }
            }
            catch (Exception ex)
            {
                string errMessage = ex.Message;
                if (ex.InnerException != null)
                {
                    errMessage += string.Format("\n{0}", ex.InnerException.Message);
                }
                MessageBox.Show(errMessage, "PageUserInfo::RefreshTabPage", MessageBoxButtons.OK, MessageBoxIcon.Error);
            }
        }