Esempio n. 1
0
        private void Generate()
        {
            //由品名、批号、项目生成字符串,用于判断是否改变,若改变,则全部重新生成ts, lots, itemsToDo
            if (changeValidator != comboProj.SelectedValue + lot.Text + c1.SelectedValue + c2.SelectedValue + c3.SelectedValue + c4.SelectedValue)
            {
                changeValidator = comboProj.SelectedValue + lot.Text + c1.SelectedValue + c2.SelectedValue + c3.SelectedValue + c4.SelectedValue;
                ts   = new List <TaskSet>();
                lots = lot.Text.Split('\n', '\r').ToList();
                lots.RemoveAll(x => x == "");
                itemsToDo = new List <string>
                {
                    c1.Text
                };
                if (c2.Text != "")
                {
                    itemsToDo.Add(c2.Text);
                    if (c3.Text != "")
                    {
                        itemsToDo.Add(c3.Text);
                        if (c4.Text != "")
                        {
                            itemsToDo.Add(c4.Text);
                        }
                    }
                }
                foreach (var lotNo in lots)
                {
                    if (!ts.Contains(new TaskSet(lotNo, 1), new TaskSetComparer()))
                    {
                        ts.Add(new TaskSet(lotNo, itemsToDo.Count));
                    }
                }
                ts.RemoveAll(x => !lots.Contains(x.Lot));
            }
            var skipList = skip.Text.Split(',').ToList();

            skipList.RemoveAll(x => x == "");
            skipVial = skipList.Select(x => int.Parse(x)).ToList();
            //确认是否需要不同的STD
            if (itemsToDo.Count == 2 && !itemsToDo.Contains("有关物质") || itemsToDo.Count > 2)
            {
                stdTypes = new List <int>();
                foreach (var i in itemsToDo)
                {
                    requireDifferentStd = true;
                    stdTypes.Add(currentDataset.Find(x => x.Name == MethodEditor.Trans(i)).StdType);
                }
            }
            //特殊情况1:PRT有关物质和含量(或耐酸力)同时进行时,为FLD1,FLD2,LMD,YSY,KB1。。。
            //特殊情况2:GL有关物质若与含量合编,TW为STD2的瓶号
            //特殊情况3:CDN溶出样品后跟STD1为新瓶子
            currentAvailVial = 1;
            Dictionary <int, int> currentSTD1Vial = new Dictionary <int, int>();
        }
Esempio n. 2
0
 private void s4_Click(object sender, RoutedEventArgs e)
 {
     if (!c4.IsEnabled || c4.SelectedIndex == -1)
     {
         return;
     }
     me = new MethodEditor(comboProj.SelectedValue.ToString(), currentDataset, c4.SelectedValue.ToString(), 3, startIndexes)
     {
         ParentWindow = this
     };
     IsEnabled = false;
     me.Show();
 }