| 123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215 |
- 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.CA03;
- using CoreFS.CA04;
- 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 Infragistics.Win.UltraWinEditors;
- using System.Text.RegularExpressions;
- namespace Core.StlMes.Client.MilCount
- {
- public partial class FrmFPRecall : FrmBase
- {
- public FrmFPRecall()
- {
- InitializeComponent();
- }
- /// <summary>
- /// 重写基类方法
- /// </summary>
- /// <param name="sender"></param>
- /// <param name="ToolbarKey"></param>
- public override void ToolBar_Click(object sender, string ToolbarKey)
- {
- switch (ToolbarKey)
- {
- case "doQuery":
- doQuery();
- break;
- case "doModify":
- Update();
- break;
- //case "doDelete":
- // this.doDeleteOrResume(true);
- // break;
- //case "doResume":
- // this.doDeleteOrResume(false);
- // break;
- //case "Close":
- // this.Close();
- //break;
- }
- }
- private void doQuery()
- {
- string titleName = "";
- if (ultraCheckEditor1.Checked)
- {
- titleName = txtyear.Text.Trim();
- DataTable dt = ServerHelper.GetData("com.steering.mes.fprecall.corefprecall.getLineList", new Object[] { titleName}, this.ob);
- GridHelper.CopyDataToDatatable(ref dt, ref this.dataTable1, true);
-
- }
- else
- {
- DataTable dt = ServerHelper.GetData("com.steering.mes.fprecall.corefprecall.getLineList_all", null, this.ob);
- GridHelper.CopyDataToDatatable(ref dt, ref this.dataTable1, true);
- }
-
- //不同颜色区分是否有效数据
- //Infragistics.Win.UltraWinGrid.UltraGridRow row = null;
- //for (int i = 0; i < ultraGrid2.Rows.Count; i++)
- //{
- // row = ultraGrid2.Rows[i];
- // if (!row.Cells["VALIDFLAG"].Value.ToString().Equals("1"))
- // {
- // row.Appearance.ForeColor = Color.Red;
- // }
- // else
- // {
- // row.Appearance.ForeColor = Color.Black;
- // }
- //}
- //列自适应
- //GridHelper.RefreshAndAutoSizeExceptRows(ultraGrid2, new UltraGridColumn[] {
- // ultraGrid2.DisplayLayout.Bands[0].Columns["MEMO"]
- //});
- }
- private void ultraGrid1_AfterRowActivate(object sender, EventArgs e)
- {
- Infragistics.Win.UltraWinGrid.UltraGridRow row = ultraGrid1.ActiveRow;
- if (row != null)
- {
- //STEELCODE,STEELNAME,STEELSTYLE
- txt_id.Text = row.Cells["标识ID"].Value.ToString();
- txt_lcode.Text = row.Cells["上料炉号"].Value.ToString();
- }
- }
- private void initJGDropDown(UltraComboEditor uce, string MethodId, string memberValue)
- {
- //初始化编辑区域下拉框
- DataTable dt = ServerHelper.GetData(MethodId, null, this.ob);
- if (dt != null && dt.Rows.Count > 0)
- {
- uce.DataSource = dt;
- uce.ValueMember = memberValue;
- }
- }
- private void FrmFPRecall_Load(object sender, EventArgs e)
- {
- InitCombo();
- }
- private void InitCombo()
- {
- initJGDropDown(cmbGXType, "com.steering.mes.fprecall.corefprecall.getGXType", "GX_Detail");
- initJGDropDown(cmbleixing, "com.steering.mes.fprecall.corefprecall.getLeiXing", "FP_Detail");
-
- }
- private void Update()
- {
- string para = @"^(\d+(\.\d+)?)|(\-1)$";//正则式
- Regex reg = new Regex(para);
- if (reg.IsMatch(txt_fd.Text) && reg.IsMatch(txt_fz.Text))
- {
- if (MessageUtil.ShowYesNoAndQuestion("是否确认修改?") == DialogResult.No)
- {
- return;
- }
- ArrayList list = new ArrayList();
- list.Add(txt_id.Text.Trim());//cmbGradeType.Value
- list.Add(cmbleixing.Value);
- list.Add(txt_fz.Text.Trim());
- list.Add(txt_fd.Text.Trim());
- list.Add(txt_length.Text.Trim());
- list.Add(txt_fgx.Text.Trim());
- list.Add(cmbGXType.Value);
- list.Add(ultraGrid1.ActiveRow.Cells["产出炉号"].Value.ToString());
- list.Add(ultraGrid1.ActiveRow.Cells["轧批号"].Value.ToString());
- list.Add(ultraGrid1.ActiveRow.Cells["外径"].Value.ToString());
- list.Add(ultraGrid1.ActiveRow.Cells["壁厚"].Value.ToString());
- ArrayList list2 = new ArrayList();
- //cmbGradeType.Value
- list2.Add(txt_id.Text.Trim());
- list2.Add(ultraGrid1.ActiveRow.Cells["轧批号"].Value.ToString());
- list2.Add(ultraGrid1.ActiveRow.Cells["产出炉号"].Value.ToString());
- list2.Add(txt_fz.Text.Trim());
- list2.Add(txt_fd.Text.Trim());
- ArrayList list3 = new ArrayList();
- //cmbGradeType.Value
- list3.Add(txt_fz.Text.Trim());
- list3.Add(txt_fd.Text.Trim());
- list3.Add(txt_id.Text.Trim());
- ServerHelper.SetData("com.steering.mes.fprecall.corefprecall.update", new object[] { list, list2, list3 }, ob);
- MessageUtil.ShowTips("修改成功!");
- doQuery();
- }
- else
- {
- MessageBox.Show("请输入数字!");
- return;
- }
- }
- private void ultraCheckEditor1_CheckedChanged(object sender, EventArgs e)
- {
-
- if (ultraCheckEditor1.Checked)
- {
- txtyear.ReadOnly = false;
- }
- else
- {
- txtyear.ReadOnly = true;
- }
- }
- private void txt_fd_KeyPress(object sender, KeyPressEventArgs e)
- {
-
- //if (!(Char.IsNumber(e.KeyChar)) && e.KeyChar != (char)8)
- //{
- // e.Handled = true;
- //}
- //else
- //{
- // MessageBox.Show("请输入数字!");
- //}
- }
-
-
-
- }
- }
|