using System;
using System.Collections.Generic;
using System.ComponentModel;
using System.Drawing;
using System.Data;
using System.Linq;
using System.Text;
using System.Windows.Forms;
using CoreFS.CA06;
using Core.Mes.Client.Comm.Server;
using System.Diagnostics;
using Core.Mes.Client.Comm.Tool;
using Core.Mes.Client.Comm.Control;
using Infragistics.Win.UltraWinGrid;
using System.Collections;
namespace Core.StlMes.Client.SaleOrder
{
public partial class ctrlOrderLineChild : UserControl
{
DataSet childSet = new DataSet();
public ctrlOrderLineChild()
{
InitializeComponent();
}
///
/// 根据合同行查询相关子项
///
/// 传条DataRow合同行
/// DataSet
public DataSet loadOrderLineChild(OpeBase ob, UltraGridRow rows, DataTable orderLine)
{
ArrayList parm = new ArrayList();
if (rows == null || rows.Cells.Count == 0)
{
dataSetChild.Clear();
return null;
}
string seq = rows.Cells[69].Text;
//orderLine.Table.Rows.Add(rows.Cells[69].Text);
childSet.Tables.Clear();
//交货要求信息
/* DataTable dt = ServerHelper.GetData("com.steering.pss.sale.order.CoreOrderLineChild.GetQueryLineDelivery", new Object[] { rows.Cells["ORD_LN_PK"].Text }, ob);
GridHelper.CopyDataToDatatable(ref dt, ref this.SLM_ORDER_LINE_DELIVERY, true);
//运输路线
dt = ServerHelper.GetData("com.steering.pss.sale.order.CoreOrderLineChild.GetQueryTransitDelivery", new Object[] { rows.Cells["ORD_LN_PK"].Text }, ob);
GridHelper.CopyDataToDatatable(ref dt, ref this.SLM_ORDER_DELIVERY_TRANSIT, true);
//成分要求
dt = ServerHelper.GetData("com.steering.pss.sale.order.CoreOrderLineChild.GetQueryMscStdChem", new Object[] { rows.Cells["CUST_ALPHA_NO"].Text, rows.Cells["MSC"].Text, rows.Cells["MODEL_CODE"].Text }, ob);
GridHelper.CopyDataToDatatable(ref dt, ref this.COM_MSC_STD_CHEM, true);
//探伤要求
dt = ServerHelper.GetData("com.steering.pss.sale.order.CoreOrderLineChild.GetQueryMscStdDetection", new Object[] { rows.Cells["CUST_ALPHA_NO"].Text, rows.Cells["MSC"].Text, rows.Cells["MODEL_CODE"].Text }, ob);
GridHelper.CopyDataToDatatable(ref dt, ref this.COM_MSC_STD_DETECTION_C, true);
//水压要求
dt = ServerHelper.GetData("com.steering.pss.sale.order.CoreOrderLineChild.GetQueryMscStdWater", new Object[] { rows.Cells["CUST_ALPHA_NO"].Text, rows.Cells["MSC"].Text, rows.Cells["MODEL_CODE"].Text }, ob);
GridHelper.CopyDataToDatatable(ref dt, ref this.COM_MSC_STD_WATER_C, true);
//理化要求
dt = ServerHelper.GetData("com.steering.pss.sale.order.CoreOrderLineChild.GetQueryMscStdPic", new Object[] { rows.Cells["CUST_ALPHA_NO"].Text, rows.Cells["MSC"].Text, rows.Cells["MODEL_CODE"].Text }, ob);
GridHelper.CopyDataToDatatable(ref dt, ref this.COM_MSC_STD_PHY, true);
//公差要求
dt = ServerHelper.GetData("com.steering.pss.sale.order.CoreOrderLineChild.GetQueryMscStdSpec_c", new Object[] { rows.Cells["CUST_ALPHA_NO"].Text, rows.Cells["MSC"].Text, rows.Cells["MODEL_CODE"].Text }, ob);
GridHelper.CopyDataToDatatable(ref dt, ref this.COM_MSC_STD_SPEC_C, true);
//附加要求
dt = ServerHelper.GetData("com.steering.pss.sale.order.CoreOrderLineChild.GetQueryMscStdSpec_Tional", new Object[] { rows.Cells["ADD_ASK_NO"].Text, rows.Cells["MSC"].Text }, ob);
GridHelper.CopyDataToDatatable(ref dt, ref this.COM_BASE_ADDITIONAL, true);
//运输代办
foreach (UltraGridRow ugr in this.ultraGridTransit.Rows)
{
if (ugr.Cells["AGENCY_FL"].Value.ToString().ToLower().Equals("false"))
{
ugr.Cells["AGENCY_FL"].Value = true;
}
}
//公差选择项
foreach (UltraGridRow ugr in this.ultraGridSPEC_C.Rows)
{
if (ugr.Cells["STD_MIN_FORMULA_V"].Value.ToString().ToLower().Equals("1"))
{
ugr.Cells["STD_MIN_FORMULA_V"].Value = true;
}
if (ugr.Cells["STD_MIN_FORMULA_V"].Value.ToString().ToLower().Equals("0"))
{
ugr.Cells["STD_MIN_FORMULA_V"].Value = false;
}
if (ugr.Cells["STD_MAX_FORMULA_V"].Value.ToString().ToLower().Equals("1"))
{
ugr.Cells["STD_MAX_FORMULA_V"].Value = true;
}
if (ugr.Cells["STD_MAX_FORMULA_V"].Value.ToString().ToLower().Equals("0"))
{
ugr.Cells["STD_MAX_FORMULA_V"].Value = false;
}
if (ugr.Cells["ALPSTD_MIN_FORMULA_V"].Value.ToString().ToLower().Equals("1"))
{
ugr.Cells["ALPSTD_MIN_FORMULA_V"].Value = true;
}
if (ugr.Cells["ALPSTD_MIN_FORMULA_V"].Value.ToString().ToLower().Equals("0"))
{
ugr.Cells["ALPSTD_MIN_FORMULA_V"].Value = false;
}
if (ugr.Cells["ALPSTD_MAX_FORMULA_V"].Value.ToString().ToLower().Equals("1"))
{
ugr.Cells["ALPSTD_MAX_FORMULA_V"].Value = true;
}
if (ugr.Cells["ALPSTD_MAX_FORMULA_V"].Value.ToString().ToLower().Equals("0"))
{
ugr.Cells["ALPSTD_MAX_FORMULA_V"].Value = false;
}
}*/
DataTable linedt = orderLine.Copy();
for (int i = 0; i < linedt.Rows.Count; i++)
{
if (!seq.Equals(linedt.Rows[i]["ORDER_SEQ"].ToString()))
{
linedt.Rows.Remove(linedt.Rows[i]);
--i;
continue;
}
}
childSet.Tables.Add(linedt);
childSet.Tables.Add(this.SLM_ORDER_LINE_DELIVERY.Copy());
childSet.Tables.Add(this.SLM_ORDER_DELIVERY_TRANSIT.Copy());
childSet.Tables.Add(this.COM_MSC_STD_CHEM.Copy());
childSet.Tables.Add(this.COM_MSC_STD_DETECTION_C.Copy());
childSet.Tables.Add(this.COM_MSC_STD_WATER_C.Copy());
childSet.Tables.Add(this.COM_MSC_STD_PHY.Copy());
return childSet;
}
}
}