当前位置: 首页>>代码示例>>C#>>正文


C# CustomMessageBox.ShowDialog方法代码示例

本文整理汇总了C#中CustomMessageBox.ShowDialog方法的典型用法代码示例。如果您正苦于以下问题:C# CustomMessageBox.ShowDialog方法的具体用法?C# CustomMessageBox.ShowDialog怎么用?C# CustomMessageBox.ShowDialog使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在CustomMessageBox的用法示例。


在下文中一共展示了CustomMessageBox.ShowDialog方法的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。

示例1: Show

        public static DialogResult Show(string message, string type)
        {
            msgForm = new CustomMessageBox();
            msgForm.txtMessage.Text = message;
            msgForm.ActiveControl = msgForm.btnOk;

            if (type.Equals(Constant.MSG_ERROR))
            {
                msgForm.txtMessage.ForeColor = Color.Red;
                msgForm.btnCancel.Visible = false;
            }
            else if (type.Equals(Constant.MSG_WARNING))
            {
                msgForm.txtMessage.ForeColor = Color.Black;
                msgForm.btnCancel.Visible = true;
            }
            else
            {
                msgForm.txtMessage.ForeColor = Color.Black;
                msgForm.btnOk.Visible = false;
                msgForm.btnCancel.Visible = false;
                msgForm.lblCounter.Visible = true;
                msgForm.countDownTimer.Start();
            }
            msgForm.ShowDialog();
            return result;
        }
开发者ID:royhpr,项目名称:HyperMartHQManagementTool,代码行数:27,代码来源:CustomMessageBox.cs

示例2: MainForm

        public MainForm(AppManager manager)
        {
            _flgLoading = true;
            InitializeComponent();

            _manager = manager;
            if (_manager == null)
            {
                CustomMessageBox cmb = new CustomMessageBox("The application manager has not been loaded for some reason.\nThe application can't work and will be closed.", "FATAL", MessageBoxDialogButtons.Ok, MessageBoxDialogIcon.Fatal, false, false);
                cmb.ShowDialog();
                cmb.Dispose();
                this.Close();
            }

            InitializeStyle();
            InitializeGUIEventsHandlers();

            categoriesTabs.Manager = _manager;

            SetupUI();
            _SelectedCategory = -1;
            _SelectedGame = -1;
            EnableMenus(false);
            if (_manager.AppSettings.ReloadLatestDB && (_manager.RecentDBs != null && _manager.RecentDBs.Count > 0))
                OpenRecentDatabase(_manager.RecentDBs.First().Value.DBPath, false);

            _flgLoading = false;
        }
开发者ID:midium,项目名称:DOSBoxManager,代码行数:28,代码来源:MainForm.cs

示例3: btConfirmar_Click

        private void btConfirmar_Click(object sender, RoutedEventArgs e)
        {
            if (txtQnt.Text == "")
            {
                cmb = new CustomMessageBox("Campos obrigatórios: Quantidade");
                cmb.ShowDialog();
                return;
            }
            else
            {
                try
                {
                    info.cod_prod_item = Int32.Parse(((DataRowView)dtGridProd.SelectedItem).Row[0].ToString());
                    info.vlr_ven_item = ((DataRowView)dtGridProd.SelectedItem).Row[3].ToString().Replace(",", ".");
                    info.qtd_item = Int32.Parse(txtQnt.Text);
                    info.est_item = "Em aberto";

                    DataTable dtitem = opr.selectItemCombyProd(info);
                    if (dtitem.Rows.Count > 0)
                    {
                        info.qtd_item = int.Parse(dtitem.Rows[0][2].ToString()) + info.qtd_item;
                        int row = opr.updateItemCom(info);
                        if (row != 0)
                        {
                            cmb = new CustomMessageBox("Item cadastrado com sucesso!");
                            cmb.ShowDialog();
                            this.Close();
                        }
                        else
                        {
                            cmb = new CustomMessageBox("Erro na inserção!");
                            cmb.ShowDialog();
                        }
                    }
                    else
                    {


                        int rows = opr.insertItemCom(info);
                        if (rows != 0)
                        {
                            cmb = new CustomMessageBox("Item cadastrado com sucesso!");
                            cmb.ShowDialog();
                            this.Close();
                        }
                        else
                        {
                            cmb = new CustomMessageBox("Erro na inserção!");
                            cmb.ShowDialog();
                        }
                    }
                }
                catch
                {
                    cmb = new CustomMessageBox("Erro interno do SQL.");
                    cmb.ShowDialog();
                }
            }
        }
开发者ID:hmarsolla,项目名称:SABC,代码行数:59,代码来源:AddProduto.xaml.cs

示例4: btCalcular_Click

        private void btCalcular_Click(object sender, RoutedEventArgs e)
        {
            DataTable dtitem = new DataTable();
            try 
            { 
                dtitem = opr.selectItemCombyCom(info);
                if (dtitem.Rows.Count > 0)
                {
                    double totalcom = 0;
                    for (int i = 0; i <= dtitem.Rows.Count-1; i++)
                    {
                        if (dtitem.Rows[i][4].ToString() == "Em aberto")
                        {
                            cmb = new CustomMessageBox("Existem itens em aberto na comanda. Acuse a prontidão e tente novamente.");
                            cmb.ShowDialog();
                            return;
                        }
                        double vlr = 0;
                        vlr = double.Parse(dtitem.Rows[i][2].ToString()) * double.Parse(dtitem.Rows[i][3].ToString());
                        totalcom = totalcom + vlr;
                    }
                    info.vlrPag_com = totalcom.ToString();
                }
            }
            catch
            {
                cmb = new CustomMessageBox("Erro ao calcular total.");
                cmb.ShowDialog();
                return;
            }
            try
            {
                dtitem.Clear();
                dtitem = opr.PorcFunc(info);
                if (dtitem.Rows.Count > 0)
                {
                    info.comissao_com = (double.Parse(dtitem.Rows[0][0].ToString()) / 100 * double.Parse(info.vlrPag_com)).ToString();
                }
                else
                {
                    info.comissao_com = "0";
                }
            }
            catch
            {
                cmb = new CustomMessageBox("Erro ao aplicar porcentagem de serviço.");
                cmb.ShowDialog();
                return;
            }

            info.dataPag_com = DateTime.Now;
            info.est_com = "Fechada";
            btConfirma.IsEnabled = true;
            txtComissão.Text = info.comissao_com.Replace(",", ".");
            txtTotal.Text = info.vlrPag_com.Replace(",", ".");
            btConfirma.IsEnabled = true;
            cmb = new CustomMessageBox("Cálculo feito. Pressione Confirmar.");
            cmb.ShowDialog();
        }
开发者ID:hmarsolla,项目名称:SABC,代码行数:59,代码来源:FecharCom.xaml.cs

示例5: ShowError

 public static void ShowError(string message, string caption)
 {
     var box = new CustomMessageBox();
     box.Button_OK.Visibility = Visibility.Visible;
     box.TextBlock_Message.Text = message;
     box.Title = caption;
     box.ShowDialog();
 }
开发者ID:Tesserex,项目名称:C--MegaMan-Engine,代码行数:8,代码来源:CustomMessageBox.xaml.cs

示例6: btRemProd_Click

        private void btRemProd_Click(object sender, RoutedEventArgs e)
        {
            if (dtGriditCom.SelectedItem != null)
            {
                CustomMessageBox cmb = new CustomMessageBox("Tem certeza que deseja excluir ? ", "Atenção", "YesNo");
                cmb.ShowDialog();
                if (cmb.DialogResult.HasValue && cmb.DialogResult.Value)
                {
                    try
                    {
                        int ID = Int32.Parse(((DataRowView)dtGriditCom.SelectedItem).Row[0].ToString());
                        int ID2 = Int32.Parse(((DataRowView)dtGriditCom.SelectedItem).Row[5].ToString());

                        info.cod_com_item = ID;
                        info.cod_prod_item = ID2;
                        if (ID.ToString() == "" && ID2.ToString()=="")
                        {
                            cmb = new CustomMessageBox("Selecione um item para excluir.");
                            cmb.ShowDialog();
                        }
                        else
                        {

                            int rows = opr.deleteItemCom(info);
                            if (rows != 0)
                            {
                                cmb = new CustomMessageBox("Item excluído com sucesso!");
                                cmb.ShowDialog();
                                dtGriditCom.DataContext = opr.selectItemCombyCom(info);
                            }
                            else
                            {
                                cmb = new CustomMessageBox("Erro na operação");
                                cmb.ShowDialog();
                            }
                        }
                    }
                    catch
                    {
                        cmb = new CustomMessageBox("Erro interno no SQL.");
                        cmb.ShowDialog();
                    }
                }
                else
                {
                    return;
                }
            }
            else
            {
                cmb = new CustomMessageBox("Não há itens para excluir.");
                cmb.ShowDialog();
                return;
            }
}
开发者ID:hmarsolla,项目名称:SABC,代码行数:55,代码来源:CadComanda.xaml.cs

示例7: btProcurar_Click

 private void btProcurar_Click(object sender, RoutedEventArgs e)
 {
     if (txtPesquisa.Text == "")
     {
         return;
     }
     
     switch (cbCamp.SelectedIndex)   
     {
         case 0:
             double num;
             if (double.TryParse(txtPesquisa.Text, out num))
             {
                 info.cod_com= Int32.Parse(txtPesquisa.Text);
                 dGrid.DataContext = opr.selectCombyId(info);
                 break;
             }
             else
             {
                 cmb = new CustomMessageBox("Insira apenas números!");
                 cmb.ShowDialog();
                 break;
             }
             
        case 1:
             DateTime dt;
             if (DateTime.TryParse(txtPesquisa.Text, out dt))
             {
                 dGrid.DataContext = opr.selectCombyDia(DateTime.Parse(txtPesquisa.Text));
                 break;
             }
             else
             {
                 cmb = new CustomMessageBox("Insira data no formato: dd/mm/yyyy");
                 cmb.ShowDialog();
                 break;
             }
         case 3:
             double valor;
             if (double.TryParse(txtPesquisa.Text, out valor))
             {
                 info.vlrPag_com = txtPesquisa.Text.Replace(",", ".") ;
                 dGrid.DataContext = opr.selectCombyValor(info);
                 break;
             }
             else
             {
                 cmb = new CustomMessageBox("Insira apenas números!");
                 cmb.ShowDialog();
                 break;
             }
         default:
             break;
     }
 }
开发者ID:hmarsolla,项目名称:SABC,代码行数:55,代码来源:Comanda.xaml.cs

示例8: ShowSavePrompt

 public static MessageBoxResult ShowSavePrompt()
 {
     var box = new CustomMessageBox();
     box.Button_Yes.Visibility = Visibility.Visible;
     box.Button_No.Visibility = Visibility.Visible;
     box.Button_Cancel.Visibility = Visibility.Visible;
     box.TextBlock_Message.Text = "Do you wish to save your changes?";
     box.Title = "Save Changes?";
     box.ShowDialog();
     return box.result;
 }
开发者ID:Tesserex,项目名称:C--MegaMan-Engine,代码行数:11,代码来源:CustomMessageBox.xaml.cs

示例9: btLogout_Click

 private void btLogout_Click(object sender, RoutedEventArgs e)
 {
     cmb = new CustomMessageBox("Você tem certeza?", "Atenção", "YesNo");
     cmb.ShowDialog();
     if (cmb.DialogResult.HasValue && cmb.DialogResult.Value)
     {
         MainWindow log = new MainWindow();
         log.Show();
         this.Hide();
     }
    
 }
开发者ID:hmarsolla,项目名称:SABC,代码行数:12,代码来源:Menu.xaml.cs

示例10: Window_Loaded

 private void Window_Loaded(object sender, RoutedEventArgs e)
 {
     try
     {
         dGrid.DataContext = opr.selectCli();
     }
     catch
     {
         cmb = new CustomMessageBox("Falha na preenchimento da grid.");
         cmb.ShowDialog();
     }
 }
开发者ID:hmarsolla,项目名称:SABC,代码行数:12,代码来源:Cliente.xaml.cs

示例11: btProcurar_Click

        private void btProcurar_Click(object sender, RoutedEventArgs e)
        {
            if (txtPesquisa.Text == "")
            {
                return;
            }
            try {
                switch (cbCamp.SelectedIndex)
                {
                    case 0:
                        double num;
                        if (double.TryParse(txtPesquisa.Text, out num))
                        {
                            info.cod_cli = Int32.Parse(txtPesquisa.Text);
                            dGrid.DataContext = opr.selectCliByID(info);
                            break;
                        }
                        else
                        {
                            cmb = new CustomMessageBox("Insira apenas números!");
                            cmb.ShowDialog();
                            break;
                        }

                    case 1:
                        info.nome_cli = txtPesquisa.Text;
                        dGrid.DataContext = opr.selectCliByNome(info);
                        break;
                    case 2:
                        DateTime dt;
                        if (DateTime.TryParse(txtPesquisa.Text, out dt))
                        {
                            info.datacad_cli = DateTime.Parse(txtPesquisa.Text);
                            dGrid.DataContext = opr.selectCliByDataCad(info);
                            break;
                        }
                        else
                        {
                            cmb = new CustomMessageBox("Insira data no formato: dd/mm/yyyy");
                            cmb.ShowDialog();
                            break;
                        }
                    default:
                        break;
                }
            }
            catch
            {
                CustomMessageBox cmd = new CustomMessageBox("Erro interno do SQL.");
                cmd.ShowDialog();
            }
        }
开发者ID:hmarsolla,项目名称:SABC,代码行数:52,代码来源:Cliente.xaml.cs

示例12: Button_Click

        private void Button_Click(object sender, RoutedEventArgs e)
        {
            this.RoomName = this.TextBox.Text;
            if(0 >= this.RoomName.Length || this.RoomName.Length > 18)
            {
                var messageBox = new CustomMessageBox("Invalid name length(max 18)");
                messageBox.ShowDialog();

            }
            else
            {
                this.Close();
            }
        }
开发者ID:ERIS-Team-TelerikAcademy,项目名称:ERIS-App,代码行数:14,代码来源:CreateRoomWindow.xaml.cs

示例13: btConfirmar_Click

        private void btConfirmar_Click(object sender, RoutedEventArgs e)
        {
            try 
	        {	        
                info.cod_log = userid;

                DataTable data = opr.selectLoginByID(info);
                if (data.Rows.Count != 0)
                {
                    info.user_log = data.Rows[0]["Usuário"].ToString();
                    info.pass_log = data.Rows[0]["Senha"].ToString();

                    if (info.pass_log == txtoldpass.Password)
                    {
                        info.pass_log = txtnewpass.Password;
                        int rows = opr.updatePassLog(info);
                        if (rows != 0)
                        {
                            cmb = new CustomMessageBox("Senha alterada com sucesso!");
                            cmb.ShowDialog();
                            this.Close();
                        }
                        else
                        {
                            cmb = new CustomMessageBox("Erro na conexão com banco de dados!");
                            cmb.ShowDialog();
                        }
                    }
                    else
                    {
                        cmb = new CustomMessageBox("Senha inválida!");
                        cmb.ShowDialog();
                        return;
                    }
                }
                else
                {
                    cmb = new CustomMessageBox("Erro na conexão com banco de dados!");
                    cmb.ShowDialog();
                    return;
                }
	        }
	        catch (Exception)
	        {
                CustomMessageBox cmd = new CustomMessageBox("Erro interno do SQL.");
                cmd.ShowDialog();
            }
            
        }
开发者ID:hmarsolla,项目名称:SABC,代码行数:49,代码来源:RedefinirSenha.xaml.cs

示例14: btConfirmar_Click

        private void btConfirmar_Click(object sender, RoutedEventArgs e)
        {
            try
            {
                if (dtGriItem.SelectedItem == null)
                {
                    return;
                }
                cmb = new CustomMessageBox("Tem certeza que deseja acusar prontidão?", "Atenção", "YesNo");
                cmb.ShowDialog();
                if (cmb.DialogResult.HasValue && cmb.DialogResult.Value)
                {
                    int ID = Int32.Parse(((DataRowView)dtGriItem.SelectedItem).Row[0].ToString());
                    int ID2 = Int32.Parse(((DataRowView)dtGriItem.SelectedItem).Row[5].ToString());
                    info.cod_com_item = ID;
                    info.cod_prod_item = ID2;

                    int rows = opr.AcusarProntidao(info);
                    if (rows != 0)
                    {
                        cmb = new CustomMessageBox("Item apontado.");
                        cmb.ShowDialog();
                        dtGriItem.DataContext = opr.selectItemCombyCom3();
                    }
                    else
                    {
                        cmb = new CustomMessageBox("Erro na operação");
                        cmb.ShowDialog();
                    }
                }
                else
                {
                    return;
                }
            }
            catch (Exception)
            {

                cmb = new CustomMessageBox("Não foi possível realizar a operação.");
                cmb.ShowDialog();
            }
        }
开发者ID:hmarsolla,项目名称:SABC,代码行数:42,代码来源:AcusarPront.xaml.cs

示例15: btConfirmar_Click

 private void btConfirmar_Click(object sender, RoutedEventArgs e)
 {
     if (dpData.SelectedDate == null)
     {
         cmb = new CustomMessageBox("Campos obrigatórios: Data");
         cmb.ShowDialog();
         return;
     }
     else
     {
         try
         {
             if (opr.selectCombyDia(dpData.SelectedDate.Value).Rows.Count == 0)
             {
                 cmb = new CustomMessageBox("Não existe comandas ou despesas para realizar o fluxo de caixa no dia escolhido.");
                 cmb.ShowDialog();
                 return;
             }
             else
             {
                 int rows = opr.insertCaixa(dpData.SelectedDate.Value);
                 if (rows != 0)
                 {
                     cmb = new CustomMessageBox("Fluxo de caixa cadastrado com sucesso!");
                     cmb.ShowDialog();
                     this.Close();
                 }
                 else
                 {
                     cmb = new CustomMessageBox("Erro na inserção!");
                     cmb.ShowDialog();
                 }
             }
         }
         catch (Exception)
         {
             cmb = new CustomMessageBox("Erro interno no SQL.");
             cmb.ShowDialog();
         }
     }
 }
开发者ID:hmarsolla,项目名称:SABC,代码行数:41,代码来源:CadCaixa.xaml.cs


注:本文中的CustomMessageBox.ShowDialog方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。