| 123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626627628629630631632633634635636637638639640641642643644645646647648649650651652653654655656657658659660661662663664665666667668669670671672673674675676677678679680681682683684685686687688689690691692693694695696697698699700701702703704705706707708709710711712713714715716717718719720721722723724725726727728729730731732733734735736737738739740741742743744745746747748749750751752753754755756757758759760761762763764765766767768769770 |
- using System;
- using System.Collections.Generic;
- using System.ComponentModel;
- using System.Data;
- using System.Drawing;
- using System.Linq;
- using System.Text;
- using System.Windows.Forms;
- using CoreFS.CA06;
- using System.Collections;
- using Infragistics.Win.UltraWinGrid;
- using Core.Mes.Client.Comm.Server;
- using Core.Mes.Client.Comm.Control;
- using Core.Mes.Client.Comm.Tool;
- using Core.StlMes.Client.PlnSaleOrd.Entity;
- namespace Core.StlMes.Client.PlnSaleOrd
- {
- public partial class frmOrderLenPln : FrmBase
- {
- private string lenNo; //长度编码
- private string lengthdiscN; //长度编码
- private SlmOrderLenEntity orderEntity = new SlmOrderLenEntity();
- public SlmOrderLenEntity OrderEntity
- {
- get { return orderEntity; }
- set { orderEntity = value; }
- }
- public string LengthdiscN
- {
- get { return lengthdiscN; }
- set { lengthdiscN = value; }
- }
- private string lenNo1; //合同长度编码
- private string lenNoN;//推荐长度编码
- public frmOrderLenPln(OpeBase ob, string _lenNo, string _LenNoN)
- {
- InitializeComponent();
- lenNo1 = _lenNo;
- lenNoN = _LenNoN;
- this.ob = ob;
- }
- public string LenNo
- {
- get { return lenNo; }
- set { lenNo = value; }
- }
- private void frmOrderLen_Load(object sender, EventArgs e)
- {
- doQuery();
- //DataTable unLoad = new DataTable();
- //unLoad.Columns.Add("Name", typeof(System.String));
- //unLoad.Rows.Add("/");
- //unLoad.Rows.Add("短尺随炉");
- //cmbShrtStove.DataSource = unLoad;
- ClsBaseInfo.SetComboItemHeight(cmbShrtStove);
- }
- /// <summary>
- /// 查询功能
- /// </summary>
- private void doQuery()
- {
- string len = "";
- if (lenNoN.Equals(""))
- {
- len = lenNo1;
- }
- else
- {
- len = lenNoN;
- }
- DataTable dt = ServerHelper.GetData("com.steering.pss.plnsaleord.order.CoreOrderLenPln.doQuery", new object[] { len }, this.ob);
- if (dt.Rows.Count > 0)
- {
- cmbLenUnit.Value = dt.Rows[0]["LEN_UNIT"].ToString();
- txtLenMin.Value = dt.Rows[0]["LEN_MIN"].ToString();
- txtLenMax.Value = dt.Rows[0]["LEN_MAX"].ToString();
- txtShrtLenRato.Value = dt.Rows[0]["SHRT_LEN_RATO"].ToString();
- txtShortest.Value = dt.Rows[0]["SHORTEST"].ToString();
- cmbShrtStove.Text = dt.Rows[0]["SHRT_STOVE"].ToString();
- txtLongLenRato.Value = dt.Rows[0]["LONG_LEN_RATO"].ToString();
- txtLongest.Value = dt.Rows[0]["LONGEST"].ToString();
- txtSiglLen.Value = dt.Rows[0]["SIGL_LEN"].ToString();
- txtAvgLenMin.Value = dt.Rows[0]["AVG_LEN_MIN"].ToString();
- txtDifrncLenMax.Value = dt.Rows[0]["ENDLEN_SPECSTD"].ToString();
- ultraNumericEditor1.Value = dt.Rows[0]["DIFRNC_LEN_MAX"].ToString();
- }
-
- }
- /// <summary>
- /// Toolbar方法。
- /// </summary>
- /// <param name="sender"></param>
- /// <param name="e"></param>
- private void ultraToolbarsManager1_ToolClick(object sender, Infragistics.Win.UltraWinToolbars.ToolClickEventArgs e)
- {
- if ("doAdd".Equals(e.Tool.Key))
- {
- if (e.Tool.Index == -1)
- {
- return;
- }
- //提交
- doAdd();
- }
- else
- {
- this.Close();
- }
- }
- /// <summary>
- /// 确认,返回当前选中行给主界面,同时该长度使用次数+1
- /// </summary>
- public void doUpdate(string lenNo3, string lenDesc)
- {
- //使用次数与创建时间更新。
- ArrayList parm = new ArrayList();
- parm.Add(lenNo3);
- CoreClientParam ccp = new CoreClientParam();
- ccp.ServerName = "com.steering.pss.plnsaleord.order.CoreOrderLenPln";
- ccp.MethodName = "doUpdate";
- ccp.ServerParams = new object[] { parm };
- ccp = this.ExecuteNonQuery(ccp, CoreInvokeType.Internal);
- if (ccp.ReturnCode == -1) return;
- lenNo = lenNo3;
- lengthdiscN = lenDesc;
- this.DialogResult = DialogResult.OK;
- this.Close();
- return;
- }
- /// <summary>
- /// 验证非空字段。
- /// </summary>
- /// <returns></returns>
- private bool ValidInput()
- {
- if (cmbLenUnit.Value == null || cmbLenUnit.Value == System.DBNull.Value)
- {
- this.cmbLenUnit.Focus();
- this.cmbLenUnit.SelectAll();
- MessageBox.Show("请选择长度单位!", "提示", MessageBoxButtons.OK, MessageBoxIcon.Warning);
- return false;
- }
- if (txtLenMin.Value == null || txtLenMin.Value == System.DBNull.Value)
- {
- MessageBox.Show("长度下限不允许为空!", "提示", MessageBoxButtons.OK, MessageBoxIcon.Warning);
- this.txtLenMin.Focus();
- this.txtLenMin.SelectAll();
- return false;
- }
- if (txtLenMax.Value == null || txtLenMax.Value == System.DBNull.Value)
- {
- MessageBox.Show("长度上限不允许为空!", "提示", MessageBoxButtons.OK, MessageBoxIcon.Warning);
- this.txtLenMax.Focus();
- this.txtLenMax.SelectAll();
- return false;
- }
- if (Convert.ToDouble(txtLenMin.Text) > Convert.ToDouble(txtLenMax.Text))
- {
- this.txtLenMin.Focus();
- this.txtLenMin.SelectAll();
- MessageBox.Show("长度下限不能大于长度上限!", "提示", MessageBoxButtons.OK, MessageBoxIcon.Warning);
- return false;
- }
- return true;
- }
- /// <summary>
- /// 提交
- /// </summary>
- public void doAdd()
- {
- DataRow dRow = dataTable1.NewRow();
- //长度下限、上限、单位为必填值;
- if (ValidInput())
- {
- //长度单位
- string lenUnit = cmbLenUnit.Value.ToString();
- //长度下限
- string lenMin = txtLenMin.Value.ToString();
- //长度上限
- string lenMax = txtLenMax.Value.ToString();
- //长度描述
- string lenDesc = lenMin + "-" + lenMax + lenUnit;
- //短尺率
- string shrtLenRato = "";
- if (txtShrtLenRato.Value != System.DBNull.Value && txtShrtLenRato.Value != null && Convert.ToDouble(txtShrtLenRato.Value) != 0)
- {
- shrtLenRato = txtShrtLenRato.Value.ToString();
- if (!string.IsNullOrEmpty(shrtLenRato))
- {
- lenDesc += ",短尺率" + txtShrtLenRato.Value.ToString() + "%";
- }
- if (txtShortest.Text.Trim() == "")
- {
- MessageUtil.ShowWarning("短尺率存在,请输入短尺最短!");
- return;
- }
- }
- //短尺最短
- string shortest = "";
- if (txtShortest.Value != System.DBNull.Value && txtShortest.Value != null && Convert.ToDouble(txtShortest.Value) != 0)
- {
- shortest = txtShortest.Value.ToString();
- if (!string.IsNullOrEmpty(shortest))
- {
- lenDesc += ",短尺最短" + txtShortest.Value.ToString() + lenUnit;
- }
- if (txtShrtLenRato.Text.Trim() == "")
- {
- MessageUtil.ShowWarning("短尺最短存在,请输入短尺率!");
- return;
- }
- if (Convert.ToDouble(shortest) > Convert.ToDouble(txtLenMin.Text))
- {
- MessageUtil.ShowWarning("短尺最短不能超过长度下限");
- return;
- }
- }
- //短尺随炉
- string shrtStove = "";
- if (cmbShrtStove.Value != null)
- {
- shrtStove = cmbShrtStove.Value.ToString().Trim();
- if (!string.IsNullOrEmpty(shrtStove))
- {
- if (shrtStove.Equals("短尺随炉"))
- {
- if ((txtShrtLenRato.Value != System.DBNull.Value && txtShrtLenRato.Value != null && Convert.ToDouble(txtShrtLenRato.Value) != 0) ||
- (ultraNumericEditor1.Value != System.DBNull.Value && ultraNumericEditor1.Value != null && Convert.ToDouble(ultraNumericEditor1.Value) != 0) ||
- (txtSiglLen.Value != System.DBNull.Value && txtSiglLen.Value != null && Convert.ToDouble(txtSiglLen.Value) != 0) ||
- (txtShortest.Value != System.DBNull.Value && txtShortest.Value != null && Convert.ToDouble(txtShortest.Value) != 0) ||
- (txtDifrncLenMax.Value != System.DBNull.Value && txtDifrncLenMax.Value != null && Convert.ToDouble(txtDifrncLenMax.Value) != 0) ||
- (txtLongLenRato.Value != System.DBNull.Value && txtLongLenRato.Value != null && Convert.ToDouble(txtLongLenRato.Value) != 0) ||
- (txtLongest.Value != System.DBNull.Value && txtLongest.Value != null && Convert.ToDouble(txtLongest.Value) != 0) ||
- (txtAvgLenMin.Value != System.DBNull.Value && txtAvgLenMin.Value != null && Convert.ToDouble(txtAvgLenMin.Value) != 0)
- )
- {
- MessageUtil.ShowWarning("您选择了'短尺随炉',除长度上下限数值外一律不能录入(短尺随炉具有排他性)!");
- txtShrtLenRato.Focus();
- txtShrtLenRato.SelectAll();
- return;
- }
- }
- lenDesc += "," + cmbShrtStove.Value.ToString();
- }
- }
- //长尺率
- string longLenRato = "";
- if (txtLongLenRato.Value != System.DBNull.Value && txtLongLenRato.Value != null && Convert.ToDouble(txtLongLenRato.Value) != 0)
- {
- longLenRato = txtLongLenRato.Value.ToString();
- if (!string.IsNullOrEmpty(longLenRato))
- {
- lenDesc += ",长尺率" + txtLongLenRato.Value.ToString() + "%";
- }
- if (txtLongest.Text.Trim() == "")
- {
- MessageUtil.ShowWarning("长尺率存在,请输入长尺最长!");
- return;
- }
- }
- //长尺最长
- string longest = "";
- if (txtLongest.Value != System.DBNull.Value && txtLongest.Value != null && Convert.ToDouble(txtLongest.Value) != 0)
- {
- longest = txtLongest.Value.ToString();
- if (!string.IsNullOrEmpty(longest))
- {
- lenDesc += ",长尺最长" + txtLongest.Value.ToString() + lenUnit;
- }
- if (txtLongLenRato.Text.Trim() == "")
- {
- MessageUtil.ShowWarning("长尺最长存在,请输入长尺率!");
- return;
- }
- if (Convert.ToDouble(longest) < Convert.ToDouble(txtLenMax.Text))
- {
- MessageUtil.ShowWarning("长尺最长不能小于长度上限");
- return;
- }
- }
- //质保书燕建鹏要求长短尺率都必须录
- //if (txtShrtLenRato.Value != System.DBNull.Value && txtShrtLenRato.Value != null && Convert.ToDouble(txtShrtLenRato.Value) != 0
- // && txtLongLenRato.Value != System.DBNull.Value && txtLongLenRato.Value != null && Convert.ToDouble(txtLongLenRato.Value) != 0
- // )
- //{
- // MessageUtil.ShowWarning("短尺率与长尺率不能同时存在!");
- // this.txtShrtLenRato.Focus();
- // this.txtShrtLenRato.SelectAll();
- // return;
- //}
- //单倍尺长
- string siglLen = "";
- if (txtSiglLen.Value != System.DBNull.Value && txtSiglLen.Value != null && Convert.ToDouble(txtSiglLen.Value) != 0)
- {
- siglLen = txtSiglLen.Value.ToString();
- if (txtDifrncLenMax.Value == null || txtDifrncLenMax.Value == System.DBNull.Value) //成品公差
- {
- MessageBox.Show("请输入成品公差!", "提示", MessageBoxButtons.OK, MessageBoxIcon.Warning);
- return;
- }
- //if (!StringUtil.IsInt(siglLen))
- //{
- // MessageUtil.ShowWarning("单倍尺长必须是整数!");
- // return;
- //}
- //一般判断整数的正则表示无法判断 11.0 11.0000这样的字符
- System.Text.RegularExpressions.Regex reg = new System.Text.RegularExpressions.Regex(@"^[1-9]\d*[.]{0,1}[0]*$");
- if (!string.IsNullOrEmpty(siglLen))
- {
- //长度下限
- if (!txtLenMin.Text.Equals(""))
- {
- string remain = (Convert.ToDecimal(txtLenMin.Text) / Convert.ToDecimal(siglLen)).ToString();
- if (!reg.IsMatch(remain))
- {
- MessageBox.Show("长度要求中,长度下限/单倍尺长必须是整数!", "提示", MessageBoxButtons.OK, MessageBoxIcon.Warning);
- return;
- }
- }
- if (!txtLenMax.Text.Equals(""))
- {
- string remain = ((Convert.ToDecimal(txtLenMax.Text) - Convert.ToDecimal(txtDifrncLenMax.Text)) / Convert.ToDecimal(siglLen)).ToString();
- if (!reg.IsMatch(remain))
- {
- MessageUtil.ShowWarning("(长度上限-成品公差)应该是单倍尺长的整数倍!");
- return;
- }
- }
- //(长度上限-成品公差-下限值)>0
- lenDesc += ",单倍尺长" + txtSiglLen.Value.ToString() + lenUnit;
- }
- }
- //平均长度大于
- string avgLenMin = "";
- if (txtAvgLenMin.Value != System.DBNull.Value && txtAvgLenMin.Value != null && Convert.ToDouble(txtAvgLenMin.Value) != 0)
- {
- avgLenMin = txtAvgLenMin.Value.ToString();
- if (!string.IsNullOrEmpty(avgLenMin))
- {
- double a = 0;
- double b = 0;
- if (txtLenMin.Text.Equals(""))
- {
- a = 0;
- }
- else
- {
- a = Convert.ToDouble(txtLenMin.Text);
- }
- if (txtLenMax.Text.Equals(""))
- {
- b = 0;
- }
- else
- {
- b = Convert.ToDouble(txtLenMax.Text);
- }
- double c = Convert.ToDouble(txtAvgLenMin.Value.ToString());
- if (c < a || c > b)
- {
- MessageUtil.ShowWarning("'平均长度大于'应该在长度下限和长度上限之间!");
- txtAvgLenMin.Focus();
- return;
- }
- lenDesc += ",平均长度大于" + txtAvgLenMin.Value.ToString() + lenUnit;
- }
- }
- //成品公差
- string difrncLenMax = "";
- if (txtDifrncLenMax.Value != System.DBNull.Value && txtDifrncLenMax.Value != null && Convert.ToDouble(txtDifrncLenMax.Value) != 0)
- {
- difrncLenMax = txtDifrncLenMax.Value.ToString();
- if (!string.IsNullOrEmpty(difrncLenMax))
- {
- lenDesc += ",成品公差" + txtDifrncLenMax.Value.ToString() + lenUnit;
- }
- }
- //最长最短差小于
- string maxmin = "";
- if (ultraNumericEditor1.Value != System.DBNull.Value && ultraNumericEditor1.Value != null && Convert.ToDouble(ultraNumericEditor1.Value) != 0)
- {
- maxmin = ultraNumericEditor1.Value.ToString();
- if (!string.IsNullOrEmpty(maxmin))
- {
- lenDesc += ",最长最短差小于" + maxmin + lenUnit;
- }
- }
- if (!lenNoN.Equals(""))
- {
- //OrderEntity.LenNo = autoLenNo;
- //OrderEntity.LenDesc = lenDesc;
- //OrderEntity.LenTyp = "自选";
- //OrderEntity.LenMin = int.Parse(lenMin);
- //OrderEntity.LenMax = int.Parse(lenMax);
- //OrderEntity.LenUnit = lenUnit;
- //OrderEntity.Longest = int.Parse(longest);
- //OrderEntity.LongLenRato = int.Parse(longLenRato);
- //OrderEntity.Shortest = int.Parse(shortest);
- //OrderEntity.ShrtLenRato = int.Parse(shrtLenRato);
- //OrderEntity.ShrtStove = shrtStove;
- //OrderEntity.SiglLen = int.Parse(siglLen);
- //OrderEntity.AvgLenMin = int.Parse(avgLenMin);
- //OrderEntity.EndlenSpecstd = int.Parse(difrncLenMax);
- //OrderEntity.DifrncLenMax = int.Parse(maxmin);
- //OrderEntity.CreateName = UserInfo.GetUserName();
- //OrderEntity.UseTime = "1";
- //将该行记录插入数据库。
- ArrayList parm = new ArrayList();
- //长度描述
- parm.Add(lenDesc);
- //长度分类
- parm.Add("轧管推荐");
- //长度单位
- parm.Add(lenUnit);
- //长度下限
- parm.Add(lenMin);
- //长度上限
- parm.Add(lenMax);
- //短尺率
- parm.Add(shrtLenRato);
- //短尺最短
- parm.Add(shortest);
- //长尺率
- parm.Add(longLenRato);
- //长尺最长
- parm.Add(longest);
- //短尺随炉
- parm.Add(shrtStove);
- //平均长度大于
- parm.Add(avgLenMin);
- //最长最短差小于
- parm.Add(maxmin);
- //单倍尺长
- parm.Add(siglLen);
- //成品公差
- parm.Add(difrncLenMax);
- //创建人
- parm.Add(UserInfo.GetUserName());
- //长度编号
- parm.Add(lenNoN);
- CoreClientParam ccp = new CoreClientParam();
- ccp.ServerName = "com.steering.pss.plnsaleord.order.CoreOrderLenPln";
- ccp.MethodName = "doupdateLen";
- ccp.ServerParams = new object[] { parm };
- ccp = this.ExecuteNonQuery(ccp, CoreInvokeType.Internal);
- if (ccp.ReturnCode == -1) return;
- lenNo = lenNoN;
- lengthdiscN = lenDesc;
- this.DialogResult = DialogResult.OK;
- this.Close();
- }
- else
- {
- //获取长度描述所对应的编号。
- //string lenNo2 = isRepeat(lenDesc);
- //if (!string.IsNullOrEmpty(lenNo2))
- //{
- // //不为空,存在则执行确认操作。
- // //不为空,创建时间与使用次数更新,返回该行记录给主界面。
- // if (lenNo1 != lenNo2)
- // {
- // //if (MessageUtil.ShowYesNoCancelAndQuestion("该长度描述已存在,是否启用?") == DialogResult.No)
- // //{
- // // return;
- // //}
- // //长度描述相同时修改
- // doUpdate(lenNo2, lenDesc);
- // }
- // this.Close();
- //}
- //else
- //{
- string autoLenNo = GetLenNo();
- //将该行记录插入数据库。
- ArrayList parm = new ArrayList();
- //长度编号
- parm.Add(autoLenNo);
- //长度描述
- parm.Add(lenDesc);
- //长度分类
- parm.Add("轧管推荐");
- //长度单位
- parm.Add(lenUnit);
- //长度下限
- parm.Add(lenMin);
- //长度上限
- parm.Add(lenMax);
- //短尺率
- parm.Add(shrtLenRato);
- //短尺最短
- parm.Add(shortest);
- //短尺随炉
- parm.Add(shrtStove);
- //长尺率
- parm.Add(longLenRato);
- //长尺最长
- parm.Add(longest);
- //单倍尺长
- parm.Add(siglLen);
- //平均长度大于
- parm.Add(avgLenMin);
- //成品公差
- parm.Add(difrncLenMax);
- //最长最短差小于
- parm.Add(maxmin);
- //创建人
- parm.Add(UserInfo.GetUserName());
- //创建时间
- //使用次数
- parm.Add(1);
- CoreClientParam ccp = new CoreClientParam();
- ccp.ServerName = "com.steering.pss.plnsaleord.order.CoreOrderLenPln";
- ccp.MethodName = "doAdd";
- ccp.ServerParams = new object[] { parm };
- ccp = this.ExecuteNonQuery(ccp, CoreInvokeType.Internal);
- if (ccp.ReturnCode == -1) return;
- lenNo = autoLenNo;
- lengthdiscN = lenDesc;
- this.DialogResult = DialogResult.OK;
- this.Close();
- return;
- }
- //}
- }
- }
- /// <summary>
- /// 自动生成编号。
- /// </summary>
- /// <returns></returns>
- private string GetLenNo()
- {
- //获取最大编号加一L0000010,L+7位流水号,不足7位,补0
- DataTable dt = new DataTable();
- dt = ServerHelper.GetData("com.steering.pss.plnsaleord.order.CoreOrderLenPln.GetLenNo", null, this.ob);
- string lenNoNew = "";
- if (dt.Rows.Count > 0)
- {
- lenNoNew = dt.Rows[0][0].ToString();
- }
- while (lenNoNew.Length < 7)
- {
- lenNoNew = "0" + lenNoNew;
- }
- return "L" + lenNoNew;
- }
- /// <summary>
- /// 判断长度描述是否已存在
- /// </summary>
- /// <param name="lenDesc"></param>
- /// <returns></returns>
- private string isRepeat(string lenDesc)
- {
- //获取已存在长度描述信息对应的编号。
- DataTable dt = new DataTable();
- dt = ServerHelper.GetData("com.steering.pss.plnsaleord.order.CoreOrderLenPln.isRepeat", new Object[] { lenDesc }, this.ob);
- if (dt.Rows.Count > 0)
- {
- return dt.Rows[0][0].ToString();
- }
- else
- {
- return "";
- }
- }
- private void ultraButton1_Click(object sender, EventArgs e)
- {
- txtSiglLen.Text = "";
- txtDifrncLenMax.Text = "";
- txtShrtLenRato.Text = "";
- txtLongLenRato.Text = "";
- txtLenMin.Text = "";
- txtShortest.Text = "";
- txtLongest.Text = "";
- txtLenMax.Text = "";
- cmbShrtStove.SelectedIndex = -1;
- txtAvgLenMin.Text = "";
- ultraNumericEditor1.Text = "";
- this.txtLenMin.Focus();
- }
- private void txtShrtLenRato_ValueChanged(object sender, EventArgs e)
- {
- if (txtShrtLenRato.Text.Trim() == "")
- {
- txtShortest.Text = "";
- }
- }
- private void txtLongLenRato_ValueChanged(object sender, EventArgs e)
- {
- if (txtLongLenRato.Text.Trim() == "")
- {
- txtLongest.Text = "";
- }
- }
- private void txtSiglLen_KeyDown(object sender, KeyEventArgs e)//单倍尺长
- {
- if (e.KeyCode != Keys.Enter) return;
- this.txtShrtLenRato.Focus();
- }
- private void txtDifrncLenMax_KeyDown(object sender, KeyEventArgs e)//成品公差
- {
- if (e.KeyCode != Keys.Enter) return;
- this.txtLongLenRato.Focus();
- this.txtLongLenRato.SelectAll();
- }
- private void txtLenMin_KeyDown(object sender, KeyEventArgs e)//长度下限
- {
- if (e.KeyCode != Keys.Enter) return;
- this.txtLenMax.Focus();
- }
- private void txtShrtLenRato_KeyDown(object sender, KeyEventArgs e)//短尺率
- {
- if (e.KeyCode != Keys.Enter) return;
- this.txtShortest.Focus();
- }
- private void txtLongLenRato_KeyDown(object sender, KeyEventArgs e)//长尺率
- {
- if (e.KeyCode != Keys.Enter) return;
- this.txtLongest.Focus();
- }
- private void txtLenMax_KeyDown(object sender, KeyEventArgs e)//长度上限
- {
- if (e.KeyCode != Keys.Enter) return;
- this.ultraNumericEditor1.Focus();
- }
- private void txtShortest_KeyDown(object sender, KeyEventArgs e)//短尺最短
- {
- if (e.KeyCode != Keys.Enter) return;
- this.cmbShrtStove.Focus();
- }
- private void txtLongest_KeyDown(object sender, KeyEventArgs e)//长尺最长
- {
- if (e.KeyCode != Keys.Enter) return;
- this.txtAvgLenMin.Focus();
- }
- private void ultraNumericEditor1_KeyDown(object sender, KeyEventArgs e)//最大最长差小于
- {
- if (e.KeyCode != Keys.Enter) return;
- this.txtSiglLen.Focus();
- }
- private void cmbShrtStove_KeyDown(object sender, KeyEventArgs e)
- {
- if (e.KeyCode != Keys.Enter) return;
- this.txtDifrncLenMax.Focus();
- }
- private void txtAvgLenMin_KeyDown(object sender, KeyEventArgs e)//平均长度大于
- {
- if (e.KeyCode != Keys.Enter) return;
- this.doAdd();
- }
- private void cmbShrtStove_TextChanged(object sender, EventArgs e)
- {
- //if (cmbShrtStove.Text.Equals("短尺随炉"))
- //{
- // if ((txtShrtLenRato.Value != System.DBNull.Value && txtShrtLenRato.Value != null && Convert.ToDouble(txtShrtLenRato.Value) != 0) ||
- // (ultraNumericEditor1.Value != System.DBNull.Value && ultraNumericEditor1.Value != null && Convert.ToDouble(ultraNumericEditor1.Value) != 0) ||
- // (txtSiglLen.Value != System.DBNull.Value && txtSiglLen.Value != null && Convert.ToDouble(txtSiglLen.Value) != 0) ||
- // (txtShortest.Value != System.DBNull.Value && txtShortest.Value != null && Convert.ToDouble(txtShortest.Value) != 0) ||
- // (txtDifrncLenMax.Value != System.DBNull.Value && txtDifrncLenMax.Value != null && Convert.ToDouble(txtDifrncLenMax.Value) != 0) ||
- // (txtLongLenRato.Value != System.DBNull.Value && txtLongLenRato.Value != null && Convert.ToDouble(txtLongLenRato.Value) != 0) ||
- // (txtLongest.Value != System.DBNull.Value && txtLongest.Value != null && Convert.ToDouble(txtLongest.Value) != 0) ||
- // (txtAvgLenMin.Value != System.DBNull.Value && txtAvgLenMin.Value != null && Convert.ToDouble(txtAvgLenMin.Value) != 0)
- // )
- // {
- // MessageUtil.ShowWarning("您选择了'短尺随炉',除长度上下限数值外一律不能录入(短尺随炉具有排他性)!");
- // txtShrtLenRato.Focus();
- // txtShrtLenRato.SelectAll();
- // return;
- // }
- //}
- }
- }
- }
|