using Core.Mes.Client.Comm.Control;
using Core.Mes.Client.Comm.Server;
using Core.Mes.Client.Comm.Tool;
using CoreFS.CA06;
using Infragistics.Win.UltraWinEditors;
using Infragistics.Win.UltraWinGrid;
using System;
using System.Collections;
using System.Data;
using System.Linq;
using System.Windows.Forms;
namespace Core.StlMes.Client.Qcm
{
///
/// 生产产线适用规格界面
///
public partial class FrmComMSCPlineRSpec : FrmBase
{
//错误信息
private string errMessage = "";
//产线集合 (用于SQL中的IN关键字)
private string _mscPlines = "'1'";
public string MscPlines
{
get { return _mscPlines; }
set { _mscPlines = value; }
}
//断面规格代码
private string _specCode = "";
public string SpecCode
{
get { return _specCode; }
set { _specCode = value; }
}
//外径
private string _dimater = "";
public string Dimater
{
get { return _dimater; }
set { _dimater = value; }
}
//断面
private string _height = "";
public string Height1
{
get { return _height; }
set { _height = value; }
}
//规格选择集合
private ArrayList _choiceSpecs = new ArrayList();
//初始化
public FrmComMSCPlineRSpec()
{
InitializeComponent();
}
public void PopupLoad(string customInfo, OpeBase ob)
{
this.CustomInfo = customInfo;
this.ob = ob;
this.OnLoad(EventArgs.Empty);
}
public override void ToolBar_Click(object sender, string ToolbarKey)
{
switch (ToolbarKey)
{
case "Query":
DoQuery();
break;
case "Add":
DoAdd();
break;
case "Update":
DoUpdate();
break;
case "Delete":
DoDelete();
break;
case "Resume":
DoResume();
break;
case "Refresh":
Init();
break;
case "Export":
Export();
break;
case "Close":
this.Close();
break;
}
}
private void Export()
{
GridHelper.ulGridToExcel(ultraGrid1, "生产产线适用规格");
}
///
/// 查询
///
private void DoQuery()
{
try
{
this.Cursor = Cursors.WaitCursor;
//查询条件集合
ArrayList conditionParams = QueryCondition();
DataTable dt = ServerHelper.GetData("com.steering.pss.qcm.CoreComMSCPlineRSpec.getComMSC", new Object[] { conditionParams }, this.ob);
GridHelper.CopyDataToDatatable(ref dt, ref this.dataTable1, true);
//不同颜色区分是否有效数据
QcmBaseCommon.DistinguishColor(ultraGrid1, "VALIDFLAGNAME", "有效");
}
catch (Exception)
{
}
finally
{
this.Cursor = Cursors.Default;
}
}
///
/// 查询条件
///
/// 集合k
private ArrayList QueryCondition()
{
ArrayList param = new ArrayList();
string validFlag = "";
string plineCode = "";
string passCode = "";
string specJG = "";
if (this.ultraCheckEditor4.Checked)
{
validFlag = "0";
}
else { validFlag = "1"; }
if (this.ultraCheckEditor1.Checked)
plineCode = this.ultraTextProline.Text.Trim().ToString();
if (this.ultraCheckEditor2.Checked)
passCode = this.ultraTextKX.Text.Trim().ToString();
if (this.ultraCheckEditor3.Checked)
specJG = this.ultraTextWell.Text.Trim().ToString();
param.Add(validFlag);
param.Add(plineCode);
param.Add(passCode);
param.Add(specJG);
param.Add(MscPlines.Trim('\''));
param.Add(SpecCode);
param.Add(Dimater);
param.Add(Height1);
return param;
}
///
/// 增加
///
private void DoAdd()
{
try
{
ArrayList list = GetAddData();
if (list == null)
{
MessageBox.Show(errMessage, "提示", MessageBoxButtons.OK, MessageBoxIcon.Warning);
return;
}
DataTable dt = ServerHelper.GetData("com.steering.pss.qcm.CoreComMSCPlineRSpec.isReapt", new object[] { list }, this.ob);
if (dt != null && dt.Rows.Count > 0)
{
MessageUtil.ShowWarning("已存在相同的数据!");
return;
}
if (MessageBox.Show("是否确认新增数据?", "提示", MessageBoxButtons.YesNo, MessageBoxIcon.Question) == DialogResult.No)
{
return;
}
int count = ServerHelper.SetData("com.steering.pss.qcm.CoreComMSCPlineRSpec.addComMSC", new Object[] { list, _choiceSpecs }, this.ob);
if (count > 0)
{
MessageUtil.ShowTips("数据新增成功!");
DoQuery();
ultraGrid1.DisplayLayout.Bands[0].SortedColumns.Clear();
ultraGrid1.DisplayLayout.Bands[0].Columns["INDEX_SEQ"].SortIndicator = SortIndicator.Ascending;
this.ultraGrid1.Rows[ultraGrid1.Rows.Count - 1].Activate();
}
}
catch (Exception)
{
}
}
///
/// 修改
///
private void DoUpdate()
{
if (ultraGrid1.DisplayLayout.ActiveRow == null)
{ MessageBox.Show("请选择记录", "提示", MessageBoxButtons.OK, MessageBoxIcon.Warning); return; }
UltraGridRow ugr = ultraGrid1.DisplayLayout.ActiveRow;
if (ugr.Cells["VALIDFLAGNAME"].Text.Equals("无效"))
{ MessageBox.Show("无效记录不能修改", "提示", MessageBoxButtons.OK, MessageBoxIcon.Warning); return; }
ArrayList list = GetAddData();
if (list == null)
{
MessageBox.Show(errMessage, "提示", MessageBoxButtons.OK, MessageBoxIcon.Warning);
return;
}
int index = Int32.Parse(ugr.Cells["INDEX_SEQ"].Value.ToString().Trim());
list.Add(index.ToString());
DataTable dt = ServerHelper.GetData("com.steering.pss.qcm.CoreComMSCPlineRSpec.isReaptUpdate", new object[] { list }, this.ob);
if (dt != null && dt.Rows.Count > 0)
{
MessageUtil.ShowWarning("已存在相同的数据!");
return;
}
if (MessageBox.Show("是否修改记录?", "提示", MessageBoxButtons.YesNo, MessageBoxIcon.Question) == DialogResult.No)
return;
int count = ServerHelper.SetData("com.steering.pss.qcm.CoreComMSCPlineRSpec.updateComMSC", new Object[] { list, _choiceSpecs }, this.ob);
if (count > 0)
{
MessageUtil.ShowTips("数据修改成功!");
DoQuery();
SetActiveRow(index.ToString());
}
}
///
/// 删除
///
private void DoDelete()
{
try
{
if (ultraGrid1.DisplayLayout.ActiveRow == null) { MessageBox.Show("请选择记录", "提示", MessageBoxButtons.OK, MessageBoxIcon.Warning); return; }
if (MessageBox.Show("是否作废记录?", "提示", MessageBoxButtons.YesNo, MessageBoxIcon.Question) == DialogResult.No)
{
return;
}
if (ultraGrid1.DisplayLayout.ActiveRow.Cells["VALIDFLAGNAME"].Text.Equals("无效"))
{ MessageBox.Show("无效记录不能作废", "提示", MessageBoxButtons.OK, MessageBoxIcon.Warning); return; }
ArrayList list = new ArrayList();
if (list == null)
{
MessageBox.Show(errMessage, "提示", MessageBoxButtons.OK, MessageBoxIcon.Warning);
return;
}
list.Add(UserInfo.GetUserName());
list.Add(Int32.Parse(this.ultraGrid1.DisplayLayout.ActiveRow.Cells["INDEX_SEQ"].Value.ToString().Trim()));
int count = ServerHelper.SetData("com.steering.pss.qcm.CoreComMSCPlineRSpec.deleteComMSC", new Object[] { list }, this.ob);
if (count > 0)
{
MessageUtil.ShowTips("删除成功!");
DoQuery();
}
}
catch (Exception)
{
}
}
///
/// 恢复
///
private void DoResume()
{
try
{
if (ultraGrid1.DisplayLayout.ActiveRow == null)
{
MessageBox.Show("请选择记录", "提示", MessageBoxButtons.OK, MessageBoxIcon.Information);
return;
}
if (MessageBox.Show("是否恢复记录?", "提示", MessageBoxButtons.YesNo, MessageBoxIcon.Question) == DialogResult.No)
return;
if (ultraGrid1.DisplayLayout.ActiveRow.Cells["VALIDFLAGNAME"].Text.Equals("有效"))
{ MessageBox.Show("有效记录不能恢复", "提示", MessageBoxButtons.OK, MessageBoxIcon.Information); return; }
ArrayList list = new ArrayList();
int index = Int32.Parse(this.ultraGrid1.DisplayLayout.ActiveRow.Cells["INDEX_SEQ"].Value.ToString().Trim());
list.Add(index);
int count = ServerHelper.SetData("com.steering.pss.qcm.CoreComMSCPlineRSpec.resumeComMSC", new Object[] { list }, this.ob);
if (count > 0)
{
MessageUtil.ShowTips("恢复成功!");
DoQuery();
SetActiveRow(index.ToString());
}
}
catch (Exception)
{
}
}
private void Init()
{
QcmBaseCommon.InitDropUltraComEditor(ultraComboEditor6, "com.steering.pss.qcm.ComBaseQuery.getComMSCJG", "SPEC_JG_DESC", this.ob, true);
QcmBaseCommon.InitDropUltraComEditor(ultraComProLine, "com.steering.pss.qcm.ComBaseQuery.getComBasePline", "PLINE_NAME", this.ob, false);
QcmBaseCommon.InitDropUltraComEditor(ultraComboEditor4, "com.steering.pss.qcm.ComBaseQuery.getComBaseInfo", "BASENAME", this.ob, true);
//QcmBaseCommon.InitDropUltraComEditor(ultraComboEditor7, "com.steering.pss.qcm.ComBaseQuery.getComBaseWell", "WELL_NAME", this.ob, false);
if (ultraComProLine.Value != null)
{
string processCode = GetStationId(ultraComProLine.Value.ToString());
QcmBaseQuery.NitializeComBaseWell(ultraComboEditor7, processCode, false, ob);
}
else
{
QcmBaseQuery.NitializeComBaseWell(ultraComboEditor7, "", false, ob);
}
QcmBaseCommon.InitDrop(ultraComboEditor1, "com.steering.pss.qcm.CoreComMSCPlineRSpec.getSpecName", "SPEC_NAME", "SPEC_CODE", true, this.ob);
QcmBaseCommon.InitDrop(ultraComboEditor2, "com.steering.pss.qcm.CoreComMSCPlineRSpec.getProcessStyle", "BASENAME", "BASECODE", true, this.ob);
QcmBaseCommon.InitDrop(ultraComboEditor3, "com.steering.pss.qcm.CoreComMSCPlineRSpec.getModelStyle", "BASENAME", "BASECODE", true, this.ob);
}
private void FrmComMSCPlineRSpec_Load(object sender, EventArgs e)
{
try
{
Init();
DoQuery();
}
catch (Exception)
{
}
}
///
/// 根据产线获取工序代码
///
/// 产线代码
/// 工序代码
private string GetStationId(string plineCode)
{
string str = "";
DataTable dt = ServerHelper.GetData("com.steering.pss.qcm.CoreComMSCPlineRSpec.getStationId", new object[] { plineCode }, this.ob);
if (dt != null && dt.Rows.Count > 0)
{
str = dt.Rows[0][0].ToString();
}
return str;
}
///
/// 比较外径壁厚(min,max)的合理性
///
/// 最小外径
/// 最大外径
/// 最小壁厚
/// 最大壁厚
/// 不合理返回null,合理返回0
private object CompareData(string minD, string maxD, string minH, string maxH)
{
if (minD == "" || (!minD.Equals("") && !StringUtil.IsNumber(minD)))
{
errMessage = "最小外径值请输入数字";
return null;
}
if (maxD == "" || (!maxD.Equals("") && !StringUtil.IsNumber(maxD)))
{
errMessage = "最大外径值请输入数字";
return null;
}
if (minH == "" || (!minH.Equals("") && !StringUtil.IsNumber(minH)))
{
errMessage = "最小壁厚值请输入数字";
return null;
}
if (maxH == "" || (!maxH.Equals("") && !StringUtil.IsNumber(maxH)))
{
errMessage = "最大壁厚值请输入数字";
return null;
}
if (!minD.Equals("") && !maxD.Equals("") && Convert.ToDouble(minD) > Convert.ToDouble(maxD))
{
errMessage = "外径最小值不能大于最大值";
return null;
}
if (!minH.Equals("") && !maxH.Equals("") && Convert.ToDouble(minH) > Convert.ToDouble(maxH))
{
errMessage = "壁厚最小值不能大于最大值";
return null;
}
return 0;
}
///
/// 新增数据
///
/// 集合
private ArrayList GetAddData()
{
ArrayList list = new ArrayList();
if (ultraComProLine.SelectedItem == null)
{
errMessage = "请选择产线描述";
return null;
}
string proLineCode = ultraComProLine.Value.ToString();
string proLineName = ultraComProLine.Text.Trim();//产线
string strId = GetStationId(proLineCode);
//一级工序代码strId A B C D E F G H
string minD = ultraTextEditor1.Text.Trim(); //外径最小值
string maxD = ultraTextEditor2.Text.Trim(); //外径最大值
string minH = ultraTextEditor3.Text.Trim(); //壁厚最小值
string maxH = ultraTextEditor4.Text.Trim(); //壁厚最大值
if (strId == "A")
{
if (ultraComboEditor7.SelectedItem == null)
{
errMessage = "请选择产能井描述!";
return null;
}
}
else if (strId == "B" || strId == "C")
{
if (ultraComboEditor7.SelectedItem == null)
{
errMessage = "请选择产能井描述!";
return null;
}
if (ultraComboEditor1.SelectedItem == null || ultraComboEditor1.Value.ToString() == "")
{
errMessage = "请选择管坯(锭)规格!";
return null;
}
}
else if (strId == "D")
{
if (ultraComboEditor4.SelectedItem == null)
{
errMessage = "请选择孔型集合!";
return null;
}
if (ultraComboEditor7.SelectedItem == null)
{
errMessage = "请选择产能井描述!";
return null;
}
if (ultraComboEditor1.SelectedItem == null || ultraComboEditor1.Value.ToString() == "")
{
errMessage = "请选择管坯(锭)规格!";
return null;
}
if (CompareData(minD, maxD, minH, maxH) == null)
return null;
}
else if (strId == "E")
{
if (ultraComboEditor7.SelectedItem == null)
{
errMessage = "请选择产能井描述!";
return null;
}
if (CompareData(minD, maxD, minH, maxH) == null)
return null;
}
else if (strId == "F")
{
if (ultraComboEditor7.SelectedItem == null)
{
errMessage = "请选择产能井描述!";
return null;
}
if (ultraTextEditor9.Text.Trim() == "")
{
errMessage = "请选择二级工序集合!";
return null;
}
if (CompareData(minD, maxD, minH, maxH) == null)
return null;
}
else if (strId == "G" || strId == "H")
{
if (ultraComboEditor7.SelectedItem == null)
{
errMessage = "请选择产能井描述!";
return null;
}
if (strId == "G" && ultraTextEditor9.Text.Trim() == "")
{
errMessage = "请选择二级工序集合!";
return null;
}
if (ultraTextEditor7.Text.Trim() == "")
{
errMessage = "请选择扣型描述!";
return null;
}
if (CompareData(minD, maxD, minH, maxH) == null)
return null;
}
string passCode = "";
string passName = "";
if (ultraComboEditor4.SelectedItem != null)
{
passCode = ultraComboEditor4.Value.ToString();
passName = ultraComboEditor4.Text.Trim();//孔型
}
string modelCode = ultraTextDesc.Text.ToString();
string modelName = ultraTextEditor7.Text.ToString().Trim();//扣型
string JGCode = "";
if (ultraComboEditor6.Value != null)
JGCode = ultraComboEditor6.Value.ToString().Trim();
string JGDesc = ultraComboEditor6.Text.Trim().ToString();//结箍
//if (!JGDesc.Equals("") && (!minD.Equals("") || !minH.Equals("") || !maxD.Equals("") || !maxH.Equals("")))
//{
// errMessage = "结箍描述和外径壁厚不能同时存在";
// return null;
//}
string wellCode = "";
string wellName = ""; //产能井
if (ultraComboEditor7.SelectedItem != null)
{
wellCode = this.ultraComboEditor7.Value.ToString().Trim();
wellName = this.ultraComboEditor7.Text.Trim().ToString();//产能井
}
string userName = UserInfo.GetUserName();
string memo = ultraTextEditor5.Text.Trim().ToString();
string speccode = "";
string specname = "";
if (ultraComboEditor1.SelectedItem != null && ultraComboEditor1.Value.ToString() != "")
{
speccode = ultraComboEditor1.Value.ToString();
specname = ultraComboEditor1.Text.ToString();
}
string processStyle = "";
if (ultraComboEditor2.SelectedItem != null && ultraComboEditor2.Value.ToString() != "")
{
processStyle = ultraComboEditor2.Value.ToString();
}
string processID = ultraTextEditor6.Text.Trim();
string processDesc = ultraTextEditor9.Text;
string modelStyle = "";
if (ultraComboEditor3.SelectedItem != null && ultraComboEditor3.Value.ToString() != "")
{
modelStyle = ultraComboEditor3.Value.ToString();
}
list.Add(proLineCode);
list.Add(proLineName);
list.Add(passCode);
list.Add(passName);
list.Add(modelCode);
list.Add(modelName);
list.Add(minD);
list.Add(maxD);
list.Add(minH);
list.Add(maxH);
list.Add(JGCode);
list.Add(JGDesc);
list.Add(wellCode);
list.Add(wellName);
list.Add(userName);
list.Add(memo);
list.Add(speccode);
list.Add(specname);
list.Add(processStyle);
list.Add(processID);
list.Add(processDesc);
list.Add(modelStyle);
return list;
}
///
/// 定位到新增或者修改的行
///
///
private void SetActiveRow(string index)
{
Infragistics.Win.UltraWinGrid.UltraGridRow row = null;
for (int i = 0; i < ultraGrid1.Rows.Count; i++)
{
row = ultraGrid1.Rows[i];
if (row.Cells["INDEX_SEQ"].Value.ToString().Equals(index))
{
row.Activate();
break;
}
}
}
private void ultraCheckEditor1_CheckedChanged(object sender, EventArgs e)
{
if (this.ultraCheckEditor1.Checked)
{
this.ultraTextProline.Enabled = true;
}
else
this.ultraTextProline.Enabled = false;
}
private void ultraCheckEditor2_CheckedChanged(object sender, EventArgs e)
{
if (this.ultraCheckEditor2.Checked)
{
this.ultraTextKX.Enabled = true;
}
else
this.ultraTextKX.Enabled = false;
}
private void ultraCheckEditor3_CheckedChanged(object sender, EventArgs e)
{
if (this.ultraCheckEditor3.Checked)
{
this.ultraTextWell.Enabled = true;
}
else
this.ultraTextWell.Enabled = false;
}
private void ultraGrid1_AfterRowActivate_1(object sender, EventArgs e)
{
if (this.ultraGrid1.DisplayLayout.ActiveRow == null)
return;
this.ultraComProLine.Text = this.ultraGrid1.DisplayLayout.ActiveRow.Cells["PLINE_NAME"].Text.ToString();
this.ultraComProLine.Value = this.ultraGrid1.DisplayLayout.ActiveRow.Cells["PLINE_CODE"].Text.ToString();
this.ultraComboEditor4.Text = this.ultraGrid1.DisplayLayout.ActiveRow.Cells["PASS_NAME"].Text.ToString();
this.ultraComboEditor4.Value = this.ultraGrid1.DisplayLayout.ActiveRow.Cells["PASS_CODE"].Text.ToString();
this.ultraTextDesc.Text = this.ultraGrid1.DisplayLayout.ActiveRow.Cells["MODEL_CODE"].Text.ToString();
this.ultraTextEditor7.Text = this.ultraGrid1.DisplayLayout.ActiveRow.Cells["MODEL_DESC"].Text.ToString();
ultraTextEditor7.Refresh();
this.ultraComboEditor6.Text = this.ultraGrid1.DisplayLayout.ActiveRow.Cells["SPEC_JG_DESC"].Text.ToString();
this.ultraComboEditor6.Value = this.ultraGrid1.DisplayLayout.ActiveRow.Cells["SPEC_JG"].Text.ToString();
this.ultraComboEditor7.Value = this.ultraGrid1.DisplayLayout.ActiveRow.Cells["WELL_CODE"].Text.ToString();
this.ultraComboEditor7.Text = this.ultraGrid1.DisplayLayout.ActiveRow.Cells["WELL_NAME"].Text.ToString();
this.ultraTextEditor1.Value = this.ultraGrid1.DisplayLayout.ActiveRow.Cells["MIN_D"].Value;
this.ultraTextEditor2.Value = this.ultraGrid1.DisplayLayout.ActiveRow.Cells["MAX_D"].Value;
this.ultraTextEditor3.Value = this.ultraGrid1.DisplayLayout.ActiveRow.Cells["MIN_H"].Value;
this.ultraTextEditor4.Value = this.ultraGrid1.DisplayLayout.ActiveRow.Cells["MAX_H"].Value;
this.ultraTextEditor5.Text = this.ultraGrid1.DisplayLayout.ActiveRow.Cells["MEMO"].Text.ToString();
this.ultraComboEditor1.Value = this.ultraGrid1.DisplayLayout.ActiveRow.Cells["SPEC_NAME"].Value;
ultraComboEditor2.Text = this.ultraGrid1.DisplayLayout.ActiveRow.Cells["PROCESS_STYLE"].Value.ToString();
ultraComboEditor3.Text = this.ultraGrid1.DisplayLayout.ActiveRow.Cells["MODEL_STYLE"].Value.ToString();
ultraTextEditor9.Text = this.ultraGrid1.DisplayLayout.ActiveRow.Cells["PROCESS_DESC_C"].Value.ToString();
ultraTextEditor6.Text = this.ultraGrid1.DisplayLayout.ActiveRow.Cells["PROCESS_CDOE_C"].Value.ToString();
ultraTextEditor8.Text = this.ultraGrid1.GetActiveRowValue("SPEC_JG_DESC");
string[] specs = ultraGrid1.GetActiveRowValue("SPEC_JG").Split(new char[] { ';' }, StringSplitOptions.RemoveEmptyEntries).ToArray();
string[] specDescs = ultraGrid1.GetActiveRowValue("SPEC_JG_DESC").Split(new char[] { ';' }, StringSplitOptions.RemoveEmptyEntries).ToArray();
_choiceSpecs.Clear();
for (int i = 0; i < specs.Length; i++)
{
_choiceSpecs.Add(new string[] { specs[i], specDescs[i], UserInfo.GetUserName() });
}
}
private void SetEnabledFalse()
{
//ultraComboEditor2.Enabled = false;
ultraComboEditor3.Enabled = false;
ultraTextEditor1.Enabled = false;
ultraTextEditor3.Enabled = false;
ultraComboEditor4.Enabled = false;
//ultraButton1.Enabled = false;
ultraTextEditor7.Enabled = false;
ultraTextEditor2.Enabled = false;
ultraTextEditor4.Enabled = false;
ultraComboEditor7.Enabled = false;
ultraComboEditor1.Enabled = false;
ultraComboEditor6.Enabled = false;
ClearData();
}
///
/// 清除数据
///
private void ClearData()
{
ultraComboEditor2.Value = "";
ultraComboEditor3.Value = "";
ultraTextEditor1.Value = "";
ultraTextEditor3.Value = "";
ultraComboEditor4.Value = "";
ultraTextEditor9.Text = ""; ;
ultraTextEditor7.Text = "";
ultraTextEditor2.Value = "";
ultraTextEditor4.Value = "";
ultraComboEditor7.Text = "";
ultraComboEditor1.Value = "";
ultraComboEditor6.Value = "";
}
private void ultraComProLine_ValueChanged(object sender, EventArgs e)
{
if (ultraComProLine.SelectedItem == null)
return;
string id = GetStationId(ultraComProLine.Value.ToString());
if (id == "A")
{
SetEnabledFalse();
ultraComboEditor7.Enabled = true;
}
else if (id == "B" || id == "C")
{
SetEnabledFalse();
ultraComboEditor7.Enabled = true;
ultraComboEditor1.Enabled = true;
}
else if (id == "D")
{
SetEnabledFalse();
ultraComboEditor4.Enabled = true;
ultraComboEditor1.Enabled = true;
ultraComboEditor7.Enabled = true;
ultraTextEditor1.Enabled = true;
ultraTextEditor2.Enabled = true;
ultraTextEditor3.Enabled = true;
ultraTextEditor4.Enabled = true;
}
else if (id == "E")
{
SetEnabledFalse();
ultraComboEditor7.Enabled = true;
ultraTextEditor1.Enabled = true;
ultraTextEditor2.Enabled = true;
ultraTextEditor3.Enabled = true;
ultraTextEditor4.Enabled = true;
}
else if (id == "F")
{
SetEnabledFalse();
ultraComboEditor7.Enabled = true;
ultraTextEditor1.Enabled = true;
ultraTextEditor2.Enabled = true;
ultraTextEditor3.Enabled = true;
ultraTextEditor4.Enabled = true;
ultraComboEditor2.Enabled = true;
ultraTextEditor9.Enabled = true;
}
else if (id == "G" || id == "H")
{
SetEnabledFalse();
ultraComboEditor7.Enabled = true;
ultraTextEditor1.Enabled = true;
ultraTextEditor2.Enabled = true;
ultraTextEditor3.Enabled = true;
ultraTextEditor4.Enabled = true;
ultraComboEditor3.Enabled = true;
ultraTextEditor7.Enabled = true;
ultraComboEditor6.Enabled = true;
}
ultraComboEditor7.SelectedIndex = -1;
QcmBaseQuery.NitializeComBaseWell(ultraComboEditor7, id, false, ob);
}
private void ultraComboEditor2_ValueChanged(object sender, EventArgs e)
{
ultraTextEditor9.Text = "";
}
private void ultraComboEditor3_ValueChanged(object sender, EventArgs e)
{
if (ultraGrid1.ActiveRow == null)
{
ultraTextEditor7.Text = "";
}
else
{
if (ultraComboEditor3.Value != null && ultraComboEditor3.Value.ToString() != ultraGrid1.GetActiveRowValue("MODEL_STYLE"))
ultraTextEditor7.Text = "";
}
}
private void ultraTextEditor8_EditorButtonClick(object sender, EditorButtonEventArgs e)
{
string specs = "";
if (_choiceSpecs.Count > 0)
{
foreach (string[] strs in _choiceSpecs)
{
specs += strs[0] + ";";
}
}
else if (ultraGrid1.ActiveRow != null)
{
specs = ultraGrid1.GetActiveRowValue("SPEC_JG");
}
this.Cursor = Cursors.WaitCursor;
PopupSpecificationsBasics popup = new PopupSpecificationsBasics(specs, ob);
this.Cursor = Cursors.Default;
DialogResult result = popup.ShowDialog();
if (result == DialogResult.OK)
{
specs = "";
foreach (string[] strs in popup.ChoiceSpecs)
{
specs += strs[1] + "; ";
}
ultraTextEditor8.Text = specs;
_choiceSpecs = popup.ChoiceSpecs;
}
}
private void ultraTextEditor9_EditorButtonClick(object sender, EditorButtonEventArgs e)
{
UltraGridRow row = this.ultraGrid1.DisplayLayout.ActiveRow;
if (row == null)
return;
if (ultraComboEditor2.Text.Trim() == "")
{
MessageUtil.ShowWarning("请先选择二级工序分类");
return;
}
FrmProcess fp = new FrmProcess();
fp.Ob1 = this.ob;
fp.Code = row.Cells["PROCESS_CDOE_C"].Value.ToString();
fp.Desc = row.Cells["PROCESS_DESC_C"].Value.ToString();
fp.ProcessStyle = ultraComboEditor2.Value.ToString();
fp.ShowDialog();
ultraTextEditor6.Value = fp.Code;
ultraTextEditor9.Text = fp.Desc;
}
private void ultraTextEditor7_EditorButtonClick(object sender, EditorButtonEventArgs e)
{
UltraGridRow row = this.ultraGrid1.DisplayLayout.ActiveRow;
if (row == null)
return;
if (ultraComboEditor3.Text.Trim() == "")
{
MessageUtil.ShowWarning("请先选择扣型分类");
return;
}
FrmModel frms = new FrmModel();
frms.FrmOb = this.ob;
frms.Code = row.Cells["MODEL_CODE"].Value.ToString();
frms.Desc = row.Cells["MODEL_DESC"].Value.ToString();
frms.ModelStyle = ultraComboEditor3.Value.ToString();
frms.ShowDialog();
ultraTextDesc.Value = frms.Code;
ultraTextEditor7.Text = frms.Desc;
}
}
}