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 Core.Mes.Client.Comm.Server;
using CoreFS.CA06;
using CoreFS.SA06;
using System.Collections;
using Core.Mes.Client.Comm.Control;
using Infragistics.Win.UltraWinGrid;
using Infragistics.Win;
using Core.Mes.Client.Comm;
namespace Core.StlMes.Client.Plan.Order
{
public partial class FrmPlineSpec : FrmBase
{
///
/// 质量设计主键
///
private string desginkey = "";
///
/// 主制程索引号
///
private string mscpline = "";
///
/// 产线代码
///
private string plinecode = "";
///
/// 坯料断面
///
private double dimater = 0;
///
/// 是否确认计算
///
private bool isConfirm = false;
public FrmPlineSpec()
{
InitializeComponent();
}
///
/// 重载构造,传入质量设计主键
///
///
public FrmPlineSpec(string strkey,string index,OpeBase ob)
{
this.desginkey = strkey;
this.mscpline = index;
this.ob = ob;
InitializeComponent();
}
private void FrmPlineSpec_Load(object sender, EventArgs e)
{
ArrayList param = new ArrayList();
param.Add(this.desginkey);
param.Add(this.mscpline);
DataTable dt = ServerHelper.GetData("com.steering.pss.plan.order.CoreSaleOrderOP.queryPlineDima",
new object[] { param }, this.ob);
GridHelper.CopyDataToDatatable(dt, dataTable1, true);
foreach (UltraGridRow uRow in ultraGrid1.Rows)
{
uRow.Cells["CHECK"].Value = true;
break;
}
}
///
/// 提取产线代码
///
///
public string getPlineCode()
{
return this.plinecode;
}
///
/// 提取坯料断面
///
///
public double getDimater()
{
return this.dimater;
}
///
/// 返回确认
///
///
public bool getIsConfirm()
{
return this.isConfirm;
}
///
/// 控制单选
///
///
///
private void ultraGrid1_CellChange(object sender, CellEventArgs e)
{
if (e.Cell.Column.Key.Equals("CHECK"))
{
if (Convert.ToBoolean(e.Cell.Row.Cells["CHECK"].Text))
{
foreach (UltraGridRow uRow in ultraGrid1.Rows)
{
if (uRow != e.Cell.Row)
{
uRow.Cells["CHECK"].Value = false;
}
}
}
}
}
private void ultraButtonConfirm_Click(object sender, EventArgs e)
{
foreach (UltraGridRow uRow in ultraGrid1.Rows)
{
if (Convert.ToBoolean(uRow.Cells["CHECK"].Text))
{
this.plinecode = uRow.Cells["PLINE_CODE"].Value.ToString();
this.dimater = Convert.ToDouble(uRow.Cells["DIMATER"].Value);
this.isConfirm = true;
this.Close();
return;
}
}
Core.Mes.Client.Comm.Tool.MessageUtil.ShowTips("请选择一条产线和坯料断面!");
}
private void ultraButtonCancel_Click(object sender, EventArgs e)
{
this.Close();
}
}
}