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 System.Collections; using Core.Mes.Client.Comm.Server; using Core.Mes.Client.Comm.Control; using Infragistics.Win.UltraWinGrid; using System.Speech.Synthesis; using Core.StlMes.Client.PipeLeaveFactory.Tool; namespace Core.StlMes.Client.PipeLeaveFactory { public delegate void delSetColor(string carNo, string time); public partial class FrmTVShow : FrmBase { // public delSetColor setLstColor; public FrmTVShow() { InitializeComponent(); } private void timer1_Tick(object sender, EventArgs e) { Loadrecord(); } delSetColor delsend; ListViewItem itCall = null; Color old; private void btnCall_Click(object sender, EventArgs e) { string tt; if (itCall == null) { tt = lstCarNo.Items[0].SubItems[1].Text; lstCarNo.Items[0].BackColor = Color.Green; delsend(lstCarNo.Items[0].SubItems[1].Text, lstCarNo.Items[0].SubItems[2].Text); } else { tt = itCall.SubItems[1].Text; delsend(itCall.SubItems[1].Text, itCall.SubItems[2].Text); } itCall = null; if (tt != null) { // setLstColor(tt); tt = "请车号" + tt + "进来开票"; BaseHelper.Speak(tt); } Loadrecord(); } void get() { int itemnum = this.lstCarNo.Items.Count; string[] str = { "D:", "本机磁盘", "10G", "6G" }; ListViewItem itm = new ListViewItem(str); itm.BackColor = Color.Green; this.lstCarNo.Items.Insert(itemnum, itm); } void del() { foreach (ListViewItem it in lstCarNo.Items) { if (it.SubItems[0].Text.Contains("A")) { lstCarNo.Items.Remove(it); } } } private void lstCarNo_ItemSelectionChanged(object sender, ListViewItemSelectionChangedEventArgs e) { if (itCall != null) { itCall.BackColor = old; itCall = null; } lstCarNo.FullRowSelect = true; if (this.lstCarNo.SelectedItems.Count > 0) { // if (itCall != null) // { // if (itCall != lstCarNo.SelectedItems[0]) // { // itCall.BackColor = old; // itCall = null; // } // } itCall = lstCarNo.SelectedItems[0]; old = lstCarNo.SelectedItems[0].BackColor; lstCarNo.SelectedItems[0].BackColor = Color.Green; // lstCarNo.SelectedItems[0].Selected = false; } } void Loadrecord() { // itm.BackColor = Color.FromArgb(((int)(((byte)(192)))), ((int)(((byte)(255)))), ((int)(((byte)(192))))); DataTable dtLoad = ServerHelper.GetData("com.steering.pss.ydm.pipeleavefactory.CorePipeCarBill.queryCarNoLoadvehicleBySteel", new Object[] { }, ob); if (dtLoad != null) { dtLoad.DefaultView.Sort = "CREATE_TIME ASC"; dtLoad = dtLoad.DefaultView.ToTable(); lstLoading.Items.Clear(); this.lstLoaded.Items.Clear(); // ArrayList ArrList = new ArrayList(); int i = 1; int t = 1; foreach (DataRow Dtr in dtLoad.Rows) { if (Dtr["AFFIRM_FLAG"].ToString() == "0") { int itemnum = this.lstLoading.Items.Count; string dr = Dtr["CREATE_TIME"].ToString().Trim(); string[] str = { i.ToString(), Dtr["VEHICLE_NO"].ToString(), dr.Substring(5, dr.Length - 8) }; ListViewItem itm = new ListViewItem(str); //if (i % 2 == 1)//不需要颜色 //{ // itm.BackColor = Color.FromArgb(((int)(((byte)(192)))), ((int)(((byte)(255)))), ((int)(((byte)(192)))));; //} this.lstLoading.Items.Insert(itemnum, itm); i++; } if (Dtr["AFFIRM_FLAG"].ToString() == "1" && Dtr["VEHICLE_NO"].ToString().Length > 3) { int itemnum = this.lstLoaded.Items.Count; string dr = Dtr["CREATE_TIME"].ToString().Trim(); string[] str = { t.ToString(), Dtr["VEHICLE_NO"].ToString(), dr.Substring(5, dr.Length - 8) }; ListViewItem itm = new ListViewItem(str); //if (t % 2 == 1)//不需要颜色 //{ // itm.BackColor = Color.FromArgb(((int)(((byte)(192)))), ((int)(((byte)(255)))), ((int)(((byte)(192)))));; //} this.lstLoaded.Items.Insert(itemnum, itm); t++; } } } DataTable dtCarNo = ServerHelper.GetData("com.steering.pss.ydm.pipeleavefactory.CorePipeCarBill.queryCarNoWeightInfoNewBySteel", new Object[] { }, ob); if (dtCarNo != null) { this.lstCarNo.Items.Clear(); // int i = 1; foreach (DataRow Dtr in dtCarNo.Rows) { int continues = 0; int finishs = 0; //todo判断是否完成 bool state = true; if(Dtr["VALIDFLAG"].ToString().Trim()!="1") { continue; } if (dtLoad != null)//判断车辆是否在提货中 { foreach (DataRow Dd in dtLoad.Rows) { if ((Dtr["CAR_NO"].ToString() == Dd["VEHICLE_NO"].ToString()) && Dd["AFFIRM_FLAG"].ToString() == "0") { // state = false; // break; finishs++; } } } foreach (DataRow Dd in dtCarNo.Rows) { if (Dtr["CAR_NO"].ToString() == Dd["CAR_NO"].ToString()) { // state = false; // break; continues++; } } if (state == true && continues > finishs) { int itemnum = this.lstCarNo.Items.Count; string dr = Dtr["RECORD_DATE"].ToString().Trim(); string[] str = { Dtr["NUM"].ToString(), Dtr["CAR_NO"].ToString(), dr.Substring(5, dr.Length - 8) }; ListViewItem itm = new ListViewItem(str); if (finishs != 0) { itm.BackColor = Color.FromArgb(((int)(((byte)(192)))), ((int)(((byte)(255)))), ((int)(((byte)(192)))));; } this.lstCarNo.Items.Insert(itemnum, itm); // i++; } } } labCarNo.Text = "共计 " + lstCarNo.Items.Count + " 车"; labLoad.Text = "共计 " + lstLoading.Items.Count + " 车"; labLoaded.Text = "共计 " + lstLoaded.Items.Count + " 车"; } private void FrmTVShow_Load(object sender, EventArgs e) { Loadrecord(); } private void btnFrm_Click(object sender, EventArgs e) { FrmTVShows form = FrmTVShows.GetSingleton(ob); // 有参数 form.Show(); form.Activate(); delsend = form.Recivied; } } }