Ejemplo n.º 1
0
            public override void OnEditEnded(CellContext sender, System.EventArgs e)
            {
                base.OnEditEnded(sender, e);
                InputGridBase grid = (InputGridBase)sender.Grid;

                //if (grid[sender.Position.Row, sender.Position.Column].Value == null)
                //    return;
                grid.UpdateRow(sender.Position.Row - grid.FixedRows, sender.Position.Column - grid.FixedColumns);

                //grid.Columns.AutoSize(true);
                //grid.Rows.AutoSize(true);
                //SourceGrid.Grid grid = (SourceGrid.Grid)sender.Grid;
                if (bEnterClick)
                {
                    if (sender.Position.Row < grid.RowsCount - 1)
                    {
                        grid[sender.Position.Row + 1, sender.Position.Column].Focus();
                    }
                    else if (sender.Position.Column < grid.ColumnsCount - 1)
                    {
                        grid[grid.FixedRows, sender.Position.Column + 1].Focus();
                    }
                    bEnterClick = false;
                }
                //if (sender.Position.Column < grid.Columns.Count - 1)
                //    grid[sender.Position.Row, sender.Position.Column + 1].Focus();
                //else if (sender.Position.Row < grid.Rows.Count - 1)
                //    grid[sender.Position.Row + 1, grid.FixedColumns].Focus();
            }
Ejemplo n.º 2
0
 private void SampleDataInputForm_Shown(object sender, EventArgs e)
 {
     foreach (RadPageViewPage item in rpvCheckCategory.Pages)
     {
         InputGridBase grid = (InputGridBase)item.Tag;
         grid.Columns.AutoSize(true);
     }
 }
Ejemplo n.º 3
0
        private void tsbAllPass_Click(object sender, EventArgs e)
        {
            SetLogicPassForm form = new SetLogicPassForm();

            if (form.ShowDialog() == System.Windows.Forms.DialogResult.OK)
            {
                switch (form.SelectResult)
                {
                case SelectResultEnum.Row:
                    if (rpvCheckCategory.SelectedPage != null && rpvCheckCategory.SelectedPage.Controls.Count > 0)
                    {
                        InputGridBase grid = (InputGridBase)rpvCheckCategory.SelectedPage.Controls[0];
                        int           row  = grid.SelectedRow;
                        if (row > 0)
                        {
                            ReturnValue.ShowMessage(grid.SetLogicPass(row - grid.FixedRows));
                        }
                        else
                        {
                            ReturnValue.ShowMessage("没有选中行");
                        }
                    }
                    break;

                case SelectResultEnum.Page:
                    if (rpvCheckCategory.SelectedPage != null && rpvCheckCategory.SelectedPage.Controls.Count > 0)
                    {
                        InputGridBase grid = (InputGridBase)rpvCheckCategory.SelectedPage.Controls[0];
                        ReturnValue.ShowMessage(grid.SetAllLogicPass());
                    }
                    break;

                case SelectResultEnum.All:

                    foreach (Telerik.WinControls.UI.RadPageViewPage page in rpvCheckCategory.Pages)
                    {
                        foreach (Control c in page.Controls)
                        {
                            if (c is InputGridBase)
                            {
                                InputGridBase grid = (InputGridBase)c;
                                ReturnValue   rv   = grid.SetAllLogicPass();
                                if (!rv.Success)
                                {
                                    ReturnValue.ShowMessage(rv);
                                    return;
                                }
                            }
                        }
                    }
                    ReturnValue.ShowMessage(new ReturnValue(true));
                    break;
                }
            }
        }
Ejemplo n.º 4
0
        /// <summary>
        /// 数据统计
        /// </summary>
        /// <returns></returns>
        public QualifyJudgeEnum DataStat()
        {
            //List<QualifyJudgeEnum> results = new List<QualifyJudgeEnum>();
            foreach (Telerik.WinControls.UI.RadPageViewPage page in rpvCheckCategory.Pages)
            {
                foreach (Control c in page.Controls)
                {
                    if (c is InputGridBase)
                    {
                        InputGridBase grid = (InputGridBase)c;
                        grid.QualifyJudgeAll();
                        //QualifyJudgeEnum result = grid.QualifyJudgeAll();
                        //results.Add(result);
                    }
                }
            }
            var rv = CheckOrder.DataStat(_sampleOrder.SampleID);

            //QualifyJudgeEnum finalresult = QualifyJudgeEnum.Empty;
            //if (results.Contains(QualifyJudgeEnum.UnFinish))
            //    finalresult = QualifyJudgeEnum.UnFinish;
            //else if (results.Contains(QualifyJudgeEnum.False))
            //    finalresult = QualifyJudgeEnum.False;
            //else if (results.Contains(QualifyJudgeEnum.UnJudge) || !results.Contains(QualifyJudgeEnum.Pass))
            //    finalresult = QualifyJudgeEnum.UnJudge;
            //else finalresult = QualifyJudgeEnum.Pass;
            _sampleOrder.QualifyJudge = (QualifyJudgeEnum)rv.ErrNum;// finalresult;
            _Grid.Refresh();
            //_sampleOrderGrid.ReloadRow(1);
            if (rv.Success)
            {
                lbInfo.ForeColor = Color.RoyalBlue;
            }
            else
            {
                lbInfo.ForeColor = Color.Crimson;
            }
            lbInfo.Text = "合格判定信息:" + rv.Message;
            return(_sampleOrder.QualifyJudge);
        }
Ejemplo n.º 5
0
        public void LoadInfo()
        {
            rpvCheckCategory.Pages.Clear();
            Dictionary <string, EncodeCollection <CheckItem> > dic = new Dictionary <string, EncodeCollection <CheckItem> >();
            EncodeCollection <CheckItem> ecCheckItems = null;

            if (_sampleOrder.GetPlanCheckItemCount <= 0)
            {
                //Definition def = SSIT.Bread.UI.MM.MMCommon.GetDefinitionbyID(_sampleOrder.DefinitionID);
                //MMCheckItemCombine combine = MMCheckItemCombine.Instance.GetItembyKey(_sampleOrder.DefinitionID);
                DefinitionCheckItemCombine combine = DefinitionCheckItemCombine.GetItemby(_sampleOrder.DefPK);
                if (combine != null)
                {
                    ecCheckItems = combine.GetCheckItems();
                }
            }
            else
            {
                EncodeCollection <CheckItem> ec = new EncodeCollection <CheckItem>();
                foreach (short id in _sampleOrder.PlanCheckItems)
                {
                    CheckItem checkitem = CheckItem.Instance.Itemof(id);
                    if (checkitem != null)
                    {
                        ec.Add(checkitem);
                    }
                }
                ecCheckItems = ec;
            }
            if (ecCheckItems != null)
            {
                foreach (CheckItem item in ecCheckItems)
                {
                    string CheckCategoryName = item.GetCheckCategory();
                    if (!string.IsNullOrEmpty(CheckCategoryName))
                    {
                        if (!dic.ContainsKey(CheckCategoryName))
                        {
                            dic.Add(CheckCategoryName, new EncodeCollection <CheckItem>());
                        }
                        dic[CheckCategoryName].Add(item);
                    }
                }
            }
            EncodeCollection <CheckData> datas = CheckData.LoadDatasbySampleID(_sampleOrder.SampleID);
            int maxIndex = 0;

            if (datas.Count > 0)
            {
                foreach (var item in datas)
                {
                    maxIndex = Math.Max(item.SampleIndex, maxIndex);
                }
            }
            if (maxIndex >= _sampleOrder.CheckQuantity)
            {
                _sampleOrder.CheckQuantity = maxIndex;
            }
            SetOrderState();
            foreach (string key in dic.Keys)
            {
                Telerik.WinControls.UI.RadPageViewPage page = new Telerik.WinControls.UI.RadPageViewPage(key);
                InputGridBase grid = new InputGridBase {
                    Dock = DockStyle.Fill
                };
                page.Controls.Add(grid);
                if (_sampleOrder != null)
                {
                    grid.SampleCount = _sampleOrder.CheckQuantity;
                }
                page.Tag = grid;
                rpvCheckCategory.Pages.Add(page);
                grid.Order  = _sampleOrder;
                grid.Fields = CheckItemsToInputFields(dic[key]);
                grid.Init();
                grid.LoadDatas(datas);
                //grid.Columns.AutoSize(true);
            }

            if (datas.Count > 0)
            {
                DataStat();
            }
        }