Exemple #1
0
        void gvMain_DoubleClick(object sender, EventArgs e)
        {
            GridView    gvMain = sender as GridView;
            Point       pt     = gvMain.GridControl.PointToClient(Control.MousePosition);
            GridHitInfo info   = gvMain.CalcHitInfo(pt);

            if (!info.InRow && !info.InRowCell)
            {
                return;
            }
            if (!gvMain.IsDataRow(gvMain.FocusedRowHandle))
            {
                return;
            }
            //dùng cách này để truyền tham số vào report
            DataRow  drMaster = (_data.BsMain.Current as DataRowView).Row;
            DateTime dt1      = new DateTime(Convert.ToInt32(drMaster["Nam"]), Convert.ToInt32(drMaster["Thang"]), 1);
            DateTime dt2      = dt1.AddMonths(1).AddDays(-1);

            Config.NewKeyValue("@NgayCT1", dt1);
            Config.NewKeyValue("@NgayCT2", dt2);
            DataRow drDetail = gvMain.GetDataRow(gvMain.FocusedRowHandle);

            Config.NewKeyValue("@LoaiCP", drDetail["LoaiCP"]);
            Config.NewKeyValue("@MaCP", drDetail["MaCP"]);
            Config.NewKeyValue("@Nguon", drDetail["Nguon"]);
            Config.NewKeyValue("@BoPhan", drDetail["BoPhan"]);
            XtraForm frmDS = FormFactory.FormFactory.Create(FormType.Report, "1565") as ReportPreview;

            frmDS.WindowState = FormWindowState.Maximized;
            frmDS.ShowDialog();
        }
        // Creates a new form that is invoked on the card click and
        // shows the chart displaying client data.
        void DisplayDetailedChart(string title, DataTable dataSource)
        {
            XtraForm form = new XtraForm();

            form.Text   = title;
            form.Bounds = new Rectangle(100, 100, 700, 350);

            ChartControl chart = new ChartControl();

            chart.Parent = form; chart.Dock = DockStyle.Fill;

            Series series1 = new Series("Actual", ViewType.SplineArea);
            Series series2 = new Series("Target", ViewType.Spline);

            chart.Series.AddRange(new Series[] { series1, series2 });

            foreach (Series series in chart.Series)
            {
                series.DataSource     = dataSource; series.ArgumentDataMember = "Argument";
                series.ValueScaleType = ScaleType.Numerical;
            }
            series1.ValueDataMembers.AddRange(new string[] { "Actual" });
            series2.ValueDataMembers.AddRange(new string[] { "Target" });
            ((XYDiagram)chart.Diagram).AxisY.Label.TextPattern = "{V:$0}";

            form.ShowDialog();
            form.Dispose();
        }
Exemple #3
0
        public static string ShowDialog(string text, string caption, bool password = true)
        {
            XtraForm prompt = new XtraForm()
            {
                Width           = 500,
                Height          = 150,
                FormBorderStyle = FormBorderStyle.FixedDialog,
                Text            = caption,
                StartPosition   = FormStartPosition.CenterScreen,
                TopMost         = true
            };
            LabelControl textLabel = new LabelControl()
            {
                Left = 50, Top = 20, Text = text
            };
            TextEdit textBox = new TextEdit()
            {
                Left = 50, Top = 50, Width = 400
            };

            textBox.Properties.UseSystemPasswordChar = password;
            SimpleButton confirmation = new SimpleButton()
            {
                Text = "Ok", Left = 200, Width = 100, Top = 80, DialogResult = DialogResult.OK
            };

            confirmation.Click += (sender, e) => {
                prompt.Close();
            };
            prompt.Controls.Add(textBox);
            prompt.Controls.Add(confirmation);
            prompt.Controls.Add(textLabel);
            prompt.AcceptButton = confirmation;
            return(prompt.ShowDialog() == DialogResult.OK ? textBox.Text : "");
        }
Exemple #4
0
        private void PivotGrid_CellDoubleClick(object sender, PivotCellEventArgs e)
        {
            XtraForm form = new XtraForm();

            form.Icon            = Marbid.Module.Win.Properties.Resources.mareinico;
            form.Height          = 800;
            form.Width           = 600;
            form.StartPosition   = FormStartPosition.CenterScreen;
            form.Owner           = pivotForm;
            form.Text            = "Drill Down: " + ReportName;
            drillGrid            = new GridControl();
            drillView            = new DevExpress.XtraGrid.Views.Grid.GridView();
            drillGrid.DataSource = e.CreateDrillDownDataSource();
            drillGrid.ViewCollection.Add(drillView);
            drillGrid.ForceInitialize();
            drillGrid.Parent = form;
            drillGrid.Dock   = DockStyle.Fill;
            DevExpress.XtraGrid.Views.Grid.GridView view = (DevExpress.XtraGrid.Views.Grid.GridView)drillGrid.MainView;
            view.PopulateColumns();
            foreach (GridColumn col in view.Columns)
            {
                if (col.GetType() == typeof(System.Decimal) || col.GetType() == typeof(System.Double))
                {
                    col.DisplayFormat.FormatType   = FormatType.Numeric;
                    col.DisplayFormat.FormatString = "n2";
                }
            }
            view.PopupMenuShowing           += DrillGrid_PopupMenuShowing;
            view.OptionsView.ColumnAutoWidth = false;
            view.BestFitColumns(true);
            form.ShowDialog();
            form.Dispose();
        }
Exemple #5
0
        public Form_TransparentBack(XtraForm _foregroundForm)
        {
            InitializeComponent();

            StartPosition                    = _foregroundForm.StartPosition;
            Location                         = _foregroundForm.Location;
            Size                             = _foregroundForm.Size;
            _foregroundForm.Resize          += _foregroundForm_Resize;
            FormBorderStyle                  = System.Windows.Forms.FormBorderStyle.None;
            _foregroundForm.LocationChanged += _foregroundForm_LocationChanged;
            ShowInTaskbar                    = false;
            //BackColor = Color.WhiteSmoke;
            Opacity = 0.5;
            Timer timer = new Timer()
            {
                Interval = 10
            };

            timer.Tick += delegate(object sn, EventArgs ea)
            {
                (sn as Timer).Stop();
                _foregroundForm.ShowDialog();
            };
            timer.Start();
            Show();
        }
Exemple #6
0
 private void btnFileView_ButtonClick(object sender, DevExpress.XtraEditors.Controls.ButtonPressedEventArgs e)
 {
     if (DocumentGrid.GetFocusedRow() is Documents documents)
     {
         using (NetworkShareAccesser.Access("PLGUNV_ADSERVER", @"PLGUNV", "administrator", "itpower@123"))
         {
             try
             {
                 XtraForm xtraForm = new XtraForm()
                 {
                     StartPosition = FormStartPosition.CenterScreen
                 };
                 var pct = new PictureEdit()
                 {
                     Dock  = DockStyle.Fill,
                     Image = Image.FromFile(Path.Combine(documents.RootDirectory,
                                                         documents.FileId + documents.ExtName)),
                 };
                 pct.Properties.SizeMode = DevExpress.XtraEditors.Controls.PictureSizeMode.Squeeze;
                 xtraForm.Controls.Add(pct);
                 xtraForm.ShowDialog();
             }
             catch (Exception exception)
             {
                 MessageBox.Show(exception.Message, exception.Message, MessageBoxButtons.OK,
                                 MessageBoxIcon.Exclamation);
             }
         }
     }
 }
Exemple #7
0
        private void dashboardViewer1_DashboardItemDoubleClick(object sender, DashboardItemMouseActionEventArgs e)
        {
            XtraForm form = new XtraForm {
                Text = "Underlying Data"
            };
            DashboardUnderlyingDataSet underlyingData = e.GetUnderlyingData();

            if (underlyingData != null && underlyingData.RowCount > 0)
            {
                DevExpress.XtraGrid.GridControl grid = new DevExpress.XtraGrid.GridControl {
                    Parent     = form,
                    Dock       = DockStyle.Fill,
                    DataSource = underlyingData,
                };
            }
            else
            {
                LabelControl lbl = new LabelControl {
                    Text   = "No Data",
                    Parent = form,
                };
                lbl.AutoSizeMode = LabelAutoSizeMode.None;
                lbl.Appearance.TextOptions.HAlignment = HorzAlignment.Center;
                lbl.Appearance.TextOptions.VAlignment = VertAlignment.Center;
                lbl.Dock = DockStyle.Fill;
            }

            form.ShowDialog();
            form.Dispose();
        }
Exemple #8
0
        /// <summary>
        /// 保存整个文书的模板
        /// </summary>
        /// <returns></returns>
        public bool SaveAllDataModel(DataTable TotalModelDT)
        {
            TotalModelDT.TableName = "TOTALMODEL";
            bool isSaved = false;
            SetNewDocumentTemplet newDocumentTemplet = new SetNewDocumentTemplet();
            XtraForm xtraForm = GetDialogForm("保存整体模板", newDocumentTemplet);

            xtraForm.Size = new Size(634, 160);
            if (xtraForm.ShowDialog() == DialogResult.OK && newDocumentTemplet.DialogResultData != null)
            {
                MED_DOCUMENT_TEMPLET row = newDocumentTemplet.DialogResultData;
                row.DOCUMENT_NAME = Path.GetFileNameWithoutExtension(_baseDoc.ReportName);
                row.ISJUBU        = 0;
                MemoryStream stream = new MemoryStream();
                TotalModelDT.WriteXml(stream);
                stream.Position   = 0;
                row.TEMPLET_VALUE = FileHelper.StreamToBytes(stream);
                stream.Close();
                stream.Dispose();
                isSaved = SaveModel(row);
            }
            else
            {
                MessageBoxFormPC.Show("除患者基本信息外其他信息为空—请填写后再保存模板", "提示信息", MessageBoxButtons.OK, MessageBoxIcon.Warning);
            }
            return(isSaved);
        }
Exemple #9
0
 private void simpleButton2_Click(object sender, EventArgs e)
 {
     using (var control = new SelectorClient()
     {
         Dock = System.Windows.Forms.DockStyle.Fill
     })
     {
         using (var form = new XtraForm()
         {
             StartPosition = System.Windows.Forms.FormStartPosition.CenterParent,
             Text = "Выбор клиента",
             ShowIcon = false,
             Size = new System.Drawing.Size(400, 600)
         })
         {
             form.Controls.Add(control);
             form.ShowDialog();
             if (form.DialogResult == System.Windows.Forms.DialogResult.OK)
             {
                 currentClient           = control.GetClient;
                 currentDelivery.OwnerId = currentClient.Id;
                 textEdit1.Text          = $"{currentClient.FirstName} {currentClient.SecondName} {currentClient.LastName}";
             }
         }
     }
 }
Exemple #10
0
        /// <summary>
        /// 保存整体模板
        /// </summary>
        /// <returns></returns>
        public bool SaveModel()
        {
            bool isSaved = false;

            if (null != this._currentMRichTextBox && this._currentMRichTextBox.TempletFlag == DocTempletType.AnesSummary)
            {
                SetNewDocumentTemplet newDocumentTemplet = new SetNewDocumentTemplet();
                XtraForm xtraForm = GetDialogForm("保存整体模板", newDocumentTemplet);
                xtraForm.Size    = new Size(340, 320);
                xtraForm.TopMost = true;
                if (xtraForm.ShowDialog() == DialogResult.OK && newDocumentTemplet.DialogResultData != null)
                {
                    MED_DOCUMENT_TEMPLET row = newDocumentTemplet.DialogResultData;
                    row.DOCUMENT_NAME = Path.GetFileNameWithoutExtension(_baseDoc.ReportName);
                    row.ISJUBU        = 0;
                    row.TEMPLET_VALUE = StringHelper.Str2Arr(this._currentMRichTextBox.Text.Trim());
                    isSaved           = SaveModel(row);
                }
                else
                {
                    MessageBoxFormPC.Show("除患者基本信息外其他信息为空—请填写后再保存模板", "提示信息", MessageBoxButtons.OK, MessageBoxIcon.Warning);
                }
            }
            return(isSaved);
        }
Exemple #11
0
 public static void FormCurrentRecordEdit(GridView gridView1, XtraForm ChildForm, string btnCreateClose = "btnCreateClose", string btnCreateNext = "btnCreateNext", string panelControl2 = "panelControl2")
 {
     EditRowIndex   = gridView1.FocusedRowHandle;
     ChildForm.Text = "ویرایش رکورد جاری";
     ChildForm.Controls[panelControl2].Controls[btnCreateClose].Text   = "ویرایش و بستن";
     ChildForm.Controls[panelControl2].Controls[btnCreateNext].Visible = false;
     ChildForm.ShowDialog();
 }
Exemple #12
0
        private void YeniKodEkle_Click(object sender, ItemClickEventArgs e)
        {
            Type     tip  = Assembly.Load("NetSatis.BackOffice").GetTypes().SingleOrDefault(c => c.Name == "frmKodlar");
            XtraForm form = (XtraForm)Activator.CreateInstance(tip, _table.ToString());

            form.ShowDialog();
            BarButonSil();
            BarButonOlustur();
        }
Exemple #13
0
        private void YeniKodEkle_Click(object sender, ItemClickEventArgs e)
        {
            //Front officeyide bu şekilde çalıştır.     TİP BACKOFFİCE İSE BUNU FRONTSA BUNU YAP.
            Type     tip  = Assembly.Load("BenimSalonum.BackOffice").GetTypes().SingleOrDefault(c => c.Name == "FrmKodlar");
            XtraForm form = (XtraForm)Activator.CreateInstance(tip, _table.ToString());

            form.ShowDialog();
            BarButonSil();
            barButonOlustur();
        }
Exemple #14
0
 /// <summary>
 /// 应用整体模板
 /// </summary>
 /// <returns></returns>
 public DataTable ApplyAllDataModel()
 {
     if (_currentGridView == null)
     {
         DocumentTemplet documentTemplet = new DocumentTemplet(DocTempletType.ALL, Path.GetFileNameWithoutExtension(_baseDoc.ReportName), ExtendAppContext.Current.EventNo);
         XtraForm        xtraForm        = GetDialogForm("套用模板", documentTemplet);
         xtraForm.TopMost = true;
         if (xtraForm.ShowDialog() == DialogResult.OK)
         {
             DataTable TotalModelDT = documentTemplet.DialogResultDataTable;
             return(TotalModelDT);
         }
     }
     else
     {
         if (_currentGridView != null)
         {
             if (_currentGridView.TempletFlag == DocTempletType.QiXieQingDian)
             {
                 QiXieQingDianTemplet qiXieQingDianTemplet = new QiXieQingDianTemplet();
                 qiXieQingDianTemplet.IsApply = true;
                 XtraForm xtraForm = GetDialogForm("套用模板", qiXieQingDianTemplet);
                 if (xtraForm.ShowDialog() == DialogResult.OK && !string.IsNullOrEmpty(qiXieQingDianTemplet.DialogResultData))
                 {
                     SetQingdianViewData(qiXieQingDianTemplet.DialogResultData, qiXieQingDianTemplet.IsAddTempletData);
                     return(null);
                 }
             }
         }
         else if (_currentMRichTextBox != null)
         {
             if (_currentMRichTextBox.TempletFlag != DocTempletType.None)
             {
                 DocumentTemplet documentTemplet = null;
                 if (_currentMRichTextBox.TempletFlag == DocTempletType.Other && !string.IsNullOrEmpty(_currentMRichTextBox.OtherTempletFlagString))
                 {
                     documentTemplet = new DocumentTemplet(_currentMRichTextBox.OtherTempletFlagString.Trim(), ExtendAppContext.Current.EventNo);
                 }
                 else
                 {
                     documentTemplet = new DocumentTemplet(_currentMRichTextBox.TempletFlag, ExtendAppContext.Current.EventNo);
                 }
                 XtraForm xtraForm = GetDialogForm("套用模板", documentTemplet);
                 xtraForm.TopMost = true;
                 if (xtraForm.ShowDialog() == DialogResult.OK)
                 {
                     _currentMRichTextBox.Text = documentTemplet.DialogResultData;
                     return(null);
                 }
             }
         }
     }
     return(null);
 }
        public static DialogResult ShowLoginScreen()
        {
            DialogResult result = DialogResult.None;
            Login_UC     login  = new Login_UC(result);

            login.Dock = DockStyle.Fill;
            XtraForm form = new XtraForm();

            form.FormBorderStyle = FormBorderStyle.None;
            form.ClientSize      = login.ClientSize;
            form.StartPosition   = FormStartPosition.CenterScreen;
            form.Controls.Add(login);
            result = form.ShowDialog();
            return(result);
        }
Exemple #16
0
        /// <summary>
        /// 应用模板
        /// </summary>
        /// <returns></returns>
        public bool ApplyModel()
        {
            bool isApplyed = false;

            if (_currentGridView == null && _currentMRichTextBox == null)
            {
                Dialog.MessageBox("请选择被套用控件");
                return(false);
            }
            if (_currentGridView != null)
            {
                if (_currentGridView.TempletFlag == DocTempletType.QiXieQingDian)
                {
                    QiXieQingDianTemplet qiXieQingDianTemplet = new QiXieQingDianTemplet();
                    qiXieQingDianTemplet.IsApply = true;
                    XtraForm xtraForm = GetDialogForm("套用模板", qiXieQingDianTemplet);
                    xtraForm.TopMost = true;
                    if (xtraForm.ShowDialog() == DialogResult.OK && !string.IsNullOrEmpty(qiXieQingDianTemplet.DialogResultData))
                    {
                        SetQingdianViewData(qiXieQingDianTemplet.DialogResultData, qiXieQingDianTemplet.IsAddTempletData);
                        isApplyed = true;
                    }
                }
            }
            else if (_currentMRichTextBox != null)
            {
                if (_currentMRichTextBox.TempletFlag != DocTempletType.None)
                {
                    DocumentTemplet documentTemplet = null;
                    if (_currentMRichTextBox.TempletFlag == DocTempletType.Other && !string.IsNullOrEmpty(_currentMRichTextBox.OtherTempletFlagString))
                    {
                        documentTemplet = new DocumentTemplet(_currentMRichTextBox.OtherTempletFlagString.Trim(), ExtendAppContext.Current.EventNo);
                    }
                    else
                    {
                        documentTemplet = new DocumentTemplet(_currentMRichTextBox.TempletFlag, ExtendAppContext.Current.EventNo);
                    }
                    XtraForm xtraForm = GetDialogForm("套用模板", documentTemplet);
                    xtraForm.TopMost = true;
                    if (xtraForm.ShowDialog() == DialogResult.OK)
                    {
                        _currentMRichTextBox.Text = documentTemplet.DialogResultData;
                        isApplyed = true;
                    }
                }
            }
            return(isApplyed);
        }
Exemple #17
0
        private void startNewGroup_ItemClick(object sender, DevExpress.XtraBars.ItemClickEventArgs e)
        {
            var grp      = new groupformv2(this);
            var newgroup = new XtraForm
            {
                FormBorderStyle = FormBorderStyle.FixedDialog,
                MaximizeBox     = false,
                MinimizeBox     = false,
            };

            newgroup.Controls.Add(grp);
            newgroup.Controls[0].Dock = DockStyle.Fill;
            newgroup.ClientSize       = new Size(grp.layoutControl1.Root.MinSize.Width, grp.layoutControl1.Root.MinSize.Height);
            newgroup.StartPosition    = FormStartPosition.CenterParent;

            newgroup.ShowDialog(this);
        }
Exemple #18
0
 private void dashboardViewer1_DashboardItemClick(object sender,
                                                  DashboardItemMouseActionEventArgs e)
 {
     if (e.DashboardItemName == "chartDashboardItem1" && e.GetAxisPoint() != null)
     {
         XtraForm form = new XtraForm();
         form.Text = e.GetAxisPoint(DashboardDataAxisNames.ChartArgumentAxis).
                     DimensionValue.Value.ToString() + " - " +
                     e.GetAxisPoint(DashboardDataAxisNames.ChartSeriesAxis).
                     DimensionValue.Value.ToString();
         DataGrid grid = new DataGrid();
         grid.Parent     = form; grid.Dock = DockStyle.Fill;
         grid.DataSource = e.GetUnderlyingData();
         form.ShowDialog();
         form.Dispose();
     }
 }
Exemple #19
0
        /// <summary>
        /// 录入按钮事件 通过recordId判断打开不同录入界面
        /// </summary>
        /// <param name="sender"></param>
        /// <param name="e"></param>
        private void btnLuRu_Click(object sender, EventArgs e)
        {
            XtraForm xform = new XtraForm();

            xform.FormClosed     += new FormClosedEventHandler(FormClosed);
            xform.StartPosition   = FormStartPosition.CenterParent;
            xform.FormBorderStyle = FormBorderStyle.FixedDialog;
            if (this.recordId == "2")
            {
                UCOutAndInpRecord oai = new UCOutAndInpRecord();
                xform.Width  = 850;
                xform.Height = 620;
                xform.Controls.Add(oai);
            }
            else if (this.recordId == "3")
            {
                UCChildNurseRecord cnr = new UCChildNurseRecord();
                xform.Width  = 1170;
                xform.Height = 615;
                xform.Controls.Add(cnr);
            }
            else if (this.recordId == "4")
            {
                NoOperNurseRecordForm noOperNurseRecordForm = new NoOperNurseRecordForm();
                noOperNurseRecordForm.InitDate(this.recordId);
                noOperNurseRecordForm.FormClosed += new FormClosedEventHandler(FormClosed);
                //noOperNurseRecordForm.Width = 1250;
                //noOperNurseRecordForm.Height = 700;
                noOperNurseRecordForm.FormBorderStyle = FormBorderStyle.FixedDialog;
                noOperNurseRecordForm.ShowDialog();
            }
            else if (this.recordId == "5")
            {
                UCDevOperNurseRecord uCDevOperNurseRecord = new UCDevOperNurseRecord();
                uCDevOperNurseRecord.InitDate(this.recordId);
                xform.Width       = 1150;
                xform.Height      = 750;
                xform.MaximizeBox = false;
                xform.Controls.Add(uCDevOperNurseRecord);
            }
            if (this.recordId != "4")
            {
                xform.ShowDialog();
            }
        }
Exemple #20
0
        /// <summary>
        /// 显示弹出窗体
        /// </summary>
        /// <param name="ucTmp"></param>
        /// <param name="title"></param>
        private void ShowPopForm(UserControl ucTmp, string title)
        {
            if (ucTmp != null && !ucTmp.IsDisposed)
            {
                ucTmp.Dock = DockStyle.Fill;

                Form frm = new XtraForm();
                frm.Text          = title;
                frm.ShowInTaskbar = false;
                frm.MinimizeBox   = false;
                frm.MaximizeBox   = false;
                frm.Height        = ucTmp.Size.Height + 30;
                frm.Width         = ucTmp.Size.Width + 20;
                frm.StartPosition = FormStartPosition.CenterParent;
                frm.Icon          = Properties.Resources.frm;
                frm.Controls.Add(ucTmp);
                frm.ShowDialog();
            }
        }
Exemple #21
0
        private void startNewStd_ItemClick(object sender, DevExpress.XtraBars.ItemClickEventArgs e)
        {
            var frm    = new stdformv2();
            var newstd = new XtraForm
            {
                FormBorderStyle = FormBorderStyle.FixedDialog,
                MaximizeBox     = false,
                MinimizeBox     = false
            };

            newstd.Controls.Add(frm);
            newstd.Controls[0].Dock = DockStyle.Fill;
            newstd.ClientSize       = new Size(frm.mainlayoutcontrol.Root.MinSize.Width, frm.mainlayoutcontrol.Root.MinSize.Height);
            newstd.StartPosition    = FormStartPosition.CenterParent;
            newstd.Text             = @"+ creating";

            frm.controlInit();
            newstd.ShowDialog(this);
        }
Exemple #22
0
        private void repositoryItemButtonEdit1_DoubleClick(object sender, EventArgs e)
        {
            Pallet         pallet = new Pallet();
            PalletLocation pl     = new PalletLocation();

            if (gridItemMovementView.FocusedValue != null)
            {
                prev = gridItemMovementView.FocusedValue;
                pl.LoadByPrimaryKey(Convert.ToInt32(gridItemMovementView.FocusedValue));
                if (!pl.IsColumnNull("PalletID"))
                {
                    pallet.GetAllItemsInPallet(pl.PalletID);
                    gridControl2.DataSource = pallet.DefaultView;
                    pallet.GetAllItemsInPalletSKUTotal(pl.PalletID);
                    Label l = new Label();
                    l.Dock = DockStyle.Bottom;

                    XtraForm f = new XtraForm();
                    //gridControl2.Parent = null;
                    f.ShowInTaskbar = false;
                    f.Width         = gridControl2.Width;
                    if (pallet.RowCount > 0 && !pallet.IsColumnNull("Total"))
                    {
                        l.Text = string.Format("Total SKU: {0}", pallet.GetColumn("Total").ToString());
                    }
                    else
                    {
                        l.Text = "Total SKU: 0";
                    }
                    f.Controls.Add(l);

                    pallet.LoadByPrimaryKey(pl.PalletID);
                    if (!pallet.IsColumnNull("PalletNo"))
                    {
                        f.Text = String.Format("Pallet Number: {0}", pallet.PalletNo);
                    }
                    f.Controls.Add(gridControl2);

                    f.StartPosition = FormStartPosition.CenterScreen;
                    f.ShowDialog();
                }
            }
        }
Exemple #23
0
        private void stdEdit(string stdid)
        {
            // creating form
            var frm    = new stdformv2();
            var newstd = new XtraForm
            {
                FormBorderStyle = FormBorderStyle.FixedDialog,
                MaximizeBox     = false,
                MinimizeBox     = false
            };

            newstd.Controls.Add(frm);
            newstd.Controls[0].Dock = DockStyle.Fill;
            newstd.ClientSize       = new Size(frm.mainlayoutcontrol.Root.MinSize.Width, frm.mainlayoutcontrol.Root.MinSize.Height);
            newstd.StartPosition    = FormStartPosition.CenterParent;
            newstd.Text             = @"* editing";

            frm.stdEditFormFill(stdid);
            newstd.ShowDialog(this);
            // ***
        }
Exemple #24
0
        public static void OpenForm(XtraForm xtraForm, ModeOpen modo)
        {
            if (Application.OpenForms[xtraForm.Name] != null)
            {
                Application.OpenForms[xtraForm.Name].Activate();
            }
            else
            {
                switch (modo)
                {
                case ModeOpen.Normal:
                    xtraForm.Show();
                    break;

                case ModeOpen.Dialog:
                    xtraForm.ShowDialog();
                    break;

                default:

                    break;
                }
            }
        }
Exemple #25
0
        private void btnSelectBloodGas_Click(object sender, EventArgs e)
        {
            XtraForm form = new XtraForm();

            form.StartPosition = FormStartPosition.CenterScreen;
            BloodGasSelector bloodGasSelector = new BloodGasSelector(_patientID, _visitID, _operID);

            bloodGasSelector.DefaultDate = dateEdit1.DateTime.Date;
            form.Width            = bloodGasSelector.Width;
            form.Height           = bloodGasSelector.Height;
            bloodGasSelector.Dock = DockStyle.Fill;
            form.Controls.Add(bloodGasSelector);
            form.Text = "选择血气记录";
            form.ShowDialog();
            if (form.DialogResult == DialogResult.OK)
            {
                if (!string.IsNullOrEmpty(bloodGasSelector.SelectedDetailID))
                {
                    _detailID = bloodGasSelector.SelectedDetailID;
                    LoadBloodGasList(_detailID);
                    btnSave.Enabled = true;
                }
            }
        }
Exemple #26
0
        /// <summary>Đặt các thuộc tính để màn hình bình thường trở thành
        /// màn hình dạng MODAL
        /// </summary>
        public static void SetModal(XtraForm mainForm, XtraForm form, 
            bool IsModal, bool IsInTaskbar, bool IsFixForm)
        {
            if (IsFixForm == true) SetFix(form);
            else SetResize(form);

            form.ShowInTaskbar = IsInTaskbar;
            form.StartPosition = FormStartPosition.CenterScreen;
            form.Icon = FrameworkParams.ApplicationIcon;
            form.Text = HelpApplication.getTitleForm(form.Text);
            if (IsModal)
            {
                if (mainForm != null)
                {
                    if (mainForm.IsDisposed == false)
                    {
                        form.ShowDialog(mainForm);
                    }
                    else
                    {
                        form.Tag = "NO";
                    }
                }
                else form.Show();
            }
            else
            {
                if (mainForm != null) form.Owner = mainForm;
                form.Show();
            }
        }
        private void repositoryItemButtonEdit1_DoubleClick(object sender, EventArgs e)
        {
            Pallet pallet = new Pallet();
            PalletLocation pl = new PalletLocation();
            if (gridItemMovementView.FocusedValue != null )
            {
                prev = gridItemMovementView.FocusedValue;
                pl.LoadByPrimaryKey(Convert.ToInt32(gridItemMovementView.FocusedValue));
                if (!pl.IsColumnNull("PalletID"))
                {
                    pallet.GetAllItemsInPallet(pl.PalletID);
                    gridControl2.DataSource = pallet.DefaultView;
                    pallet.GetAllItemsInPalletSKUTotal(pl.PalletID);
                    Label l = new Label();
                    l.Dock = DockStyle.Bottom;

                    XtraForm f = new XtraForm();
                    //gridControl2.Parent = null;
                    f.ShowInTaskbar = false;
                    f.Width = gridControl2.Width;
                    if (pallet.RowCount > 0 && !pallet.IsColumnNull("Total"))
                    {

                        l.Text = string.Format("Total SKU: {0}", pallet.GetColumn("Total").ToString());
                    }
                    else
                    {
                        l.Text = "Total SKU: 0";
                    }
                    f.Controls.Add(l);

                    pallet.LoadByPrimaryKey(pl.PalletID);
                    if (!pallet.IsColumnNull("PalletNo"))
                    {
                        f.Text = String.Format("Pallet Number: {0}", pallet.PalletNo);

                    }
                    f.Controls.Add(gridControl2);

                    f.StartPosition = FormStartPosition.CenterScreen;
                    f.ShowDialog();
                }
            }
        }
Exemple #28
0
        private void windowsUIButton_ButtonClick(object sender, ButtonEventArgs e)
        {
            WindowsUIButton btn = e.Button as WindowsUIButton;
            XtraUserControl ctl = new XtraUserControl();

            try
            {
                switch (btn.Tag.ToString())
                {
                case "themsua":
                {
                    enableButon(false);
                    LoadLuoi(1, -1);
                    break;
                }

                case "khongluu":
                {
                    grvChung.RefreshData();
                    enableButon(true);
                    LoadLuoi(0, -1);
                    break;
                }

                case "luu":
                {
                    grvChung.PostEditor();
                    grvChung.UpdateCurrentRow();
                    DateTime dThang = Convert.ToDateTime(cboThang.Text);
                    int      idCN   = -1;
                    try{ idCN = int.Parse(grvChung.GetFocusedRowCellValue("ID_CN").ToString()); } catch { }
                    if (!SaveData())
                    {
                        return;
                    }
                    enableButon(true);
                    Commons.Modules.sPS = "0Load";
                    LoadThang(dThang);

                    Commons.Modules.sPS = "";
                    LoadLuoi(0, idCN);
                    break;
                }

                case "thoat":
                {
                    ParentForm.Close();
                    break;
                }

                case "xoa":
                {
                    DeleteData(-1);
                    break;
                }

                case "Print":
                {
                    PrintData();
                    break;
                }

                case "CapNhap":
                {
                    LoadLuoi(2, -1);
                    break;
                }

                case "XepLoai":
                {
                    XtraForm frm = new XtraForm();
                    Vs.HRM.ucXepLoaiKhenThuong uc = new Vs.HRM.ucXepLoaiKhenThuong();
                    frm.Controls.Clear();
                    frm.Controls.Add(uc);
                    frm.Size          = new Size((this.Size.Width / 2), (this.Size.Height / 2));
                    frm.StartPosition = FormStartPosition.CenterParent;
                    uc.Dock           = DockStyle.Fill;
                    frm.ShowDialog();
                    break;
                }

                default:
                    break;
                }
            }
            catch (Exception Ex)
            {
                XtraMessageBox.Show(Ex.Message.ToLower());
            }
        }
Exemple #29
0
        /// <summary>
        /// 显示弹出窗体
        /// </summary>
        /// <param name="ucTmp"></param>
        /// <param name="title"></param>
        private void ShowPopForm(UserControl ucTmp, string title)
        {
            if (ucTmp != null && !ucTmp.IsDisposed)
            {
                ucTmp.Dock = DockStyle.Fill;

                Form frm = new XtraForm();
                frm.Text = title;
                frm.ShowInTaskbar = false;
                frm.MinimizeBox = false;
                frm.MaximizeBox = false;
                frm.Height = ucTmp.Size.Height + 30;
                frm.Width = ucTmp.Size.Width + 20;
                frm.StartPosition = FormStartPosition.CenterParent;
                frm.Icon = Properties.Resources.frm;
                frm.Controls.Add(ucTmp);
                frm.ShowDialog();
            }
        }
Exemple #30
0
 public void OpenDialog(XtraForm form)
 {
     form.ShowDialog();
 }
Exemple #31
0
        private void btBJ_ItemClick(object sender, ItemClickEventArgs e)
        {
            if (gridView1.FocusedRowHandle == -1) return;
            DataRow row = gridView1.GetDataRow(gridView1.FocusedRowHandle);
            LP_Record obj = Ebada.Core.ConvertHelper.RowToObject<LP_Record>(row);
            //
            XtraForm dlg = new XtraForm(); dlg.Text = "设置标记";
            dlg.StartPosition = FormStartPosition.CenterScreen;
            dlg.Size = new Size(200, 150);

            DevExpress.XtraEditors.ComboBox box = new DevExpress.XtraEditors.ComboBox();
            box.Location = new Point(20, 20);
            box.Width = 150;
            box.Parent = dlg;
            box.Properties.Items.Add("合格");
            box.Properties.Items.Add("不合格");
            box.Properties.Items.Add("作废");
            box.SelectedIndex = 0;
            SimpleButton button1 = new SimpleButton();
            button1.Text = "确认";
            button1.Parent = dlg;
            button1.Location = new Point((dlg.Width / 2 - button1.Width) / 2, dlg.Height - button1.Height - 60);
            button1.DialogResult = DialogResult.OK;
            SimpleButton button2 = new SimpleButton();
            button2.Text = "关闭";
            button2.Parent = dlg;
            button2.Location = new Point(button1.Right + 5, button1.Top);
            button2.DialogResult = DialogResult.Cancel;
            if (dlg.ShowDialog() == DialogResult.OK)
            {
                //Dictionary<string, object> dic = new Dictionary<string, object>();
                //dic.Add("ID", obj.ID);
                //dic.Add("bj", box.EditValue.ToString());
                //Client.ClientHelper.PlatformSqlMap.Update("UpdateLP_RecordByHash", dic);
                //Hashtable ht =new Hashtable();ht.Add("ID",obj.ID);ht.Add("bj",box.EditValue.ToString());
                //Client.ClientHelper.PlatformSqlMap.Update("UpdateLP_RecordByHash", ht);
                Client.ClientHelper.PlatformSqlMap.Update("Update", "update lp_record set bj='" + box.EditValue.ToString() + "' where id='" + obj.ID + "'");
                //
            }
        }
Exemple #32
0
        private void MainForm_Load(object sender, EventArgs e)
        {
            UserID            = userSettings.UserID;
            IsAdmin           = userSettings.IsAdmin;
            LoadSettings      = userSettings.LoadSettings;
            IsAnimation       = userSettings.IsAnimation;
            IsDisconnect      = userSettings.IsDisconnect;
            DisconnectTimeout = userSettings.DisconnectTimeout;
            Theme             = userSettings.Theme;

            if (Theme == "Office 2016 Black")
            {
                PersonalSettings.personalSettings.cbStyle.SelectedIndex = 0;
            }
            else if (Theme == "Office 2016 Dark")
            {
                PersonalSettings.personalSettings.cbStyle.SelectedIndex = 1;
            }
            else if (Theme == "Office 2016 Colorful")
            {
                PersonalSettings.personalSettings.cbStyle.SelectedIndex = 2;
            }
            else if (Theme == "Seven Classic")
            {
                PersonalSettings.personalSettings.cbStyle.SelectedIndex = 3;
            }

            if (LoadSettings)
            {
                PersonalSettings.personalSettings.chbDataLoad.Checked = false;
            }
            else
            {
                PersonalSettings.personalSettings.chbDataLoad.Checked = true;
            }

            if (IsAnimation)
            {
                PersonalSettings.personalSettings.chbWindowAnimation.Checked = false;
            }
            else
            {
                PersonalSettings.personalSettings.chbWindowAnimation.Checked = true;
            }

            if (IsDisconnect)
            {
                PersonalSettings.personalSettings.chbAutoLogout.Checked = true;
                PersonalSettings.personalSettings.tbTimer.Text          = DisconnectTimeout.ToString();
            }
            else
            {
                PersonalSettings.personalSettings.chbAutoLogout.Checked = false;
                PersonalSettings.personalSettings.tbTimer.Text          = string.Empty;
            }

            errorCollector.ApplicationEvent(0, 1, "Запуск приложения", "", false);

            if (controlPanel.Enabled)
            {
                taskModeForm.ShowDialog();
            }

            this.Focus();
        }
Exemple #33
0
 public static void FormNewRecordCreate(XtraForm ChildForm, string btnCreateClose = "btnCreateClose", string txtName = "txtName", string panelControl2 = "panelControl2")
 {
     ChildForm.Text = "ایجاد رکورد جدید";
     ChildForm.Controls[panelControl2].Controls[btnCreateClose].Text = "ایجاد و بستن";
     ChildForm.ShowDialog();
 }
Exemple #34
0
 public void OpenDialog(XtraForm form)
 {
     form.ShowDialog();
 }
Exemple #35
0
        ShowDialog(Type ControlType, string ModuleName)
        {
            using (new WaitCursor(true))
            {
                if (ControlType.IsSubclassOf(typeof(DocumentForm)))
                {
                    ParentEntity orig;

                    frmSingletonEntity frm = new frmSingletonEntity();

                    Control FormCtrl = (Control)BaseFactory
                                       .CreateInstance(ControlType);
                    BindingSource bnd = BaseWinFramework.FindMainBindingSource(
                        (Form)FormCtrl, typeof(ParentEntity));

                    orig = bnd.DataSource as ParentEntity;

                    if (orig == null)
                    {
                        orig = (ParentEntity)
                               BaseFactory.CreateInstance((Type)bnd.DataSource);
                    }

                    if (!orig.LoadEntity())
                    {
                        orig.SetDefaultValue();
                    }

                    frm.pe = (ParentEntity)MetaData.CloneAll(orig);
                    frm.pe.SetOriginal(orig);

                    ((IRuleInitUI)frm.pe).InitUI();

                    DocumentForm frmc = (DocumentForm)FormCtrl;
                    frm.frmc = frmc;

                    bnd.DataSource = frm.pe;
                    IEntityControl df = FormCtrl as IEntityControl;
                    if (df != null)
                    {
                        df.InitNavigator(null);
                    }
                    ((IRuleInitUI)frm.pe).AfterInitNavigator(null);

                    BaseWinFramework.WinForm.AutoFormat
                    .AutoFormatForm(FormCtrl, false);
                    BaseWinFramework.WinForm.AutoLockEntity.LockForm(frm.pe,
                                                                     MetaData.GetTableDef(frm.pe.GetType()), FormCtrl);

                    frm.ep            = new DXErrorProvider(frm);
                    frm.ep.DataSource = bnd;

                    if (frmc != null)
                    {
                        frmc.FormBorderStyle = System.Windows.Forms.FormBorderStyle.None;
                        frmc.FormClosed     += new FormClosedEventHandler(frmc_FormClosed);
                        frmc.FormBorderStyle = System.Windows.Forms.FormBorderStyle.None;
                        frmc.TopLevel        = false;
                        frmc.Parent          = frm;
                        frm.Width            = frmc.Width + frm.Width -
                                               frm.DisplayRectangle.Width;

                        if (frmc.ShowConfirmButton)
                        {
                            frm.Height = frmc.Height + 70;
                        }
                        else
                        {
                            frm.Height = frmc.Height + frm.Height -
                                         frm.DisplayRectangle.Height;
                            frm.simpleButton1.Visible = false;
                            frm.simpleButton2.Visible = false;
                        }
                        frmc.Show();
                    }
                    else
                    {
                        frm.Width  = FormCtrl.Width + frm.Width - frm.DisplayRectangle.Width;
                        frm.Height = FormCtrl.Height + 70;
                        frm.Controls.Add(FormCtrl);
                    }
                    if (frmc != null && frmc.Text.Length > 0)
                    {
                        frm.Text = frmc.Text;
                    }
                    else
                    {
                        frm.Text = BaseUtility.SplitName(ModuleName.Length == 0 ?
                                                         orig.GetType().Name : ModuleName);
                    }

                    ((Control)frmc).TabIndex = 0;
                    return(frm.ShowForm(BaseWinFramework.MdiParent));
                }
                else
                {
                    XtraForm frm = (XtraForm)BaseFactory.CreateInstance(ControlType);
                    return(frm.ShowDialog(BaseWinFramework.MdiParent));
                }
            }
        }