Example #1
0
        public static void ShowWindow(DevExpress.XtraEditors.XtraForm mainForm,
            DevExpress.XtraEditors.XtraForm form, bool isWait, IFormat isFormat,
            IPermission isPermision, bool ignoreCheckShowForm)
        {
            //if (FrameworkParams.wait != null) FrameworkParams.wait.Finish();
            //if (isWait) FrameworkParams.wait = new WaitingMsg();
            ////Kích hoạt menu đang mở nếu đã mở
            //foreach (Form f in mainForm.MdiChildren)
            //{
            //    if (f.Text.Equals(form.Text) && f.Controls.Count == form.Controls.Count)
            //    {
            //        f.Activate();
            //        return;
            //    }
            //}
            if (ignoreCheckShowForm == false)
            {
                if (HelpPermission.CanShowForm(form) == false)
                {
                    ApplyPermissionAction.getPermissionFormFail().ShowDialog();
                    form.Dispose();
                    return;
                }
            }

            try
            {
                if (form.IsDisposed) return;

                HelpUserLog.logOpenForm(form);
                PLPlugin.HookShowAllPlugin(form);

                form.FormClosed += new FormClosedEventHandler(form_FormClosed);
                //form.Disposed += new EventHandler(form_Disposed);

                form.MdiParent = mainForm;
                form.MinimizeBox = false;
                form.WindowState = FormWindowState.Maximized;
                form.ShowInTaskbar = false;
                form.Icon = FrameworkParams.ApplicationIcon;

                ProtocolForm.pl_wrapper(ref form, isFormat, isPermision);

                form.Shown += new EventHandler(wait);
                //DEVEXPRESS
                if (FrameworkParams.UsingRightClickForm) HelpXtraForm.PopupRightClickForm(form);

                if (form is frmPermissionFail)
                    form.ShowDialog(FrameworkParams.MainForm);
                else
                    form.Show();
            }
            catch (Exception ex)
            {
                PLException.AddException(ex);
                PLMessageBox.ShowSystemErrorMessage(ex.ToString());
            }
        }
Example #2
0
        private void ExportTo(DevExpress.XtraExport.IExportProvider provider,bool blAsTextStyle)
        {
            Cursor currentCursor = Cursor.Current;
            Cursor.Current = Cursors.WaitCursor;
            this.FindForm().Refresh();
            DevExpress.XtraGrid.Export.BaseExportLink link = this.MainView.CreateExportLink(provider);
            (link as DevExpress.XtraGrid.Export.GridViewExportLink).ExpandAll = false;
            (link as DevExpress.XtraGrid.Export.GridViewExportLink).ExportCellsAsDisplayText = blAsTextStyle;
            //link.Progress += new DevExpress.XtraGrid.Export.ProgressEventHandler(Export_Progress);
            //(link as DevExpress.XtraGrid.Export.GridViewExportLink).ExportAppearance.VertLine.Options.us

            //link.ExportAppearance.AsQueryable();
            link.ExportTo(true);

            provider.Dispose();
            //link.Progress -= new DevExpress.XtraGrid.Export.ProgressEventHandler(Export_Progress);
            Cursor.Current = currentCursor;
        }
Example #3
0
        public static void ShowDialog(DevExpress.XtraEditors.XtraForm mainForm,
            DevExpress.XtraEditors.XtraForm form, bool isWaitForm, bool isModal,
            bool ignoreCheckShowForm)
        {
            //if (FrameworkParams.wait != null) FrameworkParams.wait.Finish();
            //if (isWaitForm) FrameworkParams.wait = new WaitingMsg();
            //Kiểm tra quyền.
            if (ignoreCheckShowForm == false)
            {
                if (HelpPermission.CanShowForm(form) == false)
                {
                    ApplyPermissionAction.getPermissionFormFail().ShowDialog();
                    form.Dispose();
                    return;
                }
            }

            try
            {
                if (form.IsDisposed) return;

                HelpUserLog.logOpenForm(form);

                PLPlugin.HookShowAllPlugin(form);

                form.FormClosed += new FormClosedEventHandler(form_FormClosed);

                ProtocolForm.pl_wrapper(ref form);

                EventHandler showEvent = new EventHandler(wait);
                form.Shown += showEvent;

                //DEVEXPRESS
                if (FrameworkParams.UsingRightClickForm) HelpXtraForm.PopupRightClickForm(form);

                if (FrameworkParams.wait != null) FrameworkParams.wait.Finish();

                if (form is frmPermissionFail)
                {
                    form.ShowDialog(mainForm);
                }
                else
                {
                    HelpXtraForm.SetModal(mainForm, form, isModal);
                }
            }
            catch (Exception ex)
            {
                PLException.AddException(ex);
                PLMessageBox.ShowSystemErrorMessage(ex.ToString());
            }
        }