| 123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105 |
- using System;
- using System.Collections.Generic;
- using System.ComponentModel;
- using System.Drawing;
- using System.Data;
- using System.Text;
- using System.Windows.Forms;
- using System.Collections;
- using Core.LgMes.Client.Comm;
- namespace Core.LgMes.Client.LgJobMgt
- {
- public partial class ucCasTimeInfo : UserControl
- {
- public ucCasTimeInfo()
- {
- InitializeComponent();
- CStaticMethod.SetUltraGridStyle(ultraGrid1, 1); //设置样式
- }
-
- private void ucCasTimeInfo_Load(object sender, EventArgs e)
- {
- ultraDataSource1.Rows.Add(new object[] { null, null, "", null, null, "", null, null, "" });
- }
- public void ResetData()
- {
- try
- {
- for (int i = 0; i < this.ultraDataSource1.Band.Columns.Count; i++)
- {
- if (this.ultraDataSource1.Band.Columns[i].DataType == typeof(System.DateTime))
- this.ultraDataSource1.Rows[0][i] = null;
- else
- this.ultraDataSource1.Rows[0][i] = "";
- }
- }
- 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(!string.IsNullOrEmpty(ar[strKey].ToString()))
- 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] = "";
- }
- 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]["ARRIVETIME"].ToString()) && !string.IsNullOrEmpty(this.ultraDataSource1.Rows[0]["LEAVETIME"].ToString()))
- this.ultraDataSource1.Rows[0]["REFINETIME"] = CStaticMethod.caculateTime(Convert.ToDateTime(this.ultraDataSource1.Rows[0]["ARRIVETIME"]), Convert.ToDateTime(this.ultraDataSource1.Rows[0]["LEAVETIME"]));
- else if (!string.IsNullOrEmpty(this.ultraDataSource1.Rows[0]["ARRIVETIME"].ToString()) && string.IsNullOrEmpty(this.ultraDataSource1.Rows[0]["LEAVETIME"].ToString()))
- this.ultraDataSource1.Rows[0]["REFINETIME"] = CStaticMethod.caculateTime(Convert.ToDateTime(this.ultraDataSource1.Rows[0]["ARRIVETIME"]), DateTime.Now);
- //吹氩时间
- if (!string.IsNullOrEmpty(this.ultraDataSource1.Rows[0]["BLOWARSTARTTIME"].ToString()) && !string.IsNullOrEmpty(this.ultraDataSource1.Rows[0]["BLOWARENDTIME"].ToString()))
- this.ultraDataSource1.Rows[0]["BLOWARTIME"] = CStaticMethod.caculateTime(Convert.ToDateTime(this.ultraDataSource1.Rows[0]["BLOWARSTARTTIME"]), Convert.ToDateTime(this.ultraDataSource1.Rows[0]["BLOWARENDTIME"]));
- else if (!string.IsNullOrEmpty(this.ultraDataSource1.Rows[0]["BLOWARSTARTTIME"].ToString()) && string.IsNullOrEmpty(this.ultraDataSource1.Rows[0]["BLOWARENDTIME"].ToString()))
- this.ultraDataSource1.Rows[0]["BLOWARTIME"] = CStaticMethod.caculateTime(Convert.ToDateTime(this.ultraDataSource1.Rows[0]["BLOWARSTARTTIME"]), DateTime.Now);
- //喂丝时间
- if (!string.IsNullOrEmpty(this.ultraDataSource1.Rows[0]["FEEDSILKBEGINTIME"].ToString()) && !string.IsNullOrEmpty(this.ultraDataSource1.Rows[0]["FEEDSILKCLOSETIME"].ToString()))
- this.ultraDataSource1.Rows[0]["FEEDSILKTIME"] = CStaticMethod.caculateTime(Convert.ToDateTime(this.ultraDataSource1.Rows[0]["FEEDSILKBEGINTIME"]), Convert.ToDateTime(this.ultraDataSource1.Rows[0]["FEEDSILKCLOSETIME"]));
- else if (!string.IsNullOrEmpty(this.ultraDataSource1.Rows[0]["FEEDSILKBEGINTIME"].ToString()) && string.IsNullOrEmpty(this.ultraDataSource1.Rows[0]["FEEDSILKCLOSETIME"].ToString()))
- this.ultraDataSource1.Rows[0]["FEEDSILKTIME"] = CStaticMethod.caculateTime(Convert.ToDateTime(this.ultraDataSource1.Rows[0]["FEEDSILKBEGINTIME"]), DateTime.Now);
- //CAS罩时间
- if (!string.IsNullOrEmpty(this.ultraDataSource1.Rows[0]["CASSTARTTIME"].ToString()) && !string.IsNullOrEmpty(this.ultraDataSource1.Rows[0]["CASENDTIME"].ToString()))
- this.ultraDataSource1.Rows[0]["CASTIME"] = CStaticMethod.caculateTime(Convert.ToDateTime(this.ultraDataSource1.Rows[0]["CASSTARTTIME"]), Convert.ToDateTime(this.ultraDataSource1.Rows[0]["CASENDTIME"]));
- else if (!string.IsNullOrEmpty(this.ultraDataSource1.Rows[0]["CASSTARTTIME"].ToString()) && string.IsNullOrEmpty(this.ultraDataSource1.Rows[0]["CASENDTIME"].ToString()))
- this.ultraDataSource1.Rows[0]["CASTIME"] = CStaticMethod.caculateTime(Convert.ToDateTime(this.ultraDataSource1.Rows[0]["CASSTARTTIME"]), DateTime.Now);
- }
- catch { }
- }
- }
- }
|