Exemple #1
0
        private void _initialWebGrid()
        {
            this.gridWebGrid.Columns.Clear();
            this.gridWebGrid.Rows.Clear();
            base.InitWebGrid();
            this.gridHelper.AddColumn("StepSequenceCode", "生产线", null);


            if (this.txtStepSequence.Text != "")
            {
                string   stepSeqs    = this.txtStepSequence.Text.Trim().ToUpper();
                string[] stepSeqList = stepSeqs.Split(new char[] { ',', ';' });
                if (stepSeqList != null)
                {
                    foreach (string stepSeq in stepSeqList)
                    {
                        this.gridHelper.AddColumn(stepSeq, stepSeq, null);
                    }
                }
            }
            else
            {
                BaseModelFacade facade   = new FacadeFactory(base.DataProvider).CreateBaseModelFacade();
                object[]        stepSeqs = facade.QueryStepSequence("", this.txtSegmentCodeQuery.Text, 0, System.Int32.MaxValue);
                if (stepSeqs != null && stepSeqs.Length > 0)
                {
                    for (int i = 0; i < stepSeqs.Length; i++)
                    {
                        this.gridHelper.AddColumn(((StepSequence)stepSeqs[i]).StepSequenceCode, ((StepSequence)stepSeqs[i]).StepSequenceCode, null);
                    }
                }
            }

            string[] rows = new string[] { "AllGoodQuantity", "Quantity", "AllGoodYieldPercent" };
            //object[] objs = new object[this.gridWebGrid.Columns.Count];
            GridRecord row = null;

            foreach (string cell in rows)
            {
                row = new GridRecord();
                //row = new UltraGridRow(objs);
                string text = this.languageComponent1.GetString(cell);
                if (text == "")
                {
                    text = cell;
                }
                row.Items[0].Value = cell;
                row.Items[0].Text  = text;
                this.gridWebGrid.Rows.Add(row);
            }

            //多语言
            this.gridHelper.ApplyLanguage(this.languageComponent1);
        }