예제 #1
0
 internal void ShowChild(DevExpress.XtraEditors.XtraForm frm)
 {
     string[] allowDuplicatedForm = new string[] { "frmClient" };
     foreach (DevExpress.XtraTabbedMdi.XtraMdiTabPage page in this.xtraTabbedMdiManager1.Pages)
     {
         XtraForm opendFrm = page.MdiChild as XtraForm;
         if (allowDuplicatedForm.Contains(frm.Name))
         {
             if (opendFrm.Text == frm.Text)
             {
                 xtraTabbedMdiManager1.SelectedPage = page;
                 frm.Dispose();
                 return;
             }
         }
         else
         {
             if (opendFrm.Name == frm.Name)
             {
                 xtraTabbedMdiManager1.SelectedPage = page;
                 frm.Dispose();
                 return;
             }
         }
     }
     frm.MdiParent = this;
     frm.Show();
 }
예제 #2
0
 /// <summary>
 /// 将窗口嵌入容器中
 /// </summary>
 /// <param name="form"></param>
 /// <param name="parent"></param>
 private void buildFormIntoParent(DevExpress.XtraEditors.XtraForm form, System.Windows.Forms.Control parent)
 {
     form.FormBorderStyle = System.Windows.Forms.FormBorderStyle.None;
     form.TopLevel        = false;
     form.Parent          = parent;
     form.Dock            = DockStyle.Fill;
     form.Show();
 }
예제 #3
0
        /// <summary>
        /// This method is called to show a form in the MainForm as a MDIChildform
        /// http://www.codeproject.com/Articles/9162/Invoking-methods-Runtime-on-method-name
        /// </summary>
        /// <remarks>Created: Henko Rabie 15/10/2013</remarks>
        /// <param name="form">DevExpress Form to show</param>
        public void ShowForm(DevExpress.XtraEditors.XtraForm form)
        {
            var        mainform    = Application.OpenForms["MainForm"];
            Type       typExternal = mainform.GetType();
            MethodInfo methodInf   = typExternal.GetMethod("ShowForm");

            methodInf.Invoke(mainform, new object[] { form });
        }
예제 #4
0
 internal static void abreForm(DevExpress.XtraEditors.XtraForm form, String msg)
 {
     try
     {
         form.ShowDialog();
     }
     catch (Exception erro)
     {
         Alert.erro(String.Format("{0}\n{1}", msg, erro.Message));
     }
 }
예제 #5
0
        /// <summary>
        /// This method is called to show a form in the MainForm as a MDIChildform
        /// http://www.codeproject.com/Articles/9162/Invoking-methods-Runtime-on-method-name
        /// </summary>
        /// <remarks>Created: Henko Rabie 15/10/2013</remarks>
        /// <param name="form">DevExpress Form to show</param>
        public void ShowForm(DevExpress.XtraEditors.XtraForm form)
        {
            using (new CDS.Client.Desktop.Essential.UTL.WaitCursor())
            {
                var        mainform    = Application.OpenForms["MainForm"];
                Type       typExternal = mainform.GetType();
                MethodInfo methodInf   = typExternal.GetMethod("ShowForm");

                methodInf.Invoke(mainform, new object[] { form });
            }
        }
 public static void ShowInPanel(this DevExpress.XtraEditors.XtraForm form, PanelControl panel)
 {
     panel.Controls.Clear();
     if (form != null)
     {
         form.TopLevel        = false;
         form.FormBorderStyle = FormBorderStyle.None;
         form.Parent          = panel;
         form.Visible         = true;
         //panel.Controls.Add(form);
         form.Dock = DockStyle.Fill;
     }
 }
예제 #7
0
 public SplashAppContext(DevExpress.XtraEditors.XtraForm loginForm, Form splashForm)
     : base(splashForm)
 {
     Cursor.Current = Cursors.WaitCursor;
     this.loginForm = loginForm;
     splashTimer.Interval = 100;
     splashTimer.Tick += new EventHandler(SplashTimeUp);
     splashTimer.Enabled = true;
     try
     {
         System.Threading.ThreadStart thread = new System.Threading.ThreadStart(FrameworkParams.Custom.InitResourceForApplication);
         System.Threading.Thread thread1 = new System.Threading.Thread(thread);
         thread1.Start();
     }
     catch { }
 }
예제 #8
0
 public UserInformation_Project()
 {
     InitializeComponent();
     this.barButtonItem1.ItemClick          += barButtonItem1_ItemClick;
     this.barButtonItem2.ItemClick          += barButtonItem2_ItemClick;
     this.barButtonItem3.ItemClick          += barButtonItem3_ItemClick;
     this.barButtonItem4.ItemClick          += barButtonItem4_ItemClick;
     this.barButtonItem5.ItemClick          += barButtonItem5_ItemClick;
     this.barButtonItem6.ItemClick          += barButtonItem6_ItemClick;
     this.documentManager1.DocumentActivate += delegate(object sender, DevExpress.XtraBars.Docking2010.Views.DocumentEventArgs e)
     {
         if (this.ActiveMdiChild == null)
         {
             return;
         }
         DevExpress.XtraEditors.XtraForm frm = (DevExpress.XtraEditors.XtraForm) this.ActiveMdiChild;
     };
 }
예제 #9
0
        private void addDocument(DevExpress.XtraEditors.XtraForm _xtrForm)
        {
            if (_xtrForm == null)
            {
                return;
            }
            BaseDocument document = docMain.GetDocument(_xtrForm);

            if (document != null)
            {
                tvMain.Controller.Activate(document);
            }
            else
            {
                _xtrForm.MdiParent = this;
                _xtrForm.Show();
            }
        }
예제 #10
0
        //TODO : FIX THIS
        private void ShowForm(string formNamespace, string title, string colorstring)
        {
            Assembly        assembly = Assembly.GetExecutingAssembly();
            Type            type     = assembly.GetType(formNamespace);
            ConstructorInfo ci       = type.GetConstructor(new Type[0]);

            DevExpress.XtraEditors.XtraForm frm = (DevExpress.XtraEditors.XtraForm)ci.Invoke(new Type[0]);
            //if (frm is CDS.Client.Desktop.Document.BaseDocument)
            //{
            //    string[] colorRGB = colorstring.Split(',');
            //    Color color = Color.FromArgb(Convert.ToInt16(colorRGB[0]), Convert.ToInt16(colorRGB[1]), Convert.ToInt16(colorRGB[2]));
            //    (frm as CDS.Client.Desktop.Document.BaseDocument).TabColor = color;
            //}
            frm.Text = title;

            using (new CDS.Client.Desktop.Essential.UTL.WaitCursor())
            {
                MainForm.Instance.ShowForm(frm);
            }
        }
예제 #11
0
        private void OpenForm(DevExpress.XtraEditors.XtraForm frm, DevExpress.XtraTab.XtraTabControl XTabControl)
        {
            foreach (DevExpress.XtraTab.XtraTabPage tab in tabControl.TabPages)
            {
                if (tab.Text == frm.Text)
                {
                    tabControl.SelectedTabPage = tab;
                    return;
                }
            }

            DevExpress.XtraTab.XtraTabPage XTabPage = new DevExpress.XtraTab.XtraTabPage {
                Text = frm.Text
            };
            XTabControl.TabPages.Add(XTabPage);
            XTabControl.SelectedTabPage = XTabPage;
            frm.WindowState             = FormWindowState.Maximized;
            frm.FormBorderStyle         = System.Windows.Forms.FormBorderStyle.None;
            frm.TopLevel = false;
            frm.Parent   = XTabPage;
            frm.Show();
            frm.Dock = DockStyle.Fill;
        }
예제 #12
0
 /// <summary>
 /// Tạo thêm tab mới
 /// </summary>
 /// <param name="tabControl">Tên TabControl để add thêm tabpage mới vào</param>
 /// <param name="Text">Tiêu đề tabpage mới</param>
 /// <param name="Name">Tên tabpage mới</param>
 /// <param name="form">Tên form con của tab mới</param>
 /// <param name="imageIndex">index của icon</param>
 void TabCreating(DevExpress.XtraTab.XtraTabControl tabControl, string Text, string Name, DevExpress.XtraEditors.XtraForm form, int imageIndex)
 {
     DevExpress.XtraTab.XtraTabPage tabpage = new DevExpress.XtraTab.XtraTabPage {
         Text = Text, Name = Name, ImageIndex = imageIndex
     };
     tabControl.TabPages.Add(tabpage);
     tabControl.SelectedTabPage = tabpage;
     form.TopLevel = false;
     form.Parent   = tabpage;
     form.Show();
 }
예제 #13
0
 public static void BeginProcessing(string messageStatus, DevExpress.XtraEditors.XtraForm formParent)
 {
     //Splasher.SplashLoading.Show(typeof(processingForm), formParent);
     //Splasher.SplashLoading.Status = messageStatus;
 }
예제 #14
0
        public ArrayList ListaValores(Int32 inrLista, String idsWhere, Boolean multiselecao, String idsnovocabecalho = "")
        {
            MultiSelecao = multiselecao;

            frmLista = new DevExpress.XtraEditors.XtraForm();
            Int32  iHeight      = 0;
            Int32  iWidth       = 0;
            String isqlConsulta = "";

            try
            {
                tbDadosLista = new DataTable("dadosLista");

                if (Conexao.getInstance().getConnection().State == ConnectionState.Open)
                {
                    Object[] consulta = Utilidades.consultar(String.Format(" select ds_titulo,nr_altura,nr_largura,ds_instrucaosql from listavalores where nr_sequencial = {0}", inrLista));
                    if (consulta != null)
                    {
                        if (Convert.ToInt32(consulta[1]) > 0)
                        {
                            iHeight = Convert.ToInt32(consulta[1]);
                        }
                        if (Convert.ToInt32(consulta[2]) > 0)
                        {
                            iWidth = Convert.ToInt32(consulta[2]);
                        }
                        // se foi passado um novo cabeçalho, usa o que o usuário passou
                        if (idsnovocabecalho.Trim().Length > 0)
                        {
                            frmLista.Text = idsnovocabecalho;
                        }
                        else
                        {
                            frmLista.Text = String.Format("({0}) - {1}", inrLista, Convert.ToString(consulta[0]));
                        }
                        isqlConsulta = Convert.ToString(consulta[3]);
                    }

                    if (!isqlConsulta.Equals(""))
                    {
                        isqlConsulta = isqlConsulta.Replace(":pDsWhere", idsWhere);
                        NpgsqlCommand     cmd     = new NpgsqlCommand(isqlConsulta, Conexao.getInstance().getConnection());
                        NpgsqlDataAdapter adapter = new NpgsqlDataAdapter(cmd);
                        adapter.Fill(tbDadosLista);

                        if (multiselecao)
                        {
                            tbDadosLista.Columns.Add("X", typeof(String)).SetOrdinal(0);
                        }
                    }
                }
                objRetorno               = new ArrayList();
                frmLista.ClientSize      = new Size(iWidth, iHeight + 10);
                frmLista.Font            = new Font("Tahoma", 9, FontStyle.Bold);
                frmLista.WindowState     = FormWindowState.Normal;
                frmLista.FormBorderStyle = FormBorderStyle.FixedSingle;
                frmLista.StartPosition   = FormStartPosition.CenterParent;
                frmLista.KeyPreview      = true;
                frmLista.MaximizeBox     = false;
                frmLista.MinimizeBox     = false;
                frmLista.ShowInTaskbar   = false;
                frmLista.ShowIcon        = false;
                frmLista.TopMost         = true;

                //Tamnho da Tela
                //frmLista.Size = new Size(700, 700);

                ctrlGrid = new DevExpress.XtraGrid.GridControl();
                gridLst  = new DevExpress.XtraGrid.Views.Grid.GridView();

                ctrlGrid.Name       = "ctrlGrid";
                ctrlGrid.MainView   = gridLst;
                gridLst.Name        = "Grid";
                gridLst.GridControl = ctrlGrid;

                ctrlGrid.ViewCollection.AddRange(new DevExpress.XtraGrid.Views.Base.BaseView[] { gridLst });
                ctrlGrid.SetBounds(10, 60, iWidth - 20, iHeight - 85);
                ctrlGrid.DataSource     = tbDadosLista;
                ctrlGrid.BindingContext = new BindingContext();
                ctrlGrid.ForceInitialize();
                gridLst.OptionsView.ShowFilterPanelMode = DevExpress.XtraGrid.Views.Base.ShowFilterPanelMode.Never;
                gridLst.OptionsView.ColumnAutoWidth     = false;

                List <List <Object> > colunas = Conexao.getInstance().toList(
                    " select nr_coluna,ds_titulocoluna,nm_campoinstrsql,nr_larguracampo,ds_alinhamentocampo " +
                    "   from listavalorescolunas " +
                    "  where nr_sequencial = " + inrLista);
                if (colunas != null)
                {
                    if (multiselecao)
                    {
                        RepositoryItemCheckEdit selectdp = new RepositoryItemCheckEdit();
                        gridLst.Columns[0].ColumnEdit = selectdp;
                        selectdp.NullText             = "N";
                        selectdp.ValueChecked         = "S";
                        selectdp.ValueUnchecked       = "N";
                        selectdp.ValueGrayed          = "N";

                        gridLst.Columns[0].Width = 25;
                        gridLst.Columns[0].AppearanceCell.TextOptions.HAlignment   = DevExpress.Utils.HorzAlignment.Center;
                        gridLst.Columns[0].AppearanceHeader.TextOptions.HAlignment = DevExpress.Utils.HorzAlignment.Center;
                        //gridLst.Columns[0].AppearanceHeader.Font = new Font("Tahoma", 9, FontStyle.Bold);
                        gridLst.Columns[0].Caption = "";
                    }

                    foreach (List <Object> col in colunas)
                    {
                        Int32 nrColuna = multiselecao ? Convert.ToInt32(col.ElementAt(0)) + 1 : Convert.ToInt32(col.ElementAt(0));
                        gridLst.Columns[nrColuna - 1].Width = Convert.ToInt32(col.ElementAt(3));
                        gridLst.Columns[nrColuna - 1].OptionsColumn.AllowEdit = false;
                        gridLst.Columns[nrColuna - 1].OptionsColumn.ReadOnly  = true;
                        gridLst.Columns[nrColuna - 1].Caption = Convert.ToString(col.ElementAt(1));

                        if ((col.ElementAt(4) != null ? col.ElementAt(4).ToString() : "Centralizado") == "Direita")
                        {
                            gridLst.Columns[nrColuna - 1].AppearanceCell.TextOptions.HAlignment   = DevExpress.Utils.HorzAlignment.Far;
                            gridLst.Columns[nrColuna - 1].AppearanceHeader.TextOptions.HAlignment = DevExpress.Utils.HorzAlignment.Far;
                            gridLst.Columns[nrColuna - 1].AppearanceHeader.Font = new Font("Tahoma", 9, FontStyle.Bold);
                        }
                        if ((col.ElementAt(4) != null ? col.ElementAt(4).ToString() : "Centralizado") == "Esquerda")
                        {
                            gridLst.Columns[nrColuna - 1].AppearanceCell.TextOptions.HAlignment   = DevExpress.Utils.HorzAlignment.Near;
                            gridLst.Columns[nrColuna - 1].AppearanceHeader.TextOptions.HAlignment = DevExpress.Utils.HorzAlignment.Near;
                            gridLst.Columns[nrColuna - 1].AppearanceHeader.Font = new Font("Tahoma", 9, FontStyle.Bold);
                        }
                        if ((col.ElementAt(4) != null ? col.ElementAt(4).ToString() : "Centralizado") == "Centralizado")
                        {
                            gridLst.Columns[nrColuna - 1].AppearanceCell.TextOptions.HAlignment   = DevExpress.Utils.HorzAlignment.Center;
                            gridLst.Columns[nrColuna - 1].AppearanceHeader.TextOptions.HAlignment = DevExpress.Utils.HorzAlignment.Center;
                            gridLst.Columns[nrColuna - 1].AppearanceHeader.Font = new Font("Tahoma", 9, FontStyle.Bold);
                        }
                    }
                }

                gridLst.GroupPanelText               = "Arraste o Título das Colunas para Agrupar.";
                gridLst.Appearance.GroupPanel.Font   = new Font("Tahoma", 9, FontStyle.Bold);
                gridLst.OptionsSelection.MultiSelect = multiselecao;

                gridLst.GroupPanelText               = "Arraste o Título das Colunas para Agrupar.";
                gridLst.Appearance.GroupPanel.Font   = new Font("Tahoma", 9, FontStyle.Bold);
                gridLst.OptionsSelection.MultiSelect = multiselecao;

                LabelControl lbFiltro    = new LabelControl();
                LabelControl lbInfo      = new LabelControl();
                TextEdit     txtdsFiltro = new TextEdit();

                lbFiltro.Text = "Filtro:";
                lbFiltro.Font = new Font("Tahoma", 9, FontStyle.Bold);
                lbFiltro.SetBounds(7, 23, 50, 15);


                lbInfo.Font = new Font("Tahoma", 9, FontStyle.Bold);
                lbInfo.Text = "Duplo Clique no Registro para Confirmar a Seleção";
                lbInfo.SetBounds(10, iHeight - 15, 350, 13);

                txtdsFiltro.Font = new Font("Tahoma", 9, FontStyle.Regular);
                txtdsFiltro.SetBounds(60, 20, 300, 20);
                txtdsFiltro.Properties.CharacterCasing = CharacterCasing.Upper;
                txtdsFiltro.TabIndex     = 0;
                txtdsFiltro.TextChanged += new EventHandler(dsFiltroChanged);
                txtdsFiltro.KeyDown     += new KeyEventHandler(dsFiltroEnter);

                ctrlGrid.TabIndex = 1;
                ctrlGrid.KeyDown += new KeyEventHandler(dsFiltroEnter);
                if (!multiselecao)
                {
                    ctrlGrid.DoubleClick += new EventHandler(SelecionaRegistro);
                }
                frmLista.KeyDown += new KeyEventHandler(Escape);

                SimpleButton btnConfirmar = new SimpleButton();
                btnConfirmar.SetBounds(iWidth - 110, iHeight - 20, 100, 25);
                btnConfirmar.Text   = "Confirmar";
                btnConfirmar.Font   = new Font(btnConfirmar.Font, FontStyle.Bold);
                btnConfirmar.Font   = new Font("Tahoma", 9, FontStyle.Bold);
                btnConfirmar.Click += new EventHandler(SelecionaRegistro);
                btnConfirmar.Image  = Properties.Resources.Apply_16x16;

                //Desabilita a opção de agrupamento
                gridLst.OptionsView.ShowGroupPanel = false;
                frmLista.Controls.AddRange(new Control[] { ctrlGrid, lbFiltro, txtdsFiltro, lbInfo, btnConfirmar });

                frmLista.ShowDialog();
                frmLista.BringToFront();
            }
            catch (Exception erro)
            {
                Alert.erro("Erro: " + erro.Message);
            }

            return(objRetorno);
        }
        private void GetReport(string FormsID)
        {
            string GetReportRL = string.Format(@"/api/Report/GetReport/");
            var    client      = new ClientConnect();
            var    param       = new Dictionary <string, string>();
            var    header      = new Dictionary <string, string>();

            param.Add("FormsID", FormsID);
            _Forms.UniqueDataStructure.AcceptChanges();
            DataSet TheData = new DataSet();

            TheData.Tables.Clear();
            TheData.Tables.Add(_Forms.UniqueDataStructure);
            string JSOResult;

            JSOResult = JsonConvert.SerializeObject(TheData, Formatting.Indented);
            try
            {
                //this.pdfViewer1.LoadDocument(@"..\..\Report.pdf"

                var response = Task.Run(() => client.PostWithBodyAndParameters(GetReportRL, param, JSOResult)).Result;
                _PrintedForm = JsonConvert.DeserializeObject <PrintedForm>(response);
                string txtPDF = _PrintedForm.PDFLocation;

                if (File.Exists(@_PrintedForm.PDFLocation))
                {
                    if (MoveToProdind)
                    {
                        //Process.Start("explorer.exe", _PrintedForm.PDFLocation);
                        PdfViewer i = new PdfViewer();
                        DevExpress.XtraEditors.XtraForm jj = new DevExpress.XtraEditors.XtraForm();
                        i.LoadDocument(@_PrintedForm.PDFLocation);
                        i.Dock     = DockStyle.Fill;
                        i.ZoomMode = PdfZoomMode.FitToWidth;
                        i.NavigationPanePageVisibility = PdfNavigationPanePageVisibility.None;
                        jj.Controls.Add(i);
                        jj.Width  = 600;
                        jj.Height = 800;
                        jj.Show();
                        jj.ShowIcon = false;
                        jj.Text     = "OCR - DOCUMENT PREVIEW";
                        i.CreateRibbon();
                        // PdfPrinterSettings ps = new PdfPrinterSettings();
                        // i.Print(ps);
                    }
                    else
                    {
                        PdfViewer i = new PdfViewer();
                        DevExpress.XtraEditors.XtraForm jj = new DevExpress.XtraEditors.XtraForm();
                        i.LoadDocument(@_PrintedForm.PDFLocation);
                        i.Dock     = DockStyle.Fill;
                        i.ZoomMode = PdfZoomMode.FitToWidth;
                        i.NavigationPanePageVisibility = PdfNavigationPanePageVisibility.None;
                        jj.Controls.Add(i);
                        jj.Width  = 600;
                        jj.Height = 800;
                        jj.Show();
                        jj.ShowIcon = false;
                        jj.Text     = "CHECKLIST EXAMPLE - CANNOT BE PRINTED";
                    }
                }
            }
            catch (Exception error)
            {
            }
        }
예제 #16
0
        public static void pl_wrapper(ref XtraForm form, IFormat isFormat, IPermission isPermision)
        {
            ProtocolForm standard = new ProtocolForm(form);
            if (isPermision != null)
                standard.applyActions.Add(new ProtocolVN.Framework.Win.ApplyPermissionAction(form.GetType().ToString()));
            if (isFormat != null)
                standard.applyActions.Add(new ProtocolVN.Framework.Win.ApplyFormatAction());

            //PHUOCNC : Thất bại có thể rơi vào chức năng khác
            //          Nhưng hiện tại chắc chắn thất bại chỉ do phân quyền
            if (standard.wrapperForm() == false)
            {
                form.Close();
                form = ApplyPermissionAction.getPermissionFormFail();
            }
            else
            {

            }
        }
예제 #17
0
 private ProtocolForm(XtraForm form)
 {
     this.form = form;
 }
예제 #18
0
        /// Tạo thêm tab mới
        /// <param name="tabControl">Tên TabControl để add thêm tabpage mới vào</param>
        /// <param name="Text">Tiêu đề tabpage mới</param>
        /// <param name="Name">Tên tabpage mới</param>
        /// <param name="form">Tên form con của tab mới</param>
        /// <param name="imageIndex">index của icon</param>
        public void TaoTab(DevExpress.XtraTab.XtraTabControl tabControl, string Text, string Name, DevExpress.XtraEditors.XtraForm form, int imageIndex)
        {
            int index = KiemTraTonTai(tabControl, Name);

            if (index >= 0)
            {
                tabControl.SelectedTabPage      = tabControl.TabPages[index];
                tabControl.SelectedTabPage.Text = Text;
            }
            else
            {
                DevExpress.XtraTab.XtraTabPage tabpage = new DevExpress.XtraTab.XtraTabPage {
                    Text = Text, Name = Name, ImageIndex = imageIndex
                };
                tabControl.TabPages.Add(tabpage);
                tabControl.SelectedTabPage = tabpage;
                form.TopLevel = false;
                form.Parent   = tabpage;
                form.Show();
                form.Dock = DockStyle.Fill;
            }
        }
예제 #19
0
 public static void abrePanel(DevExpress.XtraEditors.XtraForm form, DevExpress.XtraEditors.PanelControl painel)
 {
     painel.Visible  = true;
     painel.Location = new Point((form.Size.Width / 2) - (painel.Size.Width / 2), (form.Size.Height / 2) - (painel.Size.Height / 2));
 }