private void Start_Factory() { string workWorderNo = dataGridView1.SelectedRows[0].Cells[3].Value.ToString(); try { int UPHperSecond = (int)itemList.Find(x => x.Item_Name == (dataGridView1.SelectedRows[0].Cells[5].Value.ToString())).IronUPH / 60 / 20; Random rnd = new Random((int)DateTime.UtcNow.Ticks); int faultyQty = rnd.Next(0, 2); TcpClient tc = new TcpClient("127.0.0.1", wcPortList.Find(x => x.Wc_Code == processWorkList.Find(y => y.Workorderno == workWorderNo).Wc_Code).Port_Num); NetworkStream stream = tc.GetStream(); string msg = $"{workWorderNo}/{processWorkList.Find(x => x.Workorderno == workWorderNo).Wc_Code}/{processWorkList.Find(x => x.Workorderno == workWorderNo).Plan_Qty}"; byte[] buff = Encoding.UTF8.GetBytes(msg); stream.Write(buff, 0, buff.Length); byte[] outBuff = new byte[2048]; int nbytes = stream.Read(outBuff, 0, outBuff.Length); string outMsg = Encoding.UTF8.GetString(outBuff, 0, nbytes); stream.Close(); tc.Close(); MoldStart_Vo vo = new MoldStart_Vo(); vo.Mold_Name = A; vo.Workorderno = work; MoldStart_Service service5 = new MoldStart_Service(); service5.MoldStartHistory(vo); } catch (Exception err) { MessageBox.Show($"{processWorkList.Find(y => y.Workorderno == workWorderNo).Wc_Code} 작업장이 비가동 중 입니다."); } }
public List <MoldStart_Vo> MoldEndHistory(MoldStart_Vo item) { using (SqlCommand cmd = new SqlCommand()) { cmd.Connection = new SqlConnection(this.ConnectionString); cmd.CommandText = "MoldEndHistory"; cmd.CommandType = CommandType.StoredProcedure; cmd.Parameters.AddWithValue("@Mold_Name", item.Mold_Name); cmd.Parameters.AddWithValue("@Workorderno", item.Workorderno); cmd.Connection.Open(); SqlDataReader reader = cmd.ExecuteReader(); List <MoldStart_Vo> list = Helper.DataReaderMapToList <MoldStart_Vo>(reader); cmd.Connection.Close(); return(list); } }
//private void initComboBox() //{ // MoldStart_Service service = new MoldStart_Service(); // MList = service.GetMoldName(work); // if (MList.Count > 0) // { // List<string> NonList = (from item in MList // select item.Mold_Name).ToList(); // CommonUtil.ComboBinding(comboBoxColu, NonList); // } //} private void btn_FieldClose_Click(object sender, EventArgs e) { if (start == "작업종료") { WorkOrder_Service service = new WorkOrder_Service(); service.deadlineWork(work); MoldStart_Vo vo = new MoldStart_Vo(); vo.Workorderno = work; vo.Mold_Name = A; MoldStart_Service service1 = new MoldStart_Service(); service1.MoldEndHistory(vo); SetLoad(); } else { MessageBox.Show("종료된 작업지시를 선택해주세요."); } }
public List <MoldStart_Vo> MoldEndHistory(MoldStart_Vo item) { MoldStart_Dac dac = new MoldStart_Dac(); return(dac.MoldEndHistory(item)); }