Exemplo n.º 1
0
        public FrmInputCode(ConfigurationStatus.GJDMLH pInput, ConfigurationStatus.PlayBase playInfo, bool pIsAdd, List <int> pIDList = null)
        {
            this.InitializeComponent();
            List <Control> list = new List <Control> {
                this,
                this.Nm_Random
            };

            base.ControlList       = list;
            this.PlayInfo          = playInfo;
            this.IDList            = pIDList;
            this.Nm_ID.Value       = pInput.ID;
            this.Nm_YesAfter.Value = pInput.YesAfter;
            this.Nm_NoAfter.Value  = pInput.NoAfter;
            this.Txt_Input.Text    = pInput.Value;
            CommFunc.ConvertInputText(this.Txt_Input, this.PlayInfo);
            this.Nm_ID.Enabled = pIsAdd;
            this.Text          = pIsAdd ? "添加组号" : "修改组号";
            this.Text          = this.Text + "-" + this.PlayInfo.Play;
            List <CheckBox> list2 = new List <CheckBox> {
                this.Ckb_Random,
                this.Ckb_Clear,
                this.Ckb_Ok,
                this.Ckb_Cancel
            };

            base.CheckBoxList = list2;
        }
Exemplo n.º 2
0
        private void Ckb_Ok_Click(object sender, EventArgs e)
        {
            string        pErrorHint = "";
            string        pInput     = CommFunc.ReplaceText(this.Txt_Input.Text, this.PlayInfo, true);
            List <string> list       = CommFunc.FilterNumber(pInput, this.PlayInfo.CodeCount, this.PlayInfo.Play, ref pErrorHint);

            if (pErrorHint != "")
            {
                CommFunc.PublicMessageAll(pErrorHint, true, MessageBoxIcon.Asterisk, "");
            }
            else
            {
                OutValue    = new ConfigurationStatus.GJDMLH();
                OutValue.ID = Convert.ToInt32(this.Nm_ID.Value);
                if ((this.IDList != null) && this.IDList.Contains(OutValue.ID))
                {
                    CommFunc.PublicMessageAll($"局数【{OutValue.ID}】已经存在,请重新输入!", true, MessageBoxIcon.Asterisk, "");
                }
                else
                {
                    OutValue.Value    = pInput;
                    OutValue.YesAfter = Convert.ToInt32(this.Nm_YesAfter.Value);
                    OutValue.NoAfter  = Convert.ToInt32(this.Nm_NoAfter.Value);
                    base.DialogResult = DialogResult.OK;
                }
            }
        }