| 123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259 |
- 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 partial class FrmTVShows : FrmBase
- {
-
- public FrmTVShows()
- {
- InitializeComponent();
- }
-
- public FrmTVShows(OpeBase _ob)
- {
- InitializeComponent();
- // new CodeFile.FormMove(this, panel1);
- ob = _ob;
- }
- private static object sync = new object();
- private static FrmTVShows instance;
- public static FrmTVShows GetSingleton(OpeBase _ob)
- {
- lock (sync)
- {
- ;
- if (instance == null || instance.IsDisposed)
- instance = new FrmTVShows(_ob);
- }
- return instance;
- }
- private void timer1_Tick(object sender, EventArgs e)
- {
- Loadrecord();
- }
- ListViewItem itCall=null;
- 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;
- }
- else {
- tt = itCall.SubItems[1].Text;
- }
- itCall = null;
- if (tt != null)
- {
- tt += "请车号" + tt + "进来开票";
- BaseHelper.Speak(tt);
- }
- }
- 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)
- {
- lstCarNo.FullRowSelect = true;
- if (this.lstCarNo.SelectedItems.Count > 0)
- {
- itCall = lstCarNo.SelectedItems[0];
- 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 (i % 2 == 1)
- //{
- // 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 + " 车";
- }
- public void Recivied(string carno, string time)
- {
- Loadrecord();
- foreach (ListViewItem item in lstCarNo.Items)
- {
- if (carno == item.SubItems[1].Text && time == item.SubItems[2].Text)
- {
- item.BackColor = Color.Green;
- }
- }
- }
- private void FrmTVShow_Load(object sender, EventArgs e)
- {
- Loadrecord();
- this.WindowState = FormWindowState.Normal;
- }
-
- private void btnClose_Click(object sender, EventArgs e)
- {
- this.Close();
- }
- private void pictureBox1_Click(object sender, EventArgs e)
- {
- this.WindowState = FormWindowState.Maximized;
- }
- private void timer2_Tick(object sender, EventArgs e)
- {
- if (label1.Width + label1.Location.X < 0)
- {
- label1.Location = new Point(panel2.Width, 10);
- }
- else
- {
- label1.Location = new Point(label1.Location.X - 5,8);
- }
- labDate.Text = DateTime.Now.ToString();
- }
- }
- }
|