Пример #1
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();
            }
        }
Пример #2
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();
            }
        }
Пример #3
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();
            }
        }
Пример #4
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;
        }
Пример #5
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;
        }
Пример #6
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);
            }
        }
Пример #7
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();
            }
        }
Пример #8
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;
 }
Пример #9
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);
            }
        }
Пример #10
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);
            }
        }
Пример #11
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);
            }
        }
Пример #12
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;
        }
Пример #13
0
        void OnSaveItemClick(object sender, EventArgs e)
        {
            FlyoutAction action = new FlyoutAction()
            {
                Caption = "Save Filter As", Description = ""
            };
            FlyoutCommand command1 = new FlyoutCommand()
            {
                Text = "Save", Result = DialogResult.OK
            };
            FlyoutCommand command2 = new FlyoutCommand()
            {
                Text = "Cancel", Result = DialogResult.Cancel
            };

            action.Commands.Add(command1);
            action.Commands.Add(command2);
            using (TextEdit filterNameEdit = new TextEdit()) {
                filterNameEdit.Width = 300;
                if (FlyoutDialog.Show(view.GridControl.FindForm(), action, filterNameEdit) == System.Windows.Forms.DialogResult.OK)
                {
                    if (string.IsNullOrEmpty(filterNameEdit.Text.Trim()))
                    {
                        return;
                    }
                    GridFitlerItem fItem = filters.FirstOrDefault(it => it.FilterString == view.ActiveFilterString);
                    if (fItem == null)
                    {
                        filters.Add(new GridFitlerItem()
                        {
                            FilterString = view.ActiveFilterString, FilterName = filterNameEdit.Text
                        });
                    }
                    else
                    {
                        fItem.FilterName = filterNameEdit.Text;
                    }
                    view.LayoutChanged();
                }
            }
        }
Пример #14
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);
        }
Пример #15
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);
        }
Пример #16
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);
        }
Пример #17
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;
        }
Пример #18
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;
        }
Пример #19
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);
            }
        }
Пример #20
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));
        }