Example #1
0
 /// <summary>
 /// 显示条码规则列表
 /// </summary>
 public void ShowBarcodeTable()
 {
     foreach (var model in GetBarcodeList())
     {
         BarcodeList.Add(model);
     }
     ShowBarcodeList();
 }
        private void DdExcel(IEnumerable <Uri> urilist)
        {
            var excels = urilist.Select(s => s.LocalPath).ToList(); // Excel file(s) ??

            var message           = string.Empty;
            var inBarcode2samples = Proc.Several.BarcodeExcel.ReadBarcodeExcels(excels, ref message);

            // エクセルのエラー
            if (!string.IsNullOrEmpty(message))
            {
                ShowErrorDialog(message);
                return;
            }

            var newBarcodes = new ObservableCollection <Barcode2Name>();

            foreach (var barcode2sample in inBarcode2samples)  // エクセルから作成した barcode->sample
            {
                var sample = BarcodeList.Where(s => s.BarcodeNum.Equals(barcode2sample.BarcodeNum, StringComparison.OrdinalIgnoreCase))
                             .ToArray();

                // 元々のリストにあったサンプル名と同じサンプル名がエクセルから取得出来た場合
                if (sample.Any() && !string.IsNullOrEmpty(sample.First().SampleName))
                {
                    // sample.First().SampleName = barcode2sample.SampleName;
                    sample.First().SampleName = WfComponent.Utils.FileUtils.RemoveInvalidFileChar(barcode2sample.SampleName);
                    sample.First().FontWeight = userNameWeight;
                    sample.First().FontColor  = userNameColor;
                }
                else
                {
                    // エクセルからバーコード名が取れない(空セル)か、ヘッダ文字
                    if (string.IsNullOrEmpty(barcode2sample.BarcodeNum) ||
                        barcode2sample.BarcodeNum.Equals(Proc.Several.BarcodeExcel.BarcodeHeader, StringComparison.OrdinalIgnoreCase))
                    {
                        continue;
                    }


                    // エクセルから新規に追加された
                    BarcodeList.Add(new Barcode2Name()
                    {
                        BarcodeName = barcode2sample.BarcodeName,
                        BarcodeNum  = barcode2sample.BarcodeNum,
                        SampleName  = WfComponent.Utils.FileUtils.RemoveInvalidFileChar(barcode2sample.SampleName),
                        FontWeight  = userNameWeight,
                        FontColor   = userNameColor,
                    });
                }
            }
        }
Example #3
0
        protected override Dictionary <Product, IEnumerable <string> > GetValues(List <Product> objs)
        {
            BarcodeList         list            = null;
            IList <BarcodeList> partNumberLists = _session.QueryOver <ProductVariant>()
                                                  .Where(x => x.Barcode != null && x.Barcode != "")
                                                  .SelectList(builder => builder
                                                              .Select(variant => variant.Barcode).WithAlias(() => list.Barcode)
                                                              .Select(variant => variant.Product.Id).WithAlias(() => list.ProductId)
                                                              )
                                                  .TransformUsing(Transformers.AliasToBean <BarcodeList>())
                                                  .List <BarcodeList>();
            Dictionary <int, IEnumerable <string> > dictionary = partNumberLists.GroupBy(skuList => skuList.ProductId)
                                                                 .ToDictionary(lists => lists.Key, lists => lists.Select(partNumberList => partNumberList.Barcode));

            return(objs.ToDictionary(product => product,
                                     product => dictionary.ContainsKey(product.Id) ? dictionary[product.Id] : Enumerable.Empty <string>()));
        }
Example #4
0
        public static void SP_WCS_PCS_BARCODE_SCAN(string P_INDUCT_DATE, decimal P_PRODUCT_ID, int P_SCAN_TYPE, string P_BARCODE, int P_CART_NO, int P_BCR_LOC)
        {
            string procedureName = "SP_WCS_PCS_BARCODE_SCAN";

            using (OracleConnection oracleConnection = new OracleConnection(_connectionString))
            {
                oracleConnection.Open();

                OracleCommand oracleCommand = new OracleCommand(procedureName, oracleConnection);

                oracleCommand.CommandType = CommandType.StoredProcedure;

                oracleCommand.Parameters.Clear();
                oracleCommand.Parameters.Add("P_INDUCT_DATE", OracleDbType.Varchar2, 32767).Value = P_INDUCT_DATE;
                oracleCommand.Parameters.Add("P_PRODUCT_ID", OracleDbType.Decimal).Value          = P_PRODUCT_ID;
                oracleCommand.Parameters.Add("P_SCAN_TYPE", OracleDbType.Int32, 32767).Value      = P_SCAN_TYPE;
                oracleCommand.Parameters.Add("P_BARCODE", OracleDbType.Varchar2, 32767).Value     = P_BARCODE;
                oracleCommand.Parameters.Add("P_CART_NO", OracleDbType.Int32).Value = P_CART_NO;
                oracleCommand.Parameters.Add("P_BCR_LOC", OracleDbType.Int32).Value = P_BCR_LOC;

                oracleCommand.Parameters.Add("P_RTN_FLAG", OracleDbType.Varchar2, 32767).Direction = ParameterDirection.Output;
                oracleCommand.Parameters.Add("P_ERR_MSG", OracleDbType.Varchar2, 32767).Direction  = ParameterDirection.Output;
                oracleCommand.Parameters.Add("P_DEST_CHUTE", OracleDbType.Int32).Direction         = ParameterDirection.Output;
                oracleCommand.Parameters.Add("P_LAST_FLAG", OracleDbType.Int32).Direction          = ParameterDirection.Output;

                oracleCommand.ExecuteNonQuery();

                oracleConnection.Close();

                /*
                 * return _returnFlag = oracleCommand.Parameters["P_RTN_FLAG"].Value.ToString()
                 + oracleCommand.Parameters["P_ERR_MSG"].Value.ToString()
                 + oracleCommand.Parameters["P_DEST_CHUTE"].Value.ToString()
                 + oracleCommand.Parameters["P_LAST_FLAG"].Value.ToString();
                 */
                BarcodeList.SetValue("P_RTN_FLAG", oracleCommand.Parameters["P_RTN_FLAG"].Value.ToString());
                BarcodeList.SetValue("P_ERR_MSG", oracleCommand.Parameters["P_ERR_MSG"].Value.ToString());
                BarcodeList.SetValue("P_DEST_CHUTE", oracleCommand.Parameters["P_DEST_CHUTE"].Value.ToString());
                BarcodeList.SetValue("P_LAST_FLAG", oracleCommand.Parameters["P_LAST_FLAG"].Value.ToString());
            }
        }
Example #5
0
        private async Task ExecuteLoadItemsCommand()
        {
            IsBusy = true;

            try
            {
                BarcodeList.Clear();
                var items = await BarcodeRepository.GetAllAsync();

                foreach (var item in items)
                {
                    BarcodeList.Add(item);
                }
            }
            catch (Exception ex)
            {
                Debug.WriteLine(ex);
            }
            finally
            {
                IsBusy = false;
            }
        }
Example #6
0
 /// <summary>
 /// 构建条码
 /// </summary>
 /// <param name="pageWidth">页宽</param>
 /// <param name="pageHeight">页高</param>
 public ZicoxPrintClient BuildBarcode(int pageWidth, int pageHeight)
 {
     BarcodeList.ForEach(x => CommandBuilder.DrawBarcode(pageWidth, pageHeight, x));
     return(this);
 }
Example #7
0
        /// <数据更新保存>
        ///
        /// </数据更新保存>
        /// <param name="rst">结果</param>
        /// <param name="index_i">穴位索引</param>
        private void UpdateTester(int rst, int index_i)
        {
            /*result = 0 -> Ng
             * result = 1 -> Pass
             * result = 2 -> Timeout
             */
            switch (rst)
            {
            case 0:
                testStatus[index_i] = TestStatus.Tested;
                testResult[index_i] = TestResult.Ng;
                if (!IsInSampleMode)
                {
                    ushort barstrnum = 0;
                    if (BarcodeList.Count > 0)
                    {
                        foreach (string barcode in BarcodeList)
                        {
                            if (TesterBracode[index_i] == barcode)
                            {
                                barstrnum++;
                            }
                        }
                    }
                    if (barstrnum < 1)
                    {
                        FailCount_Nomal[index_i]++;
                    }
                    else
                    {
                        PassCount_Nomal[index_i]++;
                    }
                }

                break;

            case 1:
                testStatus[index_i] = TestStatus.Tested;
                testResult[index_i] = TestResult.Pass;
                if (!IsInSampleMode)
                {
                    PassCount_Nomal[index_i]++;
                }

                break;

            case 2:
                testStatus[index_i] = TestStatus.Tested;
                testResult[index_i] = TestResult.TimeOut;
                break;

            default:
                testStatus[index_i] = TestStatus.Err;
                testResult[index_i] = TestResult.TimeOut;
                break;
            }
            if (!IsInSampleMode)
            {
                TestCount_Nomal[index_i]++;
                BarcodeList.Add(TesterBracode[index_i]);
            }
            if (!IsInSampleMode)
            {
                if (PassCount_Nomal[index_i] + FailCount_Nomal[index_i] != 0)
                {
                    Yield_Nomal[index_i] = Math.Round((double)PassCount_Nomal[index_i] / (PassCount_Nomal[index_i] + FailCount_Nomal[index_i]) * 100, 2);
                }
                else
                {
                    Yield_Nomal[index_i] = 0;
                }
            }

            try
            {
                if (!IsInSampleMode)
                {
                    Inifile.INIWriteValue(iniTesterResutPath, "Tester" + (Index * 2 + index_i).ToString(), "TestSpan", TestSpan[index_i].ToString());
                    Inifile.INIWriteValue(iniTesterResutPath, "Tester" + (Index * 2 + index_i).ToString(), "PassCount_Nomal", PassCount_Nomal[index_i].ToString());
                    Inifile.INIWriteValue(iniTesterResutPath, "Tester" + (Index * 2 + index_i).ToString(), "FailCount_Nomal", FailCount_Nomal[index_i].ToString());
                    Inifile.INIWriteValue(iniTesterResutPath, "Tester" + (Index * 2 + index_i).ToString(), "TestCount_Nomal", TestCount_Nomal[index_i].ToString());
                    Inifile.INIWriteValue(iniTesterResutPath, "Tester" + (Index * 2 + index_i).ToString(), "Yield_Nomal", Yield_Nomal[index_i].ToString());
                }
            }
            catch
            {
            }
        }