Beispiel #1
0
 private void toolBtnEmployees_Click(object sender, EventArgs e)
 {
     try
     {
         tabPageEmployees = new KryptonPage()
         {
             Text = "Manage Employees", Name = "tabEmployees"
         };
         tabHR.Pages.Add(tabPageEmployees);
         _pageEmployees = new pageEmployees();
         tabPageEmployees.Controls.Add(_pageEmployees);
         _pageEmployees.Dock = DockStyle.Fill;
         tabHR.SelectedPage  = tabPageEmployees;
     }
     catch (Exception ex)
     {
         MessageBox.Show(ex.Message, "pageHRLanding::toolBtnEmployees_Click", MessageBoxButtons.OK, MessageBoxIcon.Error);
     }
 }
Beispiel #2
0
        private void HRMenuButton_Click(object sender, EventArgs e)
        {
            Cursor.Current = Cursors.WaitCursor;
            try
            {
                DB_FORM_IDs formID = DB_FORM_IDs.NONE;
                if (sender.GetType() == typeof(ToolStripButton))
                {
                    formID = (DB_FORM_IDs)((ToolStripButton)sender).Tag;
                }
                if (sender.GetType() == typeof(ToolStripMenuItem))
                {
                    formID = (DB_FORM_IDs)((ToolStripMenuItem)sender).Tag;
                }

                switch (formID)
                {
                case DB_FORM_IDs.SALARY_HEADS:
                    if (tabPageSalaryHead == null)
                    {
                        tabPageSalaryHead = new KryptonPage()
                        {
                            Text = "Salary Heads Master", Name = "pageSalaryHeadsMaster"
                        };
                        tabHR.Pages.Add(tabPageSalaryHead);
                        _pageSalaryHeads = new PageSalaryHeads();
                        tabPageSalaryHead.Controls.Add(_pageSalaryHeads);
                        _pageSalaryHeads.Dock = DockStyle.Fill;
                        tabPageSalaryHead.Tag = formID;
                    }
                    tabHR.SelectedPage = tabPageSalaryHead;
                    break;

                case DB_FORM_IDs.EMPLOYEE:
                    if (tabPageEmployees == null)
                    {
                        tabPageEmployees = new KryptonPage()
                        {
                            Text = "Employee", Name = "pageEmployeeMaster"
                        };
                        tabHR.Pages.Add(tabPageEmployees);
                        _pageEmployees = new pageEmployees();
                        tabPageEmployees.Controls.Add(_pageEmployees);
                        _pageEmployees.Dock  = DockStyle.Fill;
                        tabPageEmployees.Tag = formID;
                    }
                    tabHR.SelectedPage = tabPageEmployees;
                    break;

                case DB_FORM_IDs.CTC_CONFIGURATION:
                    if (tabPageConfigureCTC == null)
                    {
                        tabPageConfigureCTC = new KryptonPage()
                        {
                            Text = "CTC Designationwise", Name = "pageConfigureCTC"
                        };
                        tabHR.Pages.Add(tabPageConfigureCTC);
                        _pageConfigureCTC = new PageCTCConfiguration();
                        tabPageConfigureCTC.Controls.Add(_pageConfigureCTC);
                        _pageConfigureCTC.Dock  = DockStyle.Fill;
                        tabPageConfigureCTC.Tag = formID;
                    }
                    tabHR.SelectedPage = tabPageConfigureCTC;
                    break;

                case DB_FORM_IDs.HR_LEAVE_CONFIGURATION:
                    if (tabPageManageLeave == null)
                    {
                        tabPageManageLeave = new KryptonPage()
                        {
                            Text = "Manage/Configure Leave(s)", Name = "PageHR_ManageLeaves"
                        };
                        tabHR.Pages.Add(tabPageManageLeave);
                        _pageManageLeave = new PageHR_LeavesConfiguration();
                        tabPageManageLeave.Controls.Add(_pageManageLeave);
                        _pageManageLeave.Dock  = DockStyle.Fill;
                        tabPageManageLeave.Tag = formID;
                    }
                    tabHR.SelectedPage = tabPageManageLeave;
                    break;

                case DB_FORM_IDs.LEAVE_APPLICATIONS:
                    if (tabPageLeavesRegister == null)
                    {
                        tabPageLeavesRegister = new KryptonPage()
                        {
                            Text = "Leaves Register", Name = "tabPageLeavesRegister"
                        };
                        tabHR.Pages.Add(tabPageLeavesRegister);
                        _pageLeavesRegister = new PageLeavesRegister();
                        tabPageLeavesRegister.Controls.Add(_pageLeavesRegister);
                        _pageLeavesRegister.Dock  = DockStyle.Fill;
                        tabPageLeavesRegister.Tag = formID;
                    }
                    tabHR.SelectedPage = tabPageLeavesRegister;
                    break;

                case DB_FORM_IDs.ADVANCE_REQUEST:
                    if (tabPageAdvanceRegister == null)
                    {
                        tabPageAdvanceRegister = new KryptonPage()
                        {
                            Text = "Advance Requests Register", Name = "tabPageAdvanceRequest"
                        };
                        tabHR.Pages.Add(tabPageAdvanceRegister);
                        _pageAdvanceRegister = new PageAdvanceRequestsRegister();
                        tabPageAdvanceRegister.Controls.Add(_pageAdvanceRegister);
                        _pageAdvanceRegister.Dock  = DockStyle.Fill;
                        tabPageAdvanceRegister.Tag = formID;
                    }
                    tabHR.SelectedPage = tabPageAdvanceRegister;
                    break;

                case DB_FORM_IDs.LOAN_REQUEST:
                    if (tabPageLoanRequestRegister == null)
                    {
                        tabPageLoanRequestRegister = new KryptonPage()
                        {
                            Text = "Loan Requests", Name = "tabPageLoanRequestRegister"
                        };
                        tabHR.Pages.Add(tabPageLoanRequestRegister);
                        _pageLoanRequestRegister = new PageLoanRequestRegister();
                        tabPageLoanRequestRegister.Controls.Add(_pageLoanRequestRegister);
                        _pageLoanRequestRegister.Dock  = DockStyle.Fill;
                        tabPageLoanRequestRegister.Tag = formID;
                    }
                    tabHR.SelectedPage = tabPageLoanRequestRegister;
                    break;

                case DB_FORM_IDs.LOAN_DISBURSEMENT:
                    if (tabPageLoanDisbursementRegister == null)
                    {
                        tabPageLoanDisbursementRegister = new KryptonPage()
                        {
                            Text = "Loan Disbursement", Name = "tabPageLoanDisbursementRegister"
                        };
                        tabHR.Pages.Add(tabPageLoanDisbursementRegister);
                        _pageLoanDisbursementRegister = new PageLoanDisbursement();
                        tabPageLoanDisbursementRegister.Controls.Add(_pageLoanDisbursementRegister);
                        _pageLoanDisbursementRegister.Dock  = DockStyle.Fill;
                        tabPageLoanDisbursementRegister.Tag = formID;
                    }
                    tabHR.SelectedPage = tabPageLoanDisbursementRegister;
                    break;

                case DB_FORM_IDs.ATTENDANCE_ENTRY_MANUAL:
                    if (tabPageManualAtendanceEntry == null)
                    {
                        tabPageManualAtendanceEntry = new KryptonPage()
                        {
                            Text = "Attendance Entry -Manual", Name = "PageManualAttendance"
                        };
                        tabHR.Pages.Add(tabPageManualAtendanceEntry);
                        _pageManualAttendance = new PageManualAttendance();
                        tabPageManualAtendanceEntry.Controls.Add(_pageManualAttendance);
                        _pageManualAttendance.Dock      = DockStyle.Fill;
                        tabPageManualAtendanceEntry.Tag = formID;
                    }
                    tabHR.SelectedPage = tabPageManualAtendanceEntry;
                    break;

                case DB_FORM_IDs.ATTENDANCE_IMPORT:
                    if (tabPageImportAttendance == null)
                    {
                        tabPageImportAttendance = new KryptonPage()
                        {
                            Text = "Attendance Import", Name = "PageImportAttendance"
                        };
                        tabHR.Pages.Add(tabPageImportAttendance);
                        _pageImportAttendance = new PageImportAttendance();
                        tabPageImportAttendance.Controls.Add(_pageImportAttendance);
                        _pageImportAttendance.Dock  = DockStyle.Fill;
                        tabPageImportAttendance.Tag = formID;
                    }
                    tabHR.SelectedPage = tabPageImportAttendance;
                    break;

                case DB_FORM_IDs.ATTENDANCE_CHART_VIEW:
                    if (tabPageAttendanceChartView == null)
                    {
                        tabPageAttendanceChartView = new KryptonPage()
                        {
                            Text = "Attendance Chart View", Name = "PageAttendanceChartView"
                        };
                        tabHR.Pages.Add(tabPageAttendanceChartView);
                        _pageAttendancechartview = new PageAttendanceChartView();
                        tabPageAttendanceChartView.Controls.Add(_pageAttendancechartview);
                        _pageAttendancechartview.Dock  = DockStyle.Fill;
                        tabPageAttendanceChartView.Tag = formID;
                    }
                    tabHR.SelectedPage = tabPageAttendanceChartView;
                    break;

                case DB_FORM_IDs.ATTENDANCE_GRID_VIEW:
                    if (tabPageAttendanceGridView == null)
                    {
                        tabPageAttendanceGridView = new KryptonPage()
                        {
                            Text = "Attendance Grid View", Name = "PageAttendanceGridView"
                        };
                        tabHR.Pages.Add(tabPageAttendanceGridView);
                        _pageAttendanceGridView = new PageAttendanceGridView();
                        tabPageAttendanceGridView.Controls.Add(_pageAttendanceGridView);
                        _pageAttendanceGridView.Dock  = DockStyle.Fill;
                        tabPageAttendanceGridView.Tag = formID;
                    }
                    tabHR.SelectedPage = tabPageAttendanceGridView;
                    break;

                case DB_FORM_IDs.ATTENDANCE_SUMMARY_VIEW:
                    if (tabPageAttendanceSummaryView == null)
                    {
                        tabPageAttendanceSummaryView = new KryptonPage()
                        {
                            Text = "Attendance Summary View", Name = "PageAttendanceSummaryView"
                        };
                        tabHR.Pages.Add(tabPageAttendanceSummaryView);
                        _pageAttendanceSummaryView = new PageAttendanceSummaryView();
                        tabPageAttendanceSummaryView.Controls.Add(_pageAttendanceSummaryView);
                        _pageAttendanceSummaryView.Dock  = DockStyle.Fill;
                        tabPageAttendanceSummaryView.Tag = formID;
                    }
                    tabHR.SelectedPage = tabPageAttendanceSummaryView;
                    break;

                case DB_FORM_IDs.ORGANIZATION_CHART:
                    if (tabPageOrganizationChart == null)
                    {
                        tabPageOrganizationChart = new KryptonPage()
                        {
                            Text = "Organization Hierarchy", Name = "PageOrganizationChart"
                        };
                        tabHR.Pages.Add(tabPageOrganizationChart);
                        _pageOrganizationChart = new PageOrganizationChart();
                        tabPageOrganizationChart.Controls.Add(_pageOrganizationChart);
                        _pageOrganizationChart.Dock  = DockStyle.Fill;
                        tabPageOrganizationChart.Tag = formID;
                    }
                    tabHR.SelectedPage = tabPageOrganizationChart;
                    break;

                case DB_FORM_IDs.HOLIDAYS_AND_WEEKOFFS:
                    if (tabPageHolidaysAndWeekOffs == null)
                    {
                        tabPageHolidaysAndWeekOffs = new KryptonPage()
                        {
                            Text = "HR Calendar", Name = "tabPageHolidaysAndWeekOffs"
                        };
                        tabHR.Pages.Add(tabPageHolidaysAndWeekOffs);
                        _pageHolidaysAndWeekOffs = new PageHolidayAndWeekOffs();
                        tabPageHolidaysAndWeekOffs.Controls.Add(_pageHolidaysAndWeekOffs);
                        _pageHolidaysAndWeekOffs.Dock  = DockStyle.Fill;
                        tabPageHolidaysAndWeekOffs.Tag = formID;
                    }
                    tabHR.SelectedPage = tabPageHolidaysAndWeekOffs;
                    break;

                case DB_FORM_IDs.PAYROLL_GENERATE:
                    if (tabPageGeneratePayslips == null)
                    {
                        tabPageGeneratePayslips = new KryptonPage()
                        {
                            Text = "Generate Payslips", Name = "tabPageGeneratePayslips"
                        };
                        tabHR.Pages.Add(tabPageGeneratePayslips);
                        _pageGeneratePayslips = new PageGeneratePayslips();
                        tabPageGeneratePayslips.Controls.Add(_pageGeneratePayslips);
                        _pageGeneratePayslips.Dock  = DockStyle.Fill;
                        tabPageGeneratePayslips.Tag = formID;
                    }
                    tabHR.SelectedPage = tabPageGeneratePayslips;
                    break;

                case DB_FORM_IDs.PAYROLL_VIEW:
                    if (tabPageViewPayslips == null)
                    {
                        tabPageViewPayslips = new KryptonPage()
                        {
                            Text = "Payslip Viewer", Name = "tabPageViewPayslips"
                        };
                        tabHR.Pages.Add(tabPageViewPayslips);
                        _pageViewPayslips = new PageViewPayslips();
                        tabPageViewPayslips.Controls.Add(_pageViewPayslips);
                        _pageViewPayslips.Dock  = DockStyle.Fill;
                        tabPageViewPayslips.Tag = formID;
                    }
                    tabHR.SelectedPage = tabPageViewPayslips;
                    break;
                }
            }
            catch (Exception ex)
            {
                string errMessage = ex.Message;
                if (ex.InnerException != null)
                {
                    errMessage += string.Format("\n{0}", ex.InnerException.Message);
                }
                MessageBox.Show(errMessage, "pageHRLanding::HRMenuButton_Click", MessageBoxButtons.OK, MessageBoxIcon.Error);
            }
            Cursor.Current = Cursors.Default;
        }