Exemplo n.º 1
0
        public int sprawdzanieMES(string SerialTxt)
        {
            using (MESwebservice.BoardsSoapClient wsMES = new MESwebservice.BoardsSoapClient("BoardsSoap"))
            {
                DataSet Result;
                try
                {
                    Result = wsMES.GetBoardHistoryDS(@"itron", SerialTxt);
                }
                catch
                {
                    return(M_BRAK_POLACZENIA_Z_MES);
                }

                var Test = Result.Tables[0].TableName;
                if (Test != "BoardHistory")
                {
                    return(M_NIENARODZONY);                        //numer produktu nie widnieje w systemie MES
                }
                var data = (from row in Result.Tables["BoardHistory"].AsEnumerable()
                            where row.Field <string>("Test_Process").ToUpper() == "FVT / FVT_INNER_SEAL".ToUpper() || row.Field <string>("Test_Process").ToUpper() == "FVT / FVT_INNER_SEAL".ToUpper()
                            select new
                {
                    TestProcess = row.Field <string>("Test_Process"),
                    TestType = row.Field <string>("TestType"),
                    TestStatus = row.Field <string>("TestStatus"),
                    StartDateTime = row.Field <DateTime>("StartDateTime"),
                    StopDateTime = row.Field <DateTime>("StopDateTime"),
                }).FirstOrDefault();


                if (data != null)
                {
                    //sprawdzamy PASS w poprzednim kroku
                    if ("PASS" == data.TestStatus.ToUpper())
                    {
                        return(0);                                     //wszystko jest OK
                    }
                    else
                    {
                        return(M_FAIL);
                    }
                }
                else
                {
                    return(M_BRAK_KROKU); //brak poprzedniego kroku
                }
            }
        }
Exemplo n.º 2
0
 public int Test1(string SerialTxt)
 {
     using (MESwebservice.BoardsSoapClient wsMES = new MESwebservice.BoardsSoapClient("BoardsSoap"))
     {
         DataSet Result;
         try
         {
             Result = wsMES.GetBoardHistoryDS(@"itron", SerialTxt);
         }
         catch
         {
             return(M_BRAK_POLACZENIA_Z_MES);
         }
     }
     return(1);
 }
Exemplo n.º 3
0
        public int Test1(string SerialTxt)
        {
            using (MESwebservice.BoardsSoapClient wsMES = new MESwebservice.BoardsSoapClient("BoardsSoap"))
            {
                DataSet Result;
                try
                {
                    Result = wsMES.GetBoardHistoryDS(@"itron", SerialTxt);
                }
                catch
                {
                    return(M_BRAK_POLACZENIA_Z_MES);
                }

                var Test = Result.Tables[0].TableName;
                if (Test != "BoardHistory")
                {
                    return(M_NIENARODZONY);                        //numer produktu nie widnieje w systemie MES
                }
                switch (TypTestera)
                {
                case T_BRIDLE:
                    TxtTestProcess = "Link / LINK_BB1".ToUpper();
                    TxtTestType    = "Movement Both".ToUpper();
                    MessageBox.Show("TxtTestProcess:", TxtTestProcess, MessageBoxButtons.OK);
                    break;

                case T_SHELL:
                    TxtTestProcess = "QC / TEST_VERIFY".ToUpper();
                    TxtTestType    = "TEST".ToUpper();
                    break;

                case T_PRERUN:
                    TxtTestProcess = "QC / SILICON".ToUpper();
                    TxtTestType    = "TEST".ToUpper();
                    break;

                case T_VALVE:
                    TxtTestProcess = "QC / CHECK_PRERUN".ToUpper();
                    TxtTestType    = "TEST".ToUpper();
                    break;


                case T_MY_PC:
                    TxtTestProcess = "QC / SILICON".ToUpper();
                    TxtTestType    = "TEST".ToUpper();
                    break;

                default:
                case MOJ:
                    TxtTestProcess = "QC / FVT_SZ_VALVE".ToUpper();
                    TxtTestType    = "TEST".ToUpper();
                    break;
                }

                var data = (from row in Result.Tables["BoardHistory"].AsEnumerable()
                            where row.Field <string>("Test_Process").ToUpper() == TxtTestProcess && row.Field <string>("TestType").ToUpper() == TxtTestType
                            select new
                {
                    TestProcess = row.Field <string>("Test_Process"),
                    TestType = row.Field <string>("TestType"),
                    TestStatus = row.Field <string>("TestStatus"),
                    StartDateTime = row.Field <DateTime>("StartDateTime"),
                    StopDateTime = row.Field <DateTime>("StopDateTime"),
                }).FirstOrDefault();


                if (data != null)
                {
                    //sprawdzamy PASS w poprzednim kroku
                    if ("PASS" == data.TestStatus.ToUpper())
                    {
                        return(0);                                     //wszystko jest OK
                    }
                    else
                    {
                        return(M_FAIL);
                    }
                }
                else
                {
                    return(M_BRAK_KROKU); //brak poprzedniego kroku
                }
            }
        }