using System;
using System.Collections.Generic;
using System.ComponentModel;
using System.Drawing;
using System.Data;
using System.Collections;
using System.Text;
using System.Windows.Forms;
using CoreFS.CA06;
//using Core.LgMes.Client.LgJobMgt;
using Core.Mes.Client.Common;
namespace Core.LgMes.Client.LgResMgt
{
public partial class ucTempManualSampling : UserControl
{
public OpeBase ob = null;
private DataTable _dtSample = null; // 温度采样数据表
public ucTempManualSampling()
{
InitializeComponent();
}
///
/// 获取温度采样数据
///
/// 熔炼号
/// 岗位编码(例C01)
/// 处理次数(例01)
public void GetSampleData(string _smeltingID, string _stationCode, string _dealTime)
{
DataSet ds = new DataSet();
string strSqlT = "";
string strTableName = "";
string strArmName = "''";
string strA = "";
string strB = "";
switch (_stationCode)
{
case "G01":
strTableName = "stl_ccm_f1sampling";
strA = "ARM1BIGPOTTOTALWEIGHT";
strB = "ARM2BIGPOTTOTALWEIGHT";
break;
case "G02":
strTableName = "stl_ccm_f2sampling";
strA = "ARM1BIGPOTTOTALWEIGHT";
strB = "ARM2BIGPOTTOTALWEIGHT";
break;
case "G04":
strTableName = "stl_ccm_f4sampling";
strA = "ARM1BIGPOTTOTALWEIGHT";
strB = "ARM2BIGPOTTOTALWEIGHT";
break;
case "G03":
strTableName = "stl_ccm_f3sampling";
strA = "ARM1BIGPOTTOTALWEIGHT";
strB = "ARM2BIGPOTTOTALWEIGHT";
break;
default:
break;
}
string strErr = "";
ArrayList arry = new ArrayList();
ArrayList sqlList = new ArrayList();
arry.Add("GetCmmManualTemp.select");
sqlList.Add(strTableName);
arry.Add(_smeltingID);
arry.Add(_dealTime);
sqlList.Add(strTableName);
arry.Add(_smeltingID);
arry.Add(_dealTime);
CoreFS.CA06.FrmBase fr = new FrmBase();
fr.ob = ob;
CoreClientParam CCP_Query = new CoreClientParam();
DataTable dt = new DataTable();
CCP_Query.ServerName = "Core.LgMes.Server.Common.ComDBQuery";
CCP_Query.MethodName = "doQuery";
CCP_Query.ServerParams = new object[] { arry, sqlList };
CCP_Query.SourceDataTable = dt;
fr.ExecuteQueryToDataTable(CCP_Query, CoreInvokeType.Internal);
ds.Tables.Add(dt);
if (strErr == "" && dt != null)
{
if (ds.Tables[0].Rows.Count > 0)
//strArmName = ds.Tables[0].Rows[0]["armbigpottotalweight"].ToString();
strArmName = ds.Tables[0].Rows[0]["lastfreshtime"].ToString();
}
ArrayList arrySample = new ArrayList();
switch (_stationCode)
{
case "G01":
arrySample.Add("GetSampleDataOne.select");
break;
case "G02":
arrySample.Add("GetSampleDataTwo.select");
break;
case "G03":
arrySample.Add("GetSampleDataThree.select");
break;
case "G04":
arrySample.Add("GetSampleDataFour.select");
break;
default:
break;
}
arrySample.Add(_smeltingID);
arrySample.Add(_dealTime);
arrySample.Add(_smeltingID);
arrySample.Add(_dealTime);
arrySample.Add(_smeltingID);
arrySample.Add(_dealTime);
arrySample.Add(_smeltingID);
arrySample.Add(_dealTime);
CommonClientToServer cctostwo = new CommonClientToServer();
cctostwo.ob = this.ob;
DataSet dsSample = cctostwo.ExecuteQueryFunctions("Core.LgMes.Server.Common.ComDBQuery",
"doSimpleQuery", arrySample, out strErr);
if (strErr == "" && dsSample != null)
{
_dtSample = dsSample.Tables[0];
}
}
///
/// 填充温度信息界面数据
///
public void FillTemperatureData()
{
try
{
lock (this)
{
dsSample.Tables[0].Clear();
dsSample.Tables[0].Merge(_dtSample);
this.ultgridTemp.DisplayLayout.Bands[0].Columns[0].Width = 60;
this.ultgridTemp.DisplayLayout.Bands[0].Columns[0].CellActivation = Infragistics.Win.UltraWinGrid.Activation.NoEdit;
this.ultgridTemp.DisplayLayout.Bands[0].Columns[0].Header.Caption = "温度值";
this.ultgridTemp.DisplayLayout.Bands[0].Columns[1].Width = 140;
this.ultgridTemp.DisplayLayout.Bands[0].Columns[1].CellActivation = Infragistics.Win.UltraWinGrid.Activation.NoEdit;
this.ultgridTemp.DisplayLayout.Bands[0].Columns[1].Header.Caption = "采样时间";
this.ultgridTemp.DisplayLayout.Bands[0].Columns[2].Width = 60;
this.ultgridTemp.DisplayLayout.Bands[0].Columns[2].CellActivation = Infragistics.Win.UltraWinGrid.Activation.NoEdit;
this.ultgridTemp.DisplayLayout.Bands[0].Columns[2].Header.Caption = "1流";
this.ultgridTemp.DisplayLayout.Bands[0].Columns[3].Width = 60;
this.ultgridTemp.DisplayLayout.Bands[0].Columns[3].CellActivation = Infragistics.Win.UltraWinGrid.Activation.NoEdit;
this.ultgridTemp.DisplayLayout.Bands[0].Columns[3].Header.Caption = "2流";
this.ultgridTemp.DisplayLayout.Bands[0].Columns[4].Width = 60;
this.ultgridTemp.DisplayLayout.Bands[0].Columns[4].CellActivation = Infragistics.Win.UltraWinGrid.Activation.NoEdit;
this.ultgridTemp.DisplayLayout.Bands[0].Columns[4].Header.Caption = "3流";
this.ultgridTemp.DisplayLayout.Bands[0].Columns[5].Width = 60;
this.ultgridTemp.DisplayLayout.Bands[0].Columns[5].CellActivation = Infragistics.Win.UltraWinGrid.Activation.NoEdit;
this.ultgridTemp.DisplayLayout.Bands[0].Columns[5].Header.Caption = "4流";
this.ultgridTemp.DisplayLayout.Bands[0].Columns[6].Width = 60;
this.ultgridTemp.DisplayLayout.Bands[0].Columns[6].CellActivation = Infragistics.Win.UltraWinGrid.Activation.NoEdit;
this.ultgridTemp.DisplayLayout.Bands[0].Columns[6].Header.Caption = "5流";
this.ultgridTemp.DisplayLayout.Bands[0].Columns[7].Width = 70;
this.ultgridTemp.DisplayLayout.Bands[0].Columns[7].CellActivation = Infragistics.Win.UltraWinGrid.Activation.NoEdit;
this.ultgridTemp.DisplayLayout.Bands[0].Columns[7].Header.Caption = "中包重量";
this.ultgridTemp.DisplayLayout.Bands[0].Columns[8].Width = 70;
this.ultgridTemp.DisplayLayout.Bands[0].Columns[8].CellActivation = Infragistics.Win.UltraWinGrid.Activation.NoEdit;
this.ultgridTemp.DisplayLayout.Bands[0].Columns[8].Header.Caption = "大包重量";
}
}
catch (Exception ex)
{
string Msg = ex.Message;
}
}
private void ucTempManualSampling_Load(object sender, EventArgs e)
{
}
}
}