Example #1
0
        private void initDataGrid()
        {
            ConfigRotationController rotationController = new ConfigRotationController();
            List <RotationInfo>      rotationList       = rotationController.GetCurrentRotationInfos(experimentId);
            int startIndex = 1;

            foreach (RotationInfo rotation in rotationList)
            {
                System.Data.DataRow dRow = dataTable.NewRow();
                dRow["Number"]        = startIndex;
                dRow["RotationID"]    = rotation.RotationID;
                dRow["RotationName"]  = rotation.RotationName;
                dRow["OperationName"] = rotation.OperationName;
                dRow["TubesBatchID"]  = rotation.TubesBatchID;
                dRow["State"]         = rotationController.ConvertEnumStatusToText((RotationInfoStatus)rotation.State);
                dRow["logTitle"]      = "查看日志";
                if (rotation.TubesBatchID != null)
                {
                    TubesBatch tubeBatch = rotationController.GetTubesBatchByID((Guid)rotation.TubesBatchID);
                    if (tubeBatch != null)
                    {
                        dRow["TubesBatchName"] = tubeBatch.TubesBatchName;
                    }

                    if (new WanTai.Controller.PCR.PCRTestResultViewListController().CheckRotationHasPCRTestResult(rotation.RotationID, experimentId))
                    {
                        dRow["PCRTestResult"] = "查看";
                    }
                }

                if (startIndex % 2 == 0)
                {
                    dRow["Color"] = WindowCustomizer.alternativeColor;
                }
                else
                {
                    dRow["Color"] = WindowCustomizer.defaultColor;
                }

                dataTable.Rows.Add(dRow);
                startIndex++;
            }
        }
Example #2
0
        private void Page_Loaded(object sender, RoutedEventArgs e)
        {
            try
            {
                errorMessage.Text = "";
                List <RotationInfo> rotationList = controller.GetCurrentRotationInfos(SessionInfo.ExperimentID);
                if (rotationList.Count() > 0)
                {
                    this.create_button.IsEnabled = false;
                    if (SessionInfo.NextButIndex == 1)
                    {
                        this.next_button.IsEnabled = true;
                    }
                    else
                    {
                        this.next_button.IsEnabled = false;
                    }
                    this.save_button.IsEnabled      = false;
                    operation_viewcolumn.Visibility = System.Windows.Visibility.Visible;
                    operation_column.Visibility     = System.Windows.Visibility.Hidden;

                    foreach (RotationInfo rotation in rotationList)
                    {
                        System.Data.DataRow dRow = dataTable.NewRow();
                        dRow["Sequence"] = dataTable.Rows.Count + 1;
                        if (rotation.TubesBatchID != null)
                        {
                            dRow["TubesBatchID"] = rotation.TubesBatchID;
                            TubesBatch _tubeBatch = controller.GetTubesBatchByID((Guid)rotation.TubesBatchID);
                            dRow["TubesBatchName"] = _tubeBatch.TubesBatchName;
                        }

                        dRow["OperationName"] = rotation.OperationName;
                        dRow["Operation"]     = new OperationConfiguration()
                        {
                            OperationID = rotation.OperationID, OperationName = rotation.OperationName
                        };
                        dRow["RotationName"]    = rotation.RotationName;
                        dRow["deleteIsVisible"] = Visibility.Hidden.ToString();
                        dataTable.Rows.Add(dRow);
                    }
                }
                else
                {
                    this.create_button.IsEnabled    = true;
                    this.next_button.IsEnabled      = false;
                    this.save_button.IsEnabled      = true;
                    isBelongtoCurrentTubeBatch      = true;
                    operation_viewcolumn.Visibility = System.Windows.Visibility.Hidden;
                    operation_column.Visibility     = System.Windows.Visibility.Visible;

                    operation_viewcolumn.Visibility = System.Windows.Visibility.Hidden;
                    operation_column.Visibility     = System.Windows.Visibility.Visible;

                    tubesBatch = controller.GetLastTubesBatch();

                    List <OperationConfiguration> operationList = controller.GetDisplayedOperationConfigurations();
                    operation_column.ItemsSource = operationList;
                    CreateOperation = operationList[0];
                }
            }
            catch
            {
                MessageBox.Show("系统错误!", "系统提示!");

                //this.errorMessage.Text = "系统错误!";
            }
        }