| 12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576777879808182838485868788899091929394 |
- using System;
- using System.Drawing;
- using System.Windows.Forms;
- using System.Collections;
- using Core.LgMes.Client.Comm;
- namespace Core.LgMes.Client.LgJobMgt
- {
- public partial class ucCcmDevInfo : UserControl
- {
- public ucCcmDevInfo()
- {
- InitializeComponent();
- CStaticMethod.SetUltraGridStyle(ultraGrid1, 2); //设置样式
- }
- public Image m_imageDefault = null;
- private void ucCcmDevInfo_Load(object sender, EventArgs e)
- {
- this.ultraDataSource1.Rows.Add(new object[] { "", "", "", "", "", "", "", "", "", "", "", "", m_imageDefault });
- }
- public void ResetData()
- {
- try
- {
- this.ultraDataSource1.Rows[0][0] = "";
- this.ultraDataSource1.Rows[0][1] = "";
- this.ultraDataSource1.Rows[0][2] = "";
- this.ultraDataSource1.Rows[0][3] = "";
- this.ultraDataSource1.Rows[0][4] = "";
- this.ultraDataSource1.Rows[0][5] = "";
- this.ultraDataSource1.Rows[0][6] = "";
- this.ultraDataSource1.Rows[0][7] = "";
- this.ultraDataSource1.Rows[0][8] = "";
- this.ultraDataSource1.Rows[0][9] = "";
- this.ultraDataSource1.Rows[0][10] = "";
- this.ultraDataSource1.Rows[0][11] = "";
- this.ultraDataSource1.Rows[0][12] = m_imageDefault;
- }
- catch { }
- }
- public void SetData(Hashtable ar)
- {
- if (ar == null || ar.Count == 0)
- return;
- int count = this.ultraDataSource1.Band.Columns.Count;
- string strKey = "";
- for (int i = 0; i < count; i++)
- {
- try
- {
- strKey = this.ultraDataSource1.Band.Columns[i].Key;
- if (ar.Contains(strKey))
- {
- if (strKey == "BALEFLOWFLAG" || strKey=="BALEMOULDFLAG") //大包是否自动引流
- {
- if (!string.IsNullOrEmpty(ar[strKey].ToString()))
- {
- if (ar[strKey].ToString() == "1")
- this.ultraDataSource1.Rows[0][i] = "是";
- else
- this.ultraDataSource1.Rows[0][i] = "否";
- }
- }
- else
- this.ultraDataSource1.Rows[0][i] = ar[strKey];
- }
- else
- {
- if (this.ultraDataSource1.Band.Columns[i].DataType == typeof(System.DateTime))
- this.ultraDataSource1.Rows[0][i] = null;
- else
- this.ultraDataSource1.Rows[0][i] = "";
- }
- }
- catch { }
- }
- try
- {
- if (!string.IsNullOrEmpty(this.ultraDataSource1.Rows[0]["PFBALEWGT"].ToString()) && !string.IsNullOrEmpty(this.ultraDataSource1.Rows[0]["MOULDBALEWGT"].ToString()))
- {
- if (Convert.ToDecimal(ultraDataSource1.Rows[0]["PFBALEWGT"]) >= Convert.ToDecimal(ultraDataSource1.Rows[0]["MOULDBALEWGT"]))
- this.ultraDataSource1.Rows[0]["JGZL"] = string.Format("{0:F1}", Convert.ToString(Convert.ToDecimal(ultraDataSource1.Rows[0]["PFBALEWGT"]) - Convert.ToDecimal(ultraDataSource1.Rows[0]["MOULDBALEWGT"])));
- }
- }
- catch { }
- }
- }
- }
|