Exemple #1
0
        private void tabMASTERS_CloseAction(object sender, CloseActionEventArgs e)
        {
            try
            {
                if (e.Action == CloseButtonAction.RemovePageAndDispose)
                {
                    DB_FORM_IDs formID = (DB_FORM_IDs)((KryptonPage)e.Item).Tag;
                    switch (formID)
                    {
                    case DB_FORM_IDs.LOCATION: tabLocations.Controls.Clear(); tabLocations = null; break;

                    case DB_FORM_IDs.SUPPLIERS: tabSupplier.Controls.Clear(); tabSupplier = null; break;

                    case DB_FORM_IDs.CUSTOMERS: tabCustomers.Controls.Clear(); tabCustomers = null; break;

                    case DB_FORM_IDs.AGENTS: tabAgents.Controls.Clear(); tabAgents = null; break;

                    case DB_FORM_IDs.INVENTORY_ITEMS: tabInventoryItems.Controls.Clear(); tabInventoryItems = null; break;

                    case DB_FORM_IDs.TNC_MASTER: tabTermAndCondition.Controls.Clear(); tabTermAndCondition = null; break;

                    case DB_FORM_IDs.BANK_MASTER: tabBankMaster.Controls.Clear(); tabBankMaster = null; break;
                    }
                }
            }
            catch (Exception ex)
            {
                string errMessage = ex.Message;
                if (ex.InnerException != null)
                {
                    errMessage += string.Format("\n{0}", ex.InnerException.Message);
                }
                MessageBox.Show(errMessage, "pageMASTERS::tabMASTERS_CloseAction", MessageBoxButtons.OK, MessageBoxIcon.Error);
            }
        }
Exemple #2
0
        private void tabMY_INFO_CloseAction(object sender, CloseActionEventArgs e)
        {
            try
            {
                if (e.Action == CloseButtonAction.RemovePageAndDispose)
                {
                    DB_FORM_IDs formID = (DB_FORM_IDs)((KryptonPage)e.Item).Tag;
                    switch (formID)
                    {
                    case DB_FORM_IDs.MYPERSONALINFO: tabPageMyPersonalInfo.Controls.Clear(); tabPageMyPersonalInfo = null; break;

                    case DB_FORM_IDs.MYADVANCEREQUESTS: tabPageMyAdvanceRequests.Controls.Clear(); tabPageMyAdvanceRequests = null; break;

                    case DB_FORM_IDs.MYLEAVES: tabPageMyLeaveApplications.Controls.Clear(); tabPageMyLeaveApplications = null; break;

                    case DB_FORM_IDs.MYLOANREQUESTS: tabPageMyLoanRequests.Controls.Clear(); tabPageMyLoanRequests = null; break;

                    case DB_FORM_IDs.MYATTENDANCE: tabPageMyAttendance.Controls.Clear(); tabPageMyAttendance = null; break;

                    case DB_FORM_IDs.MYPAYSLIPS: tabPageMyPayslips.Controls.Clear(); tabPageMyPayslips = null; break;
                    }
                }
            }
            catch (Exception ex)
            {
                string errMessage = ex.Message;
                if (ex.InnerException != null)
                {
                    errMessage += string.Format("\n{0}", ex.InnerException.Message);
                }
                MessageBox.Show(errMessage, "PageUserInfo::tabUserInfo_CloseAction", MessageBoxButtons.OK, MessageBoxIcon.Error);
            }
        }
        private void kryptonCell_PageCloseAction(object sender, CloseActionEventArgs e)
        {
            // Tell the cell instance to not perform any actions with the page, we will remove it if we need to
            e.Action = CloseButtonAction.None;

            // Use our own routine to close the page, so user is asked to save changes if required
            CloseMemoPage(e.Item);
        }
Exemple #4
0
 private void MainFormKryptonDockableNavigator_CloseAction(object sender, CloseActionEventArgs e)
 {
     (e.Item.Tag as Form).Close();
     if (MainFormKryptonDockableNavigator.Pages.Count == 1)
     {
         MainFormKryptonDockableNavigator.Visible = false;
     }
 }
Exemple #5
0
        private void tabHR_CloseAction(object sender, CloseActionEventArgs e)
        {
            try
            {
                if (e.Action == CloseButtonAction.RemovePageAndDispose)
                {
                    DB_FORM_IDs formID = (DB_FORM_IDs)((KryptonPage)e.Item).Tag;
                    switch (formID)
                    {
                    case DB_FORM_IDs.SALARY_HEADS: tabPageSalaryHead.Controls.Clear(); tabPageSalaryHead = null; break;

                    case DB_FORM_IDs.EMPLOYEE: tabPageEmployees.Controls.Clear(); tabPageEmployees = null; break;

                    case DB_FORM_IDs.CTC_CONFIGURATION: tabPageConfigureCTC.Controls.Clear(); tabPageConfigureCTC = null; break;

                    case DB_FORM_IDs.HR_LEAVE_CONFIGURATION: tabPageManageLeave.Controls.Clear(); tabPageManageLeave = null; break;

                    case DB_FORM_IDs.LEAVE_APPLICATIONS: tabPageLeavesRegister.Controls.Clear(); tabPageLeavesRegister = null; break;

                    case DB_FORM_IDs.ATTENDANCE_ENTRY_MANUAL: tabPageManualAtendanceEntry.Controls.Clear(); tabPageManualAtendanceEntry = null; break;

                    case DB_FORM_IDs.ATTENDANCE_IMPORT: tabPageImportAttendance.Controls.Clear(); tabPageImportAttendance = null; break;

                    case DB_FORM_IDs.ADVANCE_REQUEST: tabPageAdvanceRegister.Controls.Clear(); tabPageAdvanceRegister = null; break;

                    case DB_FORM_IDs.LOAN_REQUEST: tabPageLoanRequestRegister.Controls.Clear(); tabPageLoanRequestRegister = null; break;

                    case DB_FORM_IDs.LOAN_DISBURSEMENT: tabPageLoanDisbursementRegister.Controls.Clear(); tabPageLoanDisbursementRegister = null; break;

                    case DB_FORM_IDs.ORGANIZATION_CHART: tabPageOrganizationChart.Controls.Clear(); tabPageOrganizationChart = null; break;

                    case DB_FORM_IDs.HOLIDAYS_AND_WEEKOFFS: tabPageHolidaysAndWeekOffs.Controls.Clear(); tabPageHolidaysAndWeekOffs = null; break;

                    case DB_FORM_IDs.ATTENDANCE_CHART_VIEW: tabPageAttendanceChartView.Controls.Clear(); tabPageAttendanceChartView = null; break;

                    case DB_FORM_IDs.ATTENDANCE_GRID_VIEW: tabPageAttendanceGridView.Controls.Clear(); tabPageAttendanceGridView = null; break;

                    case DB_FORM_IDs.PAYROLL: tabPageGeneratePayslips.Controls.Clear(); tabPageGeneratePayslips = null; break;
                    }
                }
            }
            catch (Exception ex)
            {
                string errMessage = ex.Message;
                if (ex.InnerException != null)
                {
                    errMessage += string.Format("\n{0}", ex.InnerException.Message);
                }
                MessageBox.Show(errMessage, "pageHRLanding::tabHR_CloseAction", MessageBoxButtons.OK, MessageBoxIcon.Error);
            }
        }
 private void TabForm_CloseAction(object sender, CloseActionEventArgs e)
 {
     if (e.Item.Text == "MonitorForm")
     {
         foreach (Form form in Application.OpenForms)
         {
             if (form.GetType() == typeof(PLC_MonitorForm))
             {
                 form.Close();
                 return;
             }
         }
     }
 }
        // for "Close" context menu for Krypton Navigator
        private void KryptonCell_CloseAction(object sender, CloseActionEventArgs e)
        {
            var window = e.Item.GetDockWindow();

            if (window != null)
            {
                OnDockWindowCloseRequest(window, out bool cancel);
                if (cancel)
                {
                    e.Action = CloseButtonAction.None;
                }
                else
                {
                    e.Action = window.HideOnRemoving ? CloseButtonAction.HidePage : CloseButtonAction.RemovePageAndDispose;
                }
            }
        }
Exemple #8
0
        private void navigator_CloseAction(object sender, CloseActionEventArgs e)
        {
            ButtonSpecAny newButton = new ButtonSpecAny()
            {
                Image = Resources.add_16x16,
            };

            newButton.Click += NewPageClick;

            if (e.Index == 1)
            {
                navigator.Button.CloseButtonDisplay = ButtonDisplay.Hide;
                pgOne.ButtonSpecs.Add(newButton);
            }
            else
            {
                navigator.Pages[e.Index - 1].ButtonSpecs.Add(newButton);
            }
        }
        private void kryptonNavigator1_CloseAction(object sender, CloseActionEventArgs e)
        {
            // If deleting the last page before the 'new page' then need to switch the
            // selection before the close actually gets processed. Otherwise removing the
            // second to last page will causing the last 'new page' page to be selected.
            // But that would cause a new page to be created! So manually set selection
            // to the previous page to prevent this behavior.
            if (e.Index == (kryptonNavigator1.Pages.Count - 2))
            {
                kryptonNavigator1.SelectedIndex = kryptonNavigator1.Pages.Count - 3;
            }

            // You cannot delete the last document page. As the 'new page' page at the end of
            // the collection should always be there, we insist that 2 pages must be present. As
            // we are now removing a page that means that if there are 3 pages then after the
            // remove has completed we should not allow any more removes.
            if (kryptonNavigator1.Pages.Count == 3)
            {
                kryptonNavigator1.Button.CloseButtonDisplay = ButtonDisplay.ShowDisabled;
            }
        }
Exemple #10
0
        private void kryptonNavigator1_CloseAction(object sender, CloseActionEventArgs e)
        {
            if (((FileData)e.Item.Tag).modified)
            {
                DialogResult result = MessageBox.Show(this, "Do you want to save the changes you have made to " + ((FileData)e.Item.Tag).originalTitle + "?\nIf you don't save, your work will be lost.", "NeoTool", MessageBoxButtons.YesNoCancel, MessageBoxIcon.Exclamation);

                switch (result)
                {
                case DialogResult.Yes:
                    saveAsToolStripMenuItem.PerformClick();
                    return;

                case DialogResult.No:
                    return;

                case DialogResult.Cancel:
                    e.Action = CloseButtonAction.None;
                    return;
                }
            }
        }
        private void tabCRM_CloseAction(object sender, CloseActionEventArgs e)
        {
            try
            {
                if (e.Action == CloseButtonAction.RemovePageAndDispose)
                {
                    DB_FORM_IDs formID = (DB_FORM_IDs)((KryptonPage)e.Item).Tag;
                    switch (formID)
                    {
                    case DB_FORM_IDs.SALES_QUESTIONNAIRE: tabQuestionnaire.Controls.Clear(); tabQuestionnaire = null; break;

                    case DB_FORM_IDs.CUSTOMERS: tabCustomers.Controls.Clear(); tabCustomers = null; break;

                    case DB_FORM_IDs.INVENTORY_ITEMS: tabInventoryItems.Controls.Clear(); tabInventoryItems = null; break;

                    case DB_FORM_IDs.PROJECT_CLOSER_CHECKLIST: tabProjectChecklist.Controls.Clear(); tabProjectChecklist = null; break;

                    case DB_FORM_IDs.SALES_QUOTATION_REVIEW: tabQuotationReview.Controls.Clear(); tabQuotationReview = null; break;

                    case DB_FORM_IDs.SALES_LEAD: tabSalesLead.Controls.Clear(); tabSalesLead = null; break;

                    case DB_FORM_IDs.SALES_ENQUIRY: tabSalesEnquiry.Controls.Clear(); tabSalesEnquiry = null; break;

                    case DB_FORM_IDs.SALES_QUOTATION: tabSalesQuotation.Controls.Clear(); tabSalesQuotation = null; break;

                    case DB_FORM_IDs.SALES_ORDER: tabSalesOrder.Controls.Clear(); tabSalesOrder = null; break;
                    }
                }
            }
            catch (Exception ex)
            {
                string errMessage = ex.Message;
                if (ex.InnerException != null)
                {
                    errMessage += string.Format("\n{0}", ex.InnerException.Message);
                }
                MessageBox.Show(errMessage, "pageCRMLanding::tabCRM_CloseAction", MessageBoxButtons.OK, MessageBoxIcon.Error);
            }
        }
        private void tabADMIN_CloseAction(object sender, CloseActionEventArgs e)
        {
            try
            {
                if (e.Action == CloseButtonAction.RemovePageAndDispose)
                {
                    DB_FORM_IDs formID = (DB_FORM_IDs)((KryptonPage)e.Item).Tag;
                    switch (formID)
                    {
                    case DB_FORM_IDs.ADMIN_USER_LIST_AN_DEFAULTS: tabUserLists.Controls.Clear(); tabUserLists = null; break;

                    case DB_FORM_IDs.ADMN_MODULE: tabModules.Controls.Clear(); tabModules = null; break;

                    case DB_FORM_IDs.ADMIN_ROLES: tabRoles.Controls.Clear(); tabRoles = null; break;

                    case DB_FORM_IDs.APP_USERS: tabUsers.Controls.Clear(); tabUsers = null; break;

                    case DB_FORM_IDs.RESTORE_ATTACHMENT: tabRestoreAttachments.Controls.Clear(); tabRestoreAttachments = null; break;

                    case DB_FORM_IDs.ADMIN_VOUCEHRNO_SETUP: tabVoucherNoSetup.Controls.Clear(); tabVoucherNoSetup = null; break;

                    case DB_FORM_IDs.COMPANY_INFO: tabCompanyInfo.Controls.Clear(); tabCompanyInfo = null; break;

                    case DB_FORM_IDs.FINANCIAL_YEAR_SETUP: tabFinYearSetup.Controls.Clear(); tabFinYearSetup = null; break;
                    }
                }
            }
            catch (Exception ex)
            {
                string errMessage = ex.Message;
                if (ex.InnerException != null)
                {
                    errMessage += string.Format("\n{0}", ex.InnerException.Message);
                }
                MessageBox.Show(errMessage, "pageADMINLanding::tabADMIN_CloseAction", MessageBoxButtons.OK, MessageBoxIcon.Error);
            }
        }
Exemple #13
0
 private void kryptonNavigator1_CloseAction(object sender, CloseActionEventArgs e)
 {
     AddOutput("CloseAction");
 }
 private void OnCellCloseAction(object sender, CloseActionEventArgs e)
 {
     OnPageCloseClicked(new UniqueNameEventArgs(e.Item.UniqueName));
 }