Example #1
0
        // 서버에 연결하는 코드
        private void ConnectServer()
        {
            POPService service = new POPService();

            client = new POPClient()
            {
                performance_id = this.performance_id
            };
            if (client.Connect())
            {
                client.production_id         = production_id;
                client.performance_qtyimport = Convert.ToInt32(txtcount.Text);
                client.time = service.setTacttime(txtProductID.Text);
                client.Certification();
            }
        }
Example #2
0
        // 생산을 시작하는 경우
        public void ProduceStart()
        {
            try
            {
                if (production_state == "작업대기")
                {
                    POPService service = new POPService();
                    bool       bresult = service.updatePOP(wo_id, production_id);
                    if (!bresult)
                    {
                        return;
                    }
                    DGV_Binding();
                    changePeriod();
                    //서버와 연결되어있지 않은경우
                    if (!client.Connected)
                    {
                        bool bConnect = client.Connected;

                        if (!bConnect)
                        {
                            MessageBox.Show("서버와 다시 연결합니다");
                            ConnectServer();
                        }
                    }
                    //서버와 연결된 경우 (정상실행)
                    else
                    {
                        MessageBox.Show("서버와 연결되었습니다.");
                        tacttime = service.setTacttime(product_id);
                        GetCount();
                    }
                }
                else
                {
                    MessageBox.Show("작업대기상태인 지시만 실행시켜주세요.");
                }
            }
            catch (Exception ex)
            {
                WriteLog(ex);
            }
        }