悟生慧

 

winfrom中的弹出询问消息框提示

if (dgvgood.Rows.Count > 0)
                {
                    switch (MessageBox.Show("单据已经修改,要保存吗?", "询问", MessageBoxButtons.YesNoCancel, MessageBoxIcon.Question, MessageBoxDefaultButton.Button2))
                    {
                        case DialogResult.Cancel:
                            break;
                        case DialogResult.Yes:
                            {
                                //if (string.IsNullOrEmpty(cbperson.Text))
                                //{
                                //    MessageShow.ShowMessage("提示", "请填写经办人");
                                //    return;
                                //}
                                if (string.IsNullOrEmpty(cbwarehouse.Text))
                                {
                                    MessageShow.ShowMessage("提示", "请先选择仓库");
                                    return;
                                }
                                if (string.IsNullOrEmpty(cbsupplier.Text))
                                {
                                    MessageShow.ShowMessage("提示", "请先选择供货商");
                                    return;
                                }

                                tspconfirm_Click(null, null);
                                this.Close();


                            }
                            break;
                        case DialogResult.No:
                            {
                                FrmGoodsBLL.al_InGoods.Clear();
                                DataBind();
                                this.Close();
                            }
                            break;

                    }
                }
                else
                {
                    this.Close();
                }

posted on 2011-06-23 10:50  悟生慧  阅读(2790)  评论(0编辑  收藏  举报

导航