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 Common;
using System.Collections;
namespace Core.LZMes.Client.UIF
{
public partial class UIF051010 : CoreFS.CA06.FrmBase
{
public UIF051010()
{
InitializeComponent();
}
#region "Grid Event"
///
/// 双击记录行弹出窗体,获取冷轧原料的详细信息(满足的双击记录行为条件)
///
/// 控件
///
private void ugrd_DoubleClickRow(object sender, Infragistics.Win.UltraWinGrid.DoubleClickRowEventArgs e)
{
//try
//{
// if (e.Row != null && FixDBManager.CheckNullStr(e.Row.Cells["CONDITION_"].Value).Length > 0)
// {
// string _Condition = FixDBManager.CheckNullStr(e.Row.Cells["CONDITION_"].Value);
// UIF051010 dlg_frm = new UIF051010();
// dlg_frm.ob = this.ob;
// dlg_frm.Condition = " AND " + _Condition;
// dlg_frm.ShowDialog();
// }
//}
//catch (System.Exception ex)
//{
// System.Diagnostics.Debug.WriteLine(ex.ToString());
//}
}
#endregion
#region "ToolBar Event"
public override void ToolBar_Click(object sender, string ToolbarKey)
{
try
{
switch (ToolbarKey)
{
case "Query":
Query_Slab_State();
break;
case "Exit":
this.Close();
break;
}
}
catch (System.Exception ex)
{
System.Diagnostics.Debug.WriteLine(ex.ToString());
}
}
private void Query_Slab_State()
{
try
{
CoreClientParam ccp = new CoreClientParam();
ccp.ServerName = "UIF.UIF04.UIF041010";
ccp.MethodName = "Query_Slab_State";
ccp.ServerParams = new object[] { "CAL" };
CoreClientParam obj = this.ExecuteQuery(ccp, CoreInvokeType.Internal);
if (obj.ReturnInfo.Length == 0)
{
System.Collections.ArrayList rtnobj = obj.ReturnObject as System.Collections.ArrayList;
if (rtnobj[0] != null)
{
this.dataSet1.Tables["TAB_HEIGHT"].Clear();
System.Data.DataTable tab0 = FixDBManager.ConvertToDataTable(rtnobj[0] as System.Collections.ArrayList, this.dataSet1.Tables["TAB_HEIGHT"]);
tab0.TableName = "TAB_HEIGHT";
this.dataSet1.Tables["TAB_HEIGHT"].Merge(tab0);
}
if (rtnobj[1] != null)
{
this.dataSet1.Tables["TAB_WIDTH"].Clear();
System.Data.DataTable tab1 = FixDBManager.ConvertToDataTable(rtnobj[1] as System.Collections.ArrayList, this.dataSet1.Tables["TAB_WIDTH"]);
tab1.TableName = "TAB_WIDTH";
this.dataSet1.Tables["TAB_WIDTH"].Merge(tab1);
}
if (rtnobj[2] != null)
{
this.dataSet1.Tables["TAB_APPEARANCE"].Clear();
System.Data.DataTable tab2 = FixDBManager.ConvertToDataTable(rtnobj[2] as System.Collections.ArrayList, this.dataSet1.Tables["TAB_APPEARANCE"]);
tab2.TableName = "TAB_APPEARANCE";
this.dataSet1.Tables["TAB_APPEARANCE"].Merge(tab2);
}
if (rtnobj[3] != null)
{
this.dataSet1.Tables["TAB_CODETIEM"].Clear();
System.Data.DataTable tab3 = FixDBManager.ConvertToDataTable(rtnobj[3] as System.Collections.ArrayList, this.dataSet1.Tables["TAB_CODETIEM"]);
tab3.TableName = "TAB_CODETIEM";
this.dataSet1.Tables["TAB_CODETIEM"].Merge(tab3);
}
if (rtnobj[4] != null)
{
this.dataSet1.Tables["TAB_STEEL"].Clear();
System.Data.DataTable tab4 = FixDBManager.ConvertToDataTable(rtnobj[4] as System.Collections.ArrayList, this.dataSet1.Tables["TAB_STEEL"]);
tab4.TableName = "TAB_STEEL";
this.dataSet1.Tables["TAB_STEEL"].Merge(tab4);
}
if (rtnobj[5] != null)
{
this.dataSet1.Tables["TAB_COMMODITY"].Clear();
System.Data.DataTable tab5 = FixDBManager.ConvertToDataTable(rtnobj[5] as System.Collections.ArrayList, this.dataSet1.Tables["TAB_COMMODITY"]);
tab5.TableName = "TAB_COMMODITY";
this.dataSet1.Tables["TAB_COMMODITY"].Merge(tab5);
}
this.dataSet1.AcceptChanges();
}
}
catch (System.Exception ex)
{
System.Diagnostics.Debug.WriteLine(ex.ToString());
}
}
#endregion
#region "Init"
private void UIF041010_Load(object sender, EventArgs e)
{
try
{
int panel_Width = (this.Parent.FindForm().Width - 12) / 2;
int col_Width = panel_Width - 89 * 4;
this.panel1.Width = panel_Width;
this.ugrd_Height.DisplayLayout.Bands[0].Columns["TYPE_"].RowLayoutColumnInfo.PreferredCellSize = new System.Drawing.Size(col_Width, 0);
this.ugrd_Width.DisplayLayout.Bands[0].Columns["TYPE_"].RowLayoutColumnInfo.PreferredCellSize = new System.Drawing.Size(col_Width, 0);
this.ugrd_Apperaance.DisplayLayout.Bands[0].Columns["TYPE_"].RowLayoutColumnInfo.PreferredCellSize = new System.Drawing.Size(col_Width, 0);
this.ugrd_ColdTime.DisplayLayout.Bands[0].Columns["TYPE_"].RowLayoutColumnInfo.PreferredCellSize = new System.Drawing.Size(col_Width, 0);
this.ugrd_Steel.DisplayLayout.Bands[0].Columns["TYPE_"].RowLayoutColumnInfo.PreferredCellSize = new System.Drawing.Size(col_Width, 0);
this.ugrd_Commodity.DisplayLayout.Bands[0].Columns["TYPE_"].RowLayoutColumnInfo.PreferredCellSize = new System.Drawing.Size(col_Width, 0);
}
catch (System.Exception ex)
{
System.Diagnostics.Debug.WriteLine(ex.ToString());
}
}
#endregion
}
}