| 123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143 |
- using System;
- using System.Collections.Generic;
- using System.ComponentModel;
- using System.Data;
- using System.Drawing;
- using System.Globalization;
- using System.Linq;
- using System.Text;
- using System.Windows.Forms;
- using Core.Mes.Client.Comm.Tool;
- using Core.StlMes.Client.Mcp.Control.Entity;
- using CoreFS.CA06;
- namespace Core.StlMes.Client.Mcp.Mch.MchResult
- {
- public partial class MesureDataPerWt : FrmBase
- {
- private PlnZyJgxCEntity _jgxPlan = null;
- public MesureDataPerWt(OpeBase _ob,PlnZyJgxCEntity _plnZyJgxCEntity)
- {
- InitializeComponent();
- _jgxPlan = _plnZyJgxCEntity;
- this.ob = _ob;
- uteW_TextChanged(null, null);
- }
- private void ubtOK_Click(object sender, EventArgs e)
- {
- double PerWt = 0;
- double em = 0;
- if (rb1.Checked)
- {
- if (string.IsNullOrWhiteSpace(uteW.Text))
- {
- MessageBox.Show("请输入公式");
- return;
- }
- try
- {
- var dt = new DataTable();
- PerWt =
- Math.Round(
- double.Parse(
- dt.Compute(
- uteW.Text.Replace("外径", _jgxPlan.Outdiameter.ToString3())
- .Replace("壁厚", _jgxPlan.Wallthick.ToString3()), null).ToString()),
- (int) utnX.Value);
- }
- catch (Exception)
- {
- MessageBox.Show("公式异常");
- return;
- }
- }
- else if (rb2.Checked)
- {
- try
- {
- PerWt = double.Parse(uneValue.Value.ToString());
- }
- catch (Exception)
- {
- MessageBox.Show("请输入正确的数字");
- return;
- }
- }
- else
- {
- MessageBox.Show("请选择单重种类!");
- return;
- }
- try
- {
- em = double.Parse(une3.Value.ToString3());
- }
- catch (Exception)
- {
- MessageBox.Show("请输入正确的数字");
- return;
- }
- var ccp = new CoreClientParam();
- ccp.ServerName = "com.steering.mes.mcp.Mch.FrmMeasureResult";
- ccp.MethodName = "Turn";
- ccp.ServerParams = new object[]
- {
- PerWt,
- em,
- _jgxPlan.JudgeStoveNo,
- _jgxPlan.BatchNo,
- _jgxPlan.PlineCode
- };
- ccp = ExecuteNonQuery(ccp, CoreInvokeType.Internal);
- if (ccp.ReturnCode != -1)
- {
- if (ccp.ReturnInfo.Equals("操作成功"))
- {
- this.DialogResult = DialogResult.OK;
- }
- else
- {
- MessageUtil.ShowTips(ccp.ReturnInfo);
- }
- }
- }
- private void rb1_CheckedChanged(object sender, EventArgs e)
- {
- uteW.ReadOnly = !rb1.Checked;
- utnX.ReadOnly = !rb1.Checked;
- lblShow.Visible = rb1.Checked;
- uneValue.ReadOnly = !rb2.Checked;
- }
- private void uteW_TextChanged(object sender, EventArgs e)
- {
- try
- {
- var dt = new DataTable();
- lblShow.Text = "当前公式计算出的单重:" +
- Math.Round(
- double.Parse(
- dt.Compute(
- uteW.Text.Replace("外径", _jgxPlan.Outdiameter.ToString3())
- .Replace("壁厚", _jgxPlan.Wallthick.ToString3()), null).ToString()),
- (int)utnX.Value);
- }
- catch (Exception)
- {
- }
- }
- }
- }
|