Exemplo n.º 1
0
        private void button1_Click(object sender, EventArgs e)
        {
            //处理手顺
            if (this.textBox1.Text.Trim().Equals(""))
            {
                MessageBox.Show("处理手顺不能为空!");
                return;
            }
            //错误描述
            if (this.textBox2.Text.Trim().Equals(""))
            {
                MessageBox.Show("错误描述不能为空!");
                return;
            }

            IDataLayer dataLayer = (IDataLayer)Settings.Default.Context["datalayer"];

            sysguard.SysguardWS.OperationInfo operation = new sysguard.SysguardWS.OperationInfo();

            operation.errorDesp = this.textBox2.Text;

            operation.operContent = this.textBox1.Text;

            operation.inputTime = DateTime.Now;

            sysguard.SysguardWS.UserInfo user = dataLayer.User;

            operation.userId = user.userId;

            DataLayerResult result = dataLayer.AddOperationInfo(operation);

            if (result == DataLayerResult.Success)
            {
                DialogResult resultDialo = MessageBox.Show("新的手顺添加成功,是否退出?", "添加成功!", MessageBoxButtons.YesNo);
                if (resultDialo == DialogResult.Yes)
                {
                    this.DialogResult = DialogResult.OK;
                    this.Dispose();
                }
                else
                {
                    reset();
                    explainControl.Flush();
                }
            }
        }
Exemplo n.º 2
0
        private void button1_Click(object sender, EventArgs e)
        {
            //处理手顺
            if (this.textBox1.Text.Trim().Equals(""))
            {
                MessageBox.Show("处理手顺不能为空!");
                return;
            }
            //错误描述
            if (this.textBox2.Text.Trim().Equals(""))
            {
                MessageBox.Show("错误描述不能为空!");
                return;
            }
            //
            sysguard.SysguardWS.OperationInfo operationInfo = new sysguard.SysguardWS.OperationInfo();
            //
            sysguard.SysguardWS.UserInfo user = dataLayer.User;
            //
            operationInfo.operId      = explain_id;
            operationInfo.errorDesp   = this.textBox1.Text;
            operationInfo.operContent = this.textBox2.Text;
            operationInfo.userId      = user.userId;

            DataLayerResult result2 = dataLayer.ModifyOperationInfo(operationInfo);

            if (result2 == DataLayerResult.Success)
            {
                DialogResult resultDialo = MessageBox.Show("手顺修改成功,是否退出?", "修改成功", MessageBoxButtons.YesNo);
                if (resultDialo == DialogResult.Yes)
                {
                    this.DialogResult = DialogResult.OK;
                    this.Dispose();
                }
                else
                {
                    explainControl.Flush();
                    GetData();
                }
            }
        }