Exemplo n.º 1
0
        private void GridControl1_DoubleClick(object sender, EventArgs e)
        {
            try
            {
                GridView testView = gridView1 as GridView;
                //MessageBox.Show(testView.FocusedRowHandle.ToString());
                //this.gridControl1.DataSource = new MyDatabaseConnect01().connection8(test.eqpNumber, "");
                //DataRow drFocusedRow = testView.GetDataRow(testView.FocusedRowHandle);

                if (testView.SelectedRowsCount <= 0)
                {
                    return;
                }
                //MyDialog01 dialog = new MyDialog01(eqpId, testView.GetRowCellValue(testView.FocusedRowHandle, "PROCESS_SEQ").ToString(), testView.GetRowCellValue(testView.FocusedRowHandle, "PROD_ORDER_NUMBER").ToString());
                //dialog.Show();

                FlyoutProperties properties = new FlyoutProperties();
                properties.ButtonSize = new Size(100, 10);
                properties.Style      = FlyoutStyle.Popup;
                FlyoutDialog.Show(this.FindForm(), "", new MyDialog01(eqpId, testView.GetRowCellValue(testView.FocusedRowHandle, "PROCESS_SEQ").ToString(), testView.GetRowCellValue(testView.FocusedRowHandle, "PROD_ORDER_NUMBER").ToString()), properties, 0, 0);
                //FlyoutDialog.Show(this.FindForm(), new MyButtonEdit01());
            }
            catch (Exception ex)
            {
                MessageBox.Show(ex.Message);
            }
        }
Exemplo n.º 2
0
        public MyFlyoutPanel01()
        {
            InitializeComponent();
            //flyoutPanel1.ShowPopup();
            // https://www.devexpress.com/Support/Center/Question/Details/T333871/flyoutpanel-sample
            // https://documentation.devexpress.com/WindowsForms/114578/Controls-and-Libraries/Messages-Notifications-and-Dialogs/Flyout-Panel#beak
            //flyoutPanel1.OwnerControl = this.simpleButton1;

            this.flyoutPanel2.OwnerControl = this.simpleButton1;
            this.flyoutPanel2.Showing     += FlyoutPanel2_Showing;
            this.flyoutPanel2.Hidden      += FlyoutPanel2_Hidden;
            // https://www.devexpress.com/Support/Center/Question/Details/T258043/how-to-use-flyoutdialog-with-usercontrol-from-a-usercontrol-not-from-windowsform
            FlyoutAction action = new FlyoutAction();

            action.Commands.Add(FlyoutCommand.OK);
            action.Commands.Add(FlyoutCommand.Cancel);
            FlyoutDialog.Show(this.FindForm(), action, new MyButtonEdit01());


            FlyoutProperties properties = new FlyoutProperties();

            properties.ButtonSize = new Size(100, 10);
            properties.Style      = FlyoutStyle.Popup;
            FlyoutDialog.Show(this.FindForm(), "", new MyButtonEdit01(), properties, 0, 0);
            //FlyoutDialog.Show(this.FindForm(), new MyButtonEdit01());

            //FlyoutDialog.Show(this.FindForm(), MyDevExpressFunctions.CreateCloseAction(), properties);
        }
Exemplo n.º 3
0
        public KZFlyoutDialog(IUnityContainer container)
        {
            KZHelper = container.Resolve<IKZHelper>();

            action = new FlyoutAction();
            CommandYes = new FlyoutCommand {Text = "យល់ព្រម", Result = DialogResult.Yes};
            CommandNo = new FlyoutCommand {Text = "មិនយល់ព្រម", Result = DialogResult.No};
            action.Commands.Add(CommandYes);
            action.Commands.Add(CommandNo);


            properties = new FlyoutProperties();
            //properties.Appearance.BackColor = Color.Blue;
            //properties.Appearance.Options.UseBackColor = true;

            properties.Appearance.Font = KZHelper.KZFonts.ContentFont;
            properties.Appearance.Options.UseFont = true;
            properties.AppearanceCaption.Font = KZHelper.KZFonts.HeaderFont;
            properties.AppearanceCaption.Options.UseFont = true;
            properties.AppearanceButtons.Font = KZHelper.KZFonts.ContentFont;
            properties.AppearanceButtons.Options.UseFont = true;
            properties.AppearanceDescription.Font = KZHelper.KZFonts.ContentFont;
            properties.AppearanceDescription.Options.UseFont = true;


            properties.ButtonSize = new Size(150, 40);
            properties.Style = FlyoutStyle.MessageBox;
        }
Exemplo n.º 4
0
        private void simpleButton1_Click(object sender, EventArgs e)
        {
            HttpResponseMessage response = new HttpResponseMessage();

            login    = textBox1.Text;
            password = textBox2.Text;
            Task.Run(async() =>
            {
                response = await Main.client.GetAsync("api/Client/IsRegister?login="******"&password="******"Пользователь не найден"
                };
                FlyoutCommand command1 = new FlyoutCommand()
                {
                    Text = "Close", Result = DialogResult.OK
                };
                action.Commands.Add(command1);
                FlyoutProperties properties = new FlyoutProperties();
                properties.ButtonSize = new Size(100, 40);
                properties.Style      = FlyoutStyle.MessageBox;
                FlyoutDialog.Show(M, action, properties);
            }
            else
            if (response.IsSuccessStatusCode)
            {
                client.CLogin    = login;
                client.CPassword = password;
                this.Close();
            }
        }
Exemplo n.º 5
0
        public void ShowSuccessMessage(string message)
        {
            FlyoutAction action = new FlyoutAction()
            {
                Caption = "Success!", Description = message
            };

            FlyoutCommand command1 = new FlyoutCommand()
            {
                Text = "OK", Result = System.Windows.Forms.DialogResult.Yes
            };

            action.Commands.Add(command1);

            FlyoutProperties properties = new FlyoutProperties();

            properties.ButtonSize           = new Size(100, 40);
            properties.Style                = FlyoutStyle.MessageBox;
            properties.Appearance.BackColor = Color.Green;
            properties.Appearance.ForeColor = Color.White;
            DevExpress.XtraBars.Docking2010.Customization.FlyoutDialog.Show(this, action, properties);
            if (DevExpress.XtraBars.Docking2010.Customization.FlyoutDialog.Show(this, action, properties) == DialogResult.Yes)
            {
                this.Close();
            }
        }
Exemplo n.º 6
0
        public KZFlyoutDialog(IUnityContainer container)
        {
            KZHelper = container.Resolve <IKZHelper>();

            action     = new FlyoutAction();
            CommandYes = new FlyoutCommand {
                Text = "យល់ព្រម", Result = DialogResult.Yes
            };
            CommandNo = new FlyoutCommand {
                Text = "មិនយល់ព្រម", Result = DialogResult.No
            };
            action.Commands.Add(CommandYes);
            action.Commands.Add(CommandNo);


            properties = new FlyoutProperties();
            //properties.Appearance.BackColor = Color.Blue;
            //properties.Appearance.Options.UseBackColor = true;

            properties.Appearance.Font                       = KZHelper.KZFonts.ContentFont;
            properties.Appearance.Options.UseFont            = true;
            properties.AppearanceCaption.Font                = KZHelper.KZFonts.HeaderFont;
            properties.AppearanceCaption.Options.UseFont     = true;
            properties.AppearanceButtons.Font                = KZHelper.KZFonts.ContentFont;
            properties.AppearanceButtons.Options.UseFont     = true;
            properties.AppearanceDescription.Font            = KZHelper.KZFonts.ContentFont;
            properties.AppearanceDescription.Options.UseFont = true;


            properties.ButtonSize = new Size(150, 40);
            properties.Style      = FlyoutStyle.MessageBox;
        }
Exemplo n.º 7
0
        private void simpleButton1_Click(object sender, EventArgs e)
        {
            Film Fi18 = OneFilm.Buy.Where(s => s.FAge == 18).FirstOrDefault();
            Film Fi0  = OneFilm.Buy.Where(s => s.FAge < 18).FirstOrDefault();

            if (Fi0 != null && Fi18 != null)
            {
                FlyoutAction action = new FlyoutAction()
                {
                    Caption = "Внимание!", Description = "Невозможно завершить покупку. Невозможна одновременая покупка фильмов с рейтингом <18+ и >18+ "
                };
                FlyoutCommand command1 = new FlyoutCommand()
                {
                    Text = "Close", Result = DialogResult.OK
                };
                action.Commands.Add(command1);
                FlyoutProperties properties = new FlyoutProperties();
                properties.ButtonSize = new Size(100, 40);
                properties.Style      = FlyoutStyle.MessageBox;
                FlyoutDialog.Show(this, action, properties);
            }
            else
            {
                Card C = new Card(price - price * sale, this);
                C.Show();
                simpleButton1.Enabled = false;
                dataGridView2.Rows.Clear();
                dataGridView2.Refresh();
                //this.Hide();
            }
        }
Exemplo n.º 8
0
        private void simpleButton1_Click(object sender, EventArgs e)
        {
            List <int> f = new List <int>();

            foreach (Film p in OneFilm.Buy)
            {
                f.Add(p.FId);
            }
            JObject r = new JObject(
                new JProperty("login", Register.client.CLogin),
                new JProperty("password", Register.client.CPassword),
                new JProperty("F", new JArray(f)),
                new JProperty("Cost", JPrice)
                );

            string json = r.ToString();

            Task.Run(async() =>
            {
                response = await Main.client.PostAsJsonAsync("api/Client/Buy", json);
            }).Wait();
            if (response.IsSuccessStatusCode)
            {
                string s = "Оплата: " + Price;
                OneFilm.Buy.Clear();

                FlyoutAction action = new FlyoutAction()
                {
                    Caption = "Спасибо за покупку!", Description = s
                };
                FlyoutCommand command1 = new FlyoutCommand()
                {
                    Text = "Close", Result = DialogResult.OK
                };
                action.Commands.Add(command1);
                FlyoutProperties properties = new FlyoutProperties();
                properties.ButtonSize = new Size(100, 40);
                properties.Style      = FlyoutStyle.MessageBox;
                FlyoutDialog.Show(M, action, properties);
                this.Close();
            }
            else
            {
                FlyoutAction action = new FlyoutAction()
                {
                    Caption = response.StatusCode.ToString()
                };
                FlyoutCommand command1 = new FlyoutCommand()
                {
                    Text = "Close", Result = DialogResult.OK
                };
                action.Commands.Add(command1);
                FlyoutProperties properties = new FlyoutProperties();
                properties.ButtonSize = new Size(100, 40);
                properties.Style      = FlyoutStyle.MessageBox;
                FlyoutDialog.Show(M, action, properties);
            }
        }
Exemplo n.º 9
0
        private void MainForm_FormClosing(object sender, FormClosingEventArgs e)
        {
            DevExpress.XtraBars.Docking2010.Views.WindowsUI.FlyoutAction action = new DevExpress.XtraBars.Docking2010.Views.WindowsUI.FlyoutAction()
            {
                Caption = "友情提示", Description = "是否关闭此应用程序?"
            };
            Predicate <DialogResult> predicate = canCloseFunc;

            DevExpress.XtraBars.Docking2010.Views.WindowsUI.FlyoutCommand command1 = new DevExpress.XtraBars.Docking2010.Views.WindowsUI.FlyoutCommand()
            {
                Text = "关闭", Result = System.Windows.Forms.DialogResult.Yes
            };
            DevExpress.XtraBars.Docking2010.Views.WindowsUI.FlyoutCommand command2 = new DevExpress.XtraBars.Docking2010.Views.WindowsUI.FlyoutCommand()
            {
                Text = "取消", Result = System.Windows.Forms.DialogResult.No
            };
            DevExpress.XtraBars.Docking2010.Views.WindowsUI.FlyoutCommand command3 = new DevExpress.XtraBars.Docking2010.Views.WindowsUI.FlyoutCommand()
            {
                Text = "重启", Result = System.Windows.Forms.DialogResult.Retry
            };
            DevExpress.XtraBars.Docking2010.Views.WindowsUI.FlyoutCommand command4 = new DevExpress.XtraBars.Docking2010.Views.WindowsUI.FlyoutCommand()
            {
                Text = "切换用户", Result = System.Windows.Forms.DialogResult.Ignore
            };
            action.Commands.Add(command1);
            action.Commands.Add(command2);
            action.Commands.Add(command3);
            action.Commands.Add(command4);
            FlyoutProperties properties = new FlyoutProperties();

            properties.ButtonSize = new Size(100, 40);
            properties.Style      = FlyoutStyle.MessageBox;
            properties.Appearance.TextOptions.HAlignment = DevExpress.Utils.HorzAlignment.Center;
            DialogResult result = FlyoutDialog.Show(this, action, properties, predicate);

            if (result == System.Windows.Forms.DialogResult.Yes)
            {
                this.close = true;
                e.Cancel   = false;
            }
            else if (result == System.Windows.Forms.DialogResult.Retry)
            {
                System.Diagnostics.Process.Start(System.Reflection.Assembly.GetExecutingAssembly().Location, "restart");
                System.Environment.Exit(0);
                //this.restart = true;
                //e.Cancel = false;
            }
            else if (result == System.Windows.Forms.DialogResult.Ignore)
            {
                this.changeuser = true;
                e.Cancel        = false;
            }
            else
            {
                e.Cancel = true;
            }
        }
Exemplo n.º 10
0
        private void wbntDichvu_ButtonClick(object sender, DevExpress.XtraBars.Docking2010.ButtonEventArgs e)
        {
            switch (e.Button.Properties.Tag.ToString())
            {
            case "Thêm nhân viên":
                //Nếu không có loại KH, thông báo cần tạo loại phòng trước

                //if (LoaiKhachHangBUS.LayTatCaLoaiKhachHang_List().Count == 0)
                //{
                //    XtraMessageBox.Show("Cần phải thêm loại khách hàng trước!", "Thông báo", MessageBoxButtons.OK, MessageBoxIcon.Information);
                //    return;
                //}

                themNhanVien1.Initialize();
                this.NhanVienPagecontrol.SelectedPage = PageThemnhanvien;
                break;

            case "Sửa nhân viên":
                //suaKhachHang3.RefreshDataBinding((int)khachHang.Rows[gridView1.GetFocusedDataSourceRowIndex()]["MaKH"]);
                suaNhanVien1.RefreshDataBinding((int)nhanVien.Rows[gridView1.GetFocusedDataSourceRowIndex()]["MaNhanVien"]);

                this.NhanVienPagecontrol.SelectedPage = PageSuanhanvien;
                break;

            case "Bộ Lọc":
                DevExpress.XtraBars.Docking2010.Views.WindowsUI.FlyoutAction action = new DevExpress.XtraBars.Docking2010.Views.WindowsUI.FlyoutAction()
                {
                    Caption = "BỘ LỌC", Description = "Close the application?"
                };
                DevExpress.XtraBars.Docking2010.Views.WindowsUI.FlyoutCommand command1 = new DevExpress.XtraBars.Docking2010.Views.WindowsUI.FlyoutCommand()
                {
                    Text = "Lọc", Result = System.Windows.Forms.DialogResult.Yes
                };
                DevExpress.XtraBars.Docking2010.Views.WindowsUI.FlyoutCommand command2 = new DevExpress.XtraBars.Docking2010.Views.WindowsUI.FlyoutCommand()
                {
                    Text = "Hủy", Result = System.Windows.Forms.DialogResult.No
                };
                action.Commands.Add(command1);
                action.Commands.Add(command2);
                FlyoutProperties properties = new FlyoutProperties();
                properties.ButtonSize = new Size(160, 50);
                properties.Style      = FlyoutStyle.MessageBox;

                filterDialog = new FilterControlDialog(gridControl1, gridView1.ActiveFilterString.ToString());

                if (DevExpress.XtraBars.Docking2010.Customization.FlyoutDialog.Show(this.FindForm(), filterDialog, action, properties) == DialogResult.Yes)
                {
                    if (filterDialog.GetFilterString() == "")
                    {
                        return;
                    }

                    gridView1.ActiveFilterString = strFilterDialog = filterDialog.GetFilterString();
                }
                break;
            }
        }
Exemplo n.º 11
0
        public DialogResult ShowFlyoutDialog(FlyoutStyle style = FlyoutStyle.MessageBox)
        {
            FlyoutProperties properties = new FlyoutProperties()
            {
                Style = style
            };

            return(FlyoutDialog.Show(null, this, properties));
        }
Exemplo n.º 12
0
        private void windowsUIButtonPanel1_ButtonClick(object sender, DevExpress.XtraBars.Docking2010.ButtonEventArgs e)
        {
            switch (e.Button.Properties.Tag.ToString())
            {
            case "Đặt Phòng":
                DevExpress.XtraBars.Docking2010.Customization.FlyoutDialog.Show(this.FindForm(), new folderTinhTrangPhong.DatPhong(OnDatPhongSuccess));

                break;

            case "Chi Tiết Đặt Phòng":

                (this.ParentForm as MainForm).HienThiThongTinDatPhong((int)dtDatPhong.Rows[gridViewDatPhong.GetFocusedDataSourceRowIndex()]["MaDatPhong"]);

                break;

            case "Hiển Thị Dạng Biểu Đồ":
                navigationFrame1.SelectedPage = navigationPage1;
                break;

            case "Bộ Lọc":
                DevExpress.XtraBars.Docking2010.Views.WindowsUI.FlyoutAction action = new DevExpress.XtraBars.Docking2010.Views.WindowsUI.FlyoutAction()
                {
                    Caption = "BỘ LỌC", Description = "Close the application?"
                };
                DevExpress.XtraBars.Docking2010.Views.WindowsUI.FlyoutCommand command1 = new DevExpress.XtraBars.Docking2010.Views.WindowsUI.FlyoutCommand()
                {
                    Text = "Lọc", Result = System.Windows.Forms.DialogResult.Yes
                };
                DevExpress.XtraBars.Docking2010.Views.WindowsUI.FlyoutCommand command2 = new DevExpress.XtraBars.Docking2010.Views.WindowsUI.FlyoutCommand()
                {
                    Text = "Hủy", Result = System.Windows.Forms.DialogResult.No
                };
                action.Commands.Add(command1);
                action.Commands.Add(command2);
                FlyoutProperties properties = new FlyoutProperties();
                properties.ButtonSize = new Size(160, 50);
                properties.Style      = FlyoutStyle.MessageBox;

                filterDialog = new FilterControlDialog(gridControl1, gridViewDatPhong.ActiveFilterString.ToString());

                if (DevExpress.XtraBars.Docking2010.Customization.FlyoutDialog.Show(this.FindForm(), filterDialog, action, properties) == DialogResult.Yes)
                {
                    if (filterDialog.GetFilterString() == "")
                    {
                        return;
                    }

                    gridViewDatPhong.ActiveFilterString = strFilterDialog = filterDialog.GetFilterString();
                }

                break;
            }
        }
Exemplo n.º 13
0
        private void wbntHoadon_ButtonClick(object sender, DevExpress.XtraBars.Docking2010.ButtonEventArgs e)
        {
            switch (e.Button.Properties.Tag.ToString())
            {
            case "Xem Hóa Đơn":
                DevExpress.XtraSplashScreen.SplashScreenManager.ShowForm(typeof(WaitForm1));
                if (dtHoaDon.Rows[gridViewHoaDon.GetFocusedDataSourceRowIndex()]["TongTienThanhToan"].ToString() != "")
                {
                    thanhToan1.RefreshDataBinding_ReadOnly(HoaDonBUS.LayThongTinHoaDon((int)dtHoaDon.Rows[gridViewHoaDon.GetFocusedDataSourceRowIndex()]["MaHoaDon"]));
                }
                else
                {
                    thanhToan1.RefreshDataBinding(HoaDonBUS.LayTatCaCacThuePhong((int)dtHoaDon.Rows[gridViewHoaDon.GetFocusedDataSourceRowIndex()]["MaHoaDon"])[0]);
                }
                DevExpress.XtraSplashScreen.SplashScreenManager.CloseForm();
                navigationFrame1.SelectedPage = navigationPage2;
                break;

            case "Bộ Lọc":
                DevExpress.XtraBars.Docking2010.Views.WindowsUI.FlyoutAction action = new DevExpress.XtraBars.Docking2010.Views.WindowsUI.FlyoutAction()
                {
                    Caption = "BỘ LỌC", Description = "Close the application?"
                };
                DevExpress.XtraBars.Docking2010.Views.WindowsUI.FlyoutCommand command1 = new DevExpress.XtraBars.Docking2010.Views.WindowsUI.FlyoutCommand()
                {
                    Text = "Lọc", Result = System.Windows.Forms.DialogResult.Yes
                };
                DevExpress.XtraBars.Docking2010.Views.WindowsUI.FlyoutCommand command2 = new DevExpress.XtraBars.Docking2010.Views.WindowsUI.FlyoutCommand()
                {
                    Text = "Hủy", Result = System.Windows.Forms.DialogResult.No
                };
                action.Commands.Add(command1);
                action.Commands.Add(command2);
                FlyoutProperties properties = new FlyoutProperties();
                properties.ButtonSize = new Size(160, 50);
                properties.Style      = FlyoutStyle.MessageBox;

                filterDialog = new FilterControlDialog(GridControlHoaDon, gridViewHoaDon.ActiveFilterString.ToString());

                if (DevExpress.XtraBars.Docking2010.Customization.FlyoutDialog.Show(this.FindForm(), filterDialog, action, properties) == DialogResult.Yes)
                {
                    if (filterDialog.GetFilterString() == "")
                    {
                        return;
                    }

                    gridViewHoaDon.ActiveFilterString = strFilterDialog = filterDialog.GetFilterString();
                }
                break;
            }
        }
Exemplo n.º 14
0
        private void simpleButton2_Click(object sender, EventArgs e)
        {
            Client tmp = new Client();
            HttpResponseMessage response = new HttpResponseMessage();

            tmp.CLogin    = textBox1.Text;
            tmp.CPassword = textBox2.Text;
            Task.Run(async() =>
            {
                response = await Main.client.PostAsJsonAsync <Client>("api/Client/Register", tmp);
            }).Wait();

            if (!response.IsSuccessStatusCode)
            {
                FlyoutAction action = new FlyoutAction()
                {
                    Caption = "Пользователь уже существует "
                };
                FlyoutCommand command1 = new FlyoutCommand()
                {
                    Text = "Close", Result = DialogResult.OK
                };
                action.Commands.Add(command1);
                FlyoutProperties properties = new FlyoutProperties();
                properties.ButtonSize = new Size(100, 40);
                properties.Style      = FlyoutStyle.MessageBox;
                FlyoutDialog.Show(M, action, properties);
            }
            else
            if (response.IsSuccessStatusCode)
            {
                FlyoutAction action = new FlyoutAction()
                {
                    Caption = "Пользователь успешно создан! "
                };
                FlyoutCommand command1 = new FlyoutCommand()
                {
                    Text = "Close", Result = DialogResult.OK
                };
                action.Commands.Add(command1);
                FlyoutProperties properties = new FlyoutProperties();
                properties.ButtonSize = new Size(100, 40);
                properties.Style      = FlyoutStyle.MessageBox;
                FlyoutDialog.Show(M, action, properties);
                OneFilm.Buy.Clear();
                client = tmp;
                this.Close();
            }
        }
Exemplo n.º 15
0
 private void mainForm_FormClosing(object sender, FormClosingEventArgs e)
 {
     var action = new FlyoutAction { Caption = "Confirm", Description = "Close the application?" };
     Predicate<DialogResult> predicate = canCloseFunc;
     var command1 = new FlyoutCommand { Text = "Close", Result = DialogResult.Yes };
     var command2 = new FlyoutCommand { Text = "Cancel", Result = DialogResult.No };
     action.Commands.Add(command1);
     action.Commands.Add(command2);
     var properties = new FlyoutProperties
     {
         Style = FlyoutStyle.MessageBox,
         Alignment = ContentAlignment.MiddleCenter
     };
     e.Cancel = FlyoutDialog.Show(this, action, properties, predicate) != DialogResult.Yes;
 }
Exemplo n.º 16
0
        private void Alert()
        {
            try
            {
                FlyoutAction action = new FlyoutAction()
                {
                    Caption     = "คำเตือน!",
                    Description = "คุณระบุชื่อผู้ใช้งาน (username) หรือรหัสผ่าน (password) ไม่ถูกต้อง"
                };

                Predicate <DialogResult> predicate = SQLData.CloseFunc;

                FlyoutCommand command1 = new FlyoutCommand()
                {
                    Text   = "OK",
                    Result = DialogResult.OK
                };

                action.Commands.Add(command1);

                FlyoutProperties properties = new FlyoutProperties
                {
                    ButtonSize = new Size(100, 40)
                };

                properties.AppearanceButtons.BackColor = Color.White;
                properties.AppearanceButtons.ForeColor = Color.Blue;
                properties.Appearance.BackColor        = Color.Orange;
                properties.Appearance.ForeColor        = Color.White;
                properties.Appearance.BorderColor      = Color.Red;
                properties.Style = FlyoutStyle.Popup;

                if (FlyoutDialog.Show(null, action, properties, predicate) == DialogResult.OK)
                {
                    return;
                }
            }
            catch (Exception ex)
            {
                XtraMessageBox.Show(ex.Message);
            }
        }
Exemplo n.º 17
0
        public void AlertAuthorized(string caption, string alert)
        {
            try
            {
                FlyoutAction action = new FlyoutAction()
                {
                    Caption     = caption,
                    Description = alert
                };

                Predicate <DialogResult> predicate = SQLData.CloseFunc;

                FlyoutCommand command1 = new FlyoutCommand()
                {
                    Text   = "OK",
                    Result = DialogResult.OK
                };

                action.Commands.Add(command1);

                FlyoutProperties properties = new FlyoutProperties
                {
                    ButtonSize = new Size(100, 40)
                };

                properties.AppearanceButtons.BackColor = Color.White;
                properties.AppearanceButtons.ForeColor = Color.Blue;
                properties.Appearance.BackColor        = Color.DarkSeaGreen;
                properties.Appearance.ForeColor        = Color.White;
                properties.Appearance.BorderColor      = Color.Gray;
                properties.Style = FlyoutStyle.Popup;

                if (FlyoutDialog.Show(null, action, properties, predicate) == DialogResult.OK)
                {
                    return;
                }
            }
            catch (Exception ex)
            {
                XtraMessageBox.Show(ex.Message);
            }
        }
Exemplo n.º 18
0
        private void Close_Form()
        {
            try
            {
                FlyoutAction action = new FlyoutAction()
                {
                    Caption = "ยืนยัน", Description = "คุณต้องการปิดโปรแกรม ใช่หรือไม่?"
                };
                Predicate <DialogResult> predicate = SQLData.CloseFunc;
                FlyoutCommand            command1  = new FlyoutCommand()
                {
                    Text = "ใช่", Result = DialogResult.Yes
                };
                FlyoutCommand command2 = new FlyoutCommand()
                {
                    Text = "ไม่ใช่", Result = DialogResult.No
                };
                action.Commands.Add(command1);
                action.Commands.Add(command2);
                FlyoutProperties properties = new FlyoutProperties
                {
                    ButtonSize = new Size(100, 40),
                    // properties.Appearance.BackColor = Color.WhiteSmoke
                    Style = FlyoutStyle.Popup
                };

                if (FlyoutDialog.Show(null, action, properties, predicate) == DialogResult.Yes)
                {
                    Application.ExitThread();
                    Close();
                    //System.Environment.Exit(0);
                }
                else
                {
                    return;
                }
            }
            catch (Exception ex)
            {
                XtraMessageBox.Show(ex.Message);
            }
        }
Exemplo n.º 19
0
        private void simpleButton1_Click(object sender, EventArgs e)
        {
            Buy.Add(fiilm);
            FlyoutAction action = new FlyoutAction()
            {
                Caption = "Добавлено"
            };
            FlyoutCommand command1 = new FlyoutCommand()
            {
                Text = "Close", Result = DialogResult.OK
            };

            action.Commands.Add(command1);
            FlyoutProperties properties = new FlyoutProperties();

            properties.ButtonSize = new Size(100, 40);
            properties.Style      = FlyoutStyle.MessageBox;
            FlyoutDialog.Show(this, action, properties);
            simpleButton1.Enabled = false;
        }
Exemplo n.º 20
0
        public void ShowConnectionError()
        {
            FlyoutAction action = new FlyoutAction()
            {
                Caption = "Connection Error!", Description = "The connection to the server failed. Please ensure you are connected to the network and try again."
            };

            FlyoutCommand command1 = new FlyoutCommand()
            {
                Text = "OK", Result = System.Windows.Forms.DialogResult.Yes
            };

            action.Commands.Add(command1);

            FlyoutProperties properties = new FlyoutProperties();

            properties.ButtonSize           = new Size(100, 40);
            properties.Style                = FlyoutStyle.MessageBox;
            properties.Appearance.BackColor = Color.Red;
            properties.Appearance.ForeColor = Color.White;
            DevExpress.XtraBars.Docking2010.Customization.FlyoutDialog.Show(this, action, properties);
        }
Exemplo n.º 21
0
        public void ShowErrorMessage(string message)
        {
            FlyoutAction action = new FlyoutAction()
            {
                Caption = "Loan Guarantor!", Description = message
            };

            FlyoutCommand command1 = new FlyoutCommand()
            {
                Text = "Error Processing?", Result = System.Windows.Forms.DialogResult.Yes
            };

            action.Commands.Add(command1);

            FlyoutProperties properties = new FlyoutProperties();

            properties.ButtonSize           = new Size(100, 40);
            properties.Style                = FlyoutStyle.MessageBox;
            properties.Appearance.BackColor = Color.Red;
            properties.Appearance.ForeColor = Color.White;
            DevExpress.XtraBars.Docking2010.Customization.FlyoutDialog.Show(this, action, properties);
        }
Exemplo n.º 22
0
        public void ShowError()
        {
            FlyoutAction action = new FlyoutAction()
            {
                Caption = "Login Failed!", Description = "Username or password are incorrect. Please check the details and try again."
            };

            FlyoutCommand command1 = new FlyoutCommand()
            {
                Text = "OK", Result = System.Windows.Forms.DialogResult.Yes
            };

            action.Commands.Add(command1);

            FlyoutProperties properties = new FlyoutProperties();

            properties.ButtonSize           = new Size(100, 40);
            properties.Style                = FlyoutStyle.MessageBox;
            properties.Appearance.BackColor = Color.Red;
            properties.Appearance.ForeColor = Color.White;
            DevExpress.XtraBars.Docking2010.Customization.FlyoutDialog.Show(this, action, properties);
        }
Exemplo n.º 23
0
        private void BtnChart_Click(object sender, EventArgs e)
        {
            try
            {
                MyUserControl02 test        = this.ActiveControl as MyUserControl02;
                GridControl     testControl = test.ActiveControl as GridControl;
                GridView        testView    = testControl.MainView as GridView;
                //MessageBox.Show(testView.FocusedRowHandle.ToString());
                //this.gridControl1.DataSource = new MyDatabaseConnect01().connection8(test.eqpNumber, "");
                //DataRow drFocusedRow = testView.GetDataRow(testView.FocusedRowHandle);

                if (testView.SelectedRowsCount <= 0)
                {
                    return;
                }

                FlyoutProperties properties = new FlyoutProperties();
                properties.ButtonSize = new Size(100, 10);
                properties.Style      = FlyoutStyle.Popup;
                FlyoutDialog.Show(this.FindForm(), "", new MyDialog01(test.eqpId, testView.GetRowCellValue(testView.FocusedRowHandle, "PROCESS_SEQ").ToString(), testView.GetRowCellValue(testView.FocusedRowHandle, "PROD_ORDER_NUMBER").ToString()), properties, 0, 0);

                //dialog.Width = 1300;
                //dialog.Height = 350;


                //if (groupControl1.Visible == true) this.groupControl1.Visible = false;
                //else if(groupControl1.Visible == false) this.groupControl1.Visible = true;
                //MyUserControl02 test = this.ActiveControl as MyUserControl02;
                ////GridControl testControl = test.ActiveControl as GridControl;
                ////GridView testView = testControl.MainView as GridView;
                ////MessageBox.Show(testView.FocusedRowHandle.ToString());
                //this.gridControl1.DataSource = new MyDatabaseConnect01().connection8(test.eqpNumber,"");
            }
            catch (Exception ex)
            {
                MessageBox.Show(ex.Message);
            }
        }
Exemplo n.º 24
0
        private void mainForm_FormClosing(object sender, FormClosingEventArgs e)
        {
            var action = new FlyoutAction {
                Caption = "Confirm", Description = "Close the application?"
            };
            Predicate <DialogResult> predicate = canCloseFunc;
            var command1 = new FlyoutCommand {
                Text = "Close", Result = DialogResult.Yes
            };
            var command2 = new FlyoutCommand {
                Text = "Cancel", Result = DialogResult.No
            };

            action.Commands.Add(command1);
            action.Commands.Add(command2);
            var properties = new FlyoutProperties
            {
                Style     = FlyoutStyle.MessageBox,
                Alignment = ContentAlignment.MiddleCenter
            };

            e.Cancel = FlyoutDialog.Show(this, action, properties, predicate) != DialogResult.Yes;
        }
Exemplo n.º 25
0
        /// <summary>
        ///     Confirmation Dialog
        /// </summary>
        /// <param name="container"></param>
        public KZFlyoutDialog(IUnityContainer container)
        {
            KZHelper = container.Resolve<IKZHelper>();

            action = new FlyoutAction();
            CommandYes = new FlyoutCommand {Text = Resource.translate.OK, Result = DialogResult.Yes};
            CommandNo = new FlyoutCommand {Text = Resource.translate.No, Result = DialogResult.No};
            action.Commands.Add(CommandYes);
            action.Commands.Add(CommandNo);


            properties = new FlyoutProperties();
            //properties.Appearance.BackColor = Color.Blue;
            //properties.Appearance.Options.UseBackColor = true;

            KZHelper.KZAppearanceSetter.SetAppearance(properties.Appearance, KZHelper.KZFonts.ContentFont);
            KZHelper.KZAppearanceSetter.SetAppearance(properties.AppearanceCaption, KZHelper.KZFonts.HeaderFont);
            KZHelper.KZAppearanceSetter.SetAppearance(properties.AppearanceButtons, KZHelper.KZFonts.ButtonFont);
            KZHelper.KZAppearanceSetter.SetAppearance(properties.AppearanceDescription, KZHelper.KZFonts.ContentFont);


            properties.ButtonSize = new Size(150, 40);
            properties.Style = FlyoutStyle.MessageBox;
        }
Exemplo n.º 26
0
        private void simpleButton1_Click(object sender, EventArgs e)
        {
            Client client = new Client();

            client.CLogin      = textBox1.Text;
            client.CPassword   = textBox2.Text;
            client.CFio        = textBox3.Text;
            client.CCardNumber = textBox4.Text;
            client.CCvv        = Convert.ToInt32(textBox5.Text);
            client.CDate       = textBox6.Text;
            client.CId         = client1.CId;

            Task.Run(async() =>
            {
                response = await Main.client.PutAsJsonAsync("api/Client/Chandge", client);
            }).Wait();
            if (response.IsSuccessStatusCode)
            {
                Register.client = client;
                FlyoutAction action = new FlyoutAction()
                {
                    Caption = "Информация изменена!"
                };
                FlyoutCommand command1 = new FlyoutCommand()
                {
                    Text = "Close", Result = DialogResult.OK
                };
                action.Commands.Add(command1);
                FlyoutProperties properties = new FlyoutProperties();
                properties.ButtonSize = new Size(100, 40);
                properties.Style      = FlyoutStyle.MessageBox;
                FlyoutDialog.Show(this, action, properties);
                textBox1.Text = client.CLogin;
                textBox2.Text = client.CPassword;
                if (client.CFio != null)
                {
                    textBox3.Text = client.CFio;
                }
                if (client.CCardNumber != null)
                {
                    textBox4.Text = client.CCardNumber;
                }
                if (client.CCvv != null)
                {
                    textBox5.Text = client.CCvv.ToString();
                }
                if (client.CDate != null)
                {
                    textBox6.Text = client.CDate;
                }
            }
            else
            {
                Register.client = client;
                FlyoutAction action = new FlyoutAction()
                {
                    Caption = "Ошибка!", Description = "Проверьте введенные данные"
                };
                FlyoutCommand command1 = new FlyoutCommand()
                {
                    Text = "Close", Result = DialogResult.OK
                };
                action.Commands.Add(command1);
                FlyoutProperties properties = new FlyoutProperties();
                properties.ButtonSize = new Size(100, 40);
                properties.Style      = FlyoutStyle.MessageBox;
                FlyoutDialog.Show(this, action, properties);
            }
        }
Exemplo n.º 27
0
        private void wbntDichvu_ButtonClick(object sender, DevExpress.XtraBars.Docking2010.ButtonEventArgs e)
        {
            switch (e.Button.Properties.Tag.ToString())
            {
            case "Thêm Dịch Vụ":


                //Nếu không có loại dv, thông báo cần tạo loại phòng trước
                if (LoaiDichVuBUS.LayTatCaLoaiDichVu_List().Count == 0)
                {
                    XtraMessageBox.Show("Cần phải thêm loại dịch vụ trước!", "Thông báo", MessageBoxButtons.OK, MessageBoxIcon.Information);
                    return;
                }

                themDichVu1.Initialize();
                this.DichVuPagecontrol.SelectedPage = PageThemdichvu;
                break;

            case "Sửa Dịch Vụ":
                suaDichVu1.RefreshDataBinding((int)dichVu.Rows[gridView1.GetFocusedDataSourceRowIndex()]["MaDV"]);
                this.DichVuPagecontrol.SelectedPage = PageSuadichvu;
                break;

            case "Quản Lý Loại Dịch Vụ":
                goToQuanLyDichVu();
                break;

            case "Bộ Lọc":
                DevExpress.XtraBars.Docking2010.Views.WindowsUI.FlyoutAction action = new DevExpress.XtraBars.Docking2010.Views.WindowsUI.FlyoutAction()
                {
                    Caption = "BỘ LỌC", Description = "Close the application?"
                };
                DevExpress.XtraBars.Docking2010.Views.WindowsUI.FlyoutCommand command1 = new DevExpress.XtraBars.Docking2010.Views.WindowsUI.FlyoutCommand()
                {
                    Text = "Lọc", Result = System.Windows.Forms.DialogResult.Yes
                };
                DevExpress.XtraBars.Docking2010.Views.WindowsUI.FlyoutCommand command2 = new DevExpress.XtraBars.Docking2010.Views.WindowsUI.FlyoutCommand()
                {
                    Text = "Hủy", Result = System.Windows.Forms.DialogResult.No
                };
                action.Commands.Add(command1);
                action.Commands.Add(command2);
                FlyoutProperties properties = new FlyoutProperties();
                properties.ButtonSize = new Size(160, 50);
                properties.Style      = FlyoutStyle.MessageBox;

                filterDialog = new FilterControlDialog(gridControl1, gridView1.ActiveFilterString.ToString());

                if (DevExpress.XtraBars.Docking2010.Customization.FlyoutDialog.Show(this.FindForm(), filterDialog, action, properties) == DialogResult.Yes)
                {
                    if (filterDialog.GetFilterString() == "")
                    {
                        return;
                    }

                    gridView1.ActiveFilterString = strFilterDialog = filterDialog.GetFilterString();
                    tileControl2.SelectedItem    = tileFilter;
                    tileFilter.Visible           = true;
                }



                //DevExpress.XtraBars.Docking2010.Customization.FlyoutDialog.Show(this.FindForm(), new FilterControlDialog(gridControl1), properties);
                break;
            }
        }
Exemplo n.º 28
0
        private void wbntKhachhang_ButtonClick(object sender, DevExpress.XtraBars.Docking2010.ButtonEventArgs e)
        {
            switch (e.Button.Properties.Tag.ToString())
            {
            case "Thêm khách hàng":
                //Nếu không có loại KH, thông báo cần tạo loại phòng trước
                if (LoaiKhachHangBUS.LayTatCaLoaiKhachHang_List().Count == 0)
                {
                    XtraMessageBox.Show("Cần phải thêm loại khách hàng trước!", "Thông báo", MessageBoxButtons.OK, MessageBoxIcon.Information);
                    return;
                }

                themKhachHang3.Initialize();
                this.KhachhangPagecontrol.SelectedPage = PageThemkhachhang;
                break;

            case "Sửa khách hàng":
                suaKhachHang3.RefreshDataBinding((int)khachHang.Rows[gridView1.GetFocusedDataSourceRowIndex()]["MaKH"]);
                this.KhachhangPagecontrol.SelectedPage = PageSuakhachang;
                break;

            case "Bộ lọc":
                DevExpress.XtraBars.Docking2010.Views.WindowsUI.FlyoutAction action = new DevExpress.XtraBars.Docking2010.Views.WindowsUI.FlyoutAction()
                {
                    Caption = "BỘ LỌC", Description = "Close the application?"
                };
                DevExpress.XtraBars.Docking2010.Views.WindowsUI.FlyoutCommand command1 = new DevExpress.XtraBars.Docking2010.Views.WindowsUI.FlyoutCommand()
                {
                    Text = "Lọc", Result = System.Windows.Forms.DialogResult.Yes
                };
                DevExpress.XtraBars.Docking2010.Views.WindowsUI.FlyoutCommand command2 = new DevExpress.XtraBars.Docking2010.Views.WindowsUI.FlyoutCommand()
                {
                    Text = "Hủy", Result = System.Windows.Forms.DialogResult.No
                };
                action.Commands.Add(command1);
                action.Commands.Add(command2);
                FlyoutProperties properties = new FlyoutProperties();
                properties.ButtonSize = new Size(160, 50);
                properties.Style      = FlyoutStyle.MessageBox;

                filterDialog = new FilterControlDialog(gridControl1, gridView1.ActiveFilterString.ToString());

                if (DevExpress.XtraBars.Docking2010.Customization.FlyoutDialog.Show(this.FindForm(), filterDialog, action, properties) == DialogResult.Yes)
                {
                    if (filterDialog.GetFilterString() == "")
                    {
                        return;
                    }

                    gridView1.ActiveFilterString = strFilterDialog = filterDialog.GetFilterString();
                    tileControl2.SelectedItem    = tileFilter;
                    tileFilter.Visible           = true;
                }


                break;

            case "Quản lý loại khách hàng":
                goToLoaiKhachHang();
                break;
                //case "Xóa":
                //    //Thông báo xác nhận
                //    if (XtraMessageBox.Show("Bạn có chắc xóa khách hàng '" + gridView1.GetFocusedRowCellValue(colTenKH).ToString() + "' ?", "Xác nhận", MessageBoxButtons.OKCancel) == DialogResult.OK)
                //    {

                //        if (BUS.KhachHangBUS.XoaKhachHang((int)gridView1.GetFocusedRowCellValue(colMaKH)))
                //        {

                //            //Thông báo thành công/thất bại
                //            XtraMessageBox.Show("Xóa khách hàng thành công!", "Thông báo", MessageBoxButtons.OK);
                //            RefreshDataBinding();
                //        }
                //        else
                //            //Thông báo thành công/thất bại
                //            XtraMessageBox.Show("Xóa khách hàng thất bại!", "Thông báo", MessageBoxButtons.OK);
                //    }
                //    break;
            }
        }
Exemplo n.º 29
0
        public static DialogResult MostrarDialogo(Form pFormPadre,
                                                  string pEtiqueta,
                                                  string pDescripcion,
                                                  BotonesDialogo pBotones)
        {
            FlyoutAction v_accion = new FlyoutAction()
            {
                Caption     = pEtiqueta,
                Description = pDescripcion
            };

            FlyoutCommand v_comando_1;
            FlyoutCommand v_comando_2;

            switch (pBotones)

            {
            case BotonesDialogo.None:
                break;

            case BotonesDialogo.Ok:
                v_comando_1 = new FlyoutCommand()
                {
                    Text   = "Aceptar",
                    Result = DialogResult.OK
                };

                v_accion.Commands.Add(v_comando_1);

                break;

            case BotonesDialogo.YesNo:
                v_comando_1 = new FlyoutCommand()
                {
                    Text   = "Si",
                    Result = DialogResult.Yes
                };

                v_accion.Commands.Add(v_comando_1);

                v_comando_2 = new FlyoutCommand()
                {
                    Text   = "No",
                    Result = DialogResult.No
                };

                v_accion.Commands.Add(v_comando_2);
                break;

            case BotonesDialogo.OkCancel:

                v_comando_1 = new FlyoutCommand()
                {
                    Text   = "Aceptar",
                    Result = DialogResult.OK
                };

                v_accion.Commands.Add(v_comando_1);

                v_comando_2 = new FlyoutCommand()
                {
                    Text   = "Cancelar",
                    Result = DialogResult.Cancel
                };

                v_accion.Commands.Add(v_comando_1);
                break;

            default:

                break;
            }

            FlyoutProperties v_propiedades = new FlyoutProperties()
            {
                ButtonSize = new Size(100, 40),
                Style      = FlyoutStyle.MessageBox
            };

            Predicate <DialogResult> v_predicado = canCloseFunc;

            return(FlyoutDialog.Show(pFormPadre, v_accion, v_propiedades, v_predicado));
        }