Exemplo n.º 1
0
        private void btnDelete_Click(object sender, EventArgs e)
        {
            string mPataName = cbWcfData.Text.ToString();

            if (mPataName.Length == 0)
            {
                MessageBox.Show("机种名称为空 异常");
                return;
            }
            int rtn = 0;

            if (mPataName == "默认机种")
            {
                MessageBox.Show("默认机种不能删除");
                return;
            }
            else if (MessageBox.Show("是否删除当前机种:" + mPataName, "机种删除提示", MessageBoxButtons.YesNo) == DialogResult.Yes)
            {
                if (mWDataToolClass.DeleteModel(mPataName) == 0)
                {
                    rtn = mWDataToolClass.SelectShowModel("", ref cbWcfData);
                    if (rtn != 0)
                    {
                        MessageBox.Show("切换机种失败");
                    }
                    MessageBox.Show("机种删除成功");
                    DataUpdateClick(sender, e);
                }
                else
                {
                    MessageBox.Show("机种删除失败");
                }
            }
        }