예제 #1
0
        /// <summary>
        /// 测试项下拉列表
        /// </summary>
        private void BuildTestName()
        {
            // Added by Icyer 2006/08/16
            this.txtItemCodeQuery.Text = this.txtItemCodeQuery.Text.ToUpper();
            this.drpTestNameQuery.Items.Clear();
            string itemcode = this.txtItemCodeQuery.Text;

            BenQGuru.eMES.MOModel.SPCFacade facade = new BenQGuru.eMES.MOModel.SPCFacade(this.DataProvider);
            object[] objs = facade.QuerySPCItemSpec(itemcode, string.Empty, 1, int.MaxValue);
            if (objs != null && objs.Length > 0)
            {
                object[]  objsList = facade.GetAllSPCObject();
                Hashtable htObj    = new Hashtable();
                if (objsList != null)
                {
                    for (int i = 0; i < objsList.Length; i++)
                    {
                        BenQGuru.eMES.Domain.SPC.SPCObject spcObj = (BenQGuru.eMES.Domain.SPC.SPCObject)objsList[i];
                        htObj.Add(spcObj.ObjectCode, spcObj.ObjectName);
                    }
                }
                for (int i = 0; i < objs.Length; i++)
                {
                    BenQGuru.eMES.Domain.SPC.SPCItemSpec spec = (BenQGuru.eMES.Domain.SPC.SPCItemSpec)objs[i];
                    if (this.drpTestNameQuery.Items.FindByValue(spec.ObjectCode) == null)
                    {
                        this.drpTestNameQuery.Items.Add(new ListItem(htObj[spec.ObjectCode].ToString(), spec.ObjectCode));
                    }
                }
                this.drpTestNameQuery.SelectedIndex = 0;
                drpTestNameQuery_SelectedIndexChanged(null, null);
            }
            // Added end
        }
예제 #2
0
        protected void drpTestNameQuery_SelectedIndexChanged(object sender, EventArgs e)
        {
            this.drpConditionQuery.Items.Clear();
            this.txtItemCodeQuery.Text = this.txtItemCodeQuery.Text.ToUpper();
            string itemcode   = this.txtItemCodeQuery.Text;
            string objectCode = this.drpTestNameQuery.SelectedValue;

            if (itemcode == string.Empty || objectCode == string.Empty)
            {
                return;
            }
            BenQGuru.eMES.MOModel.SPCFacade    facade = new BenQGuru.eMES.MOModel.SPCFacade(this.DataProvider);
            BenQGuru.eMES.Domain.SPC.SPCObject spcObj = (BenQGuru.eMES.Domain.SPC.SPCObject)facade.GetSPCObject(objectCode);
            if (spcObj != null)
            {
                if (spcObj.DateRange == "RANGE")
                {
                    this.lblEDateQuery.Visible  = true;
                    this.txtDateToQuery.Visible = true;
                }
                else
                {
                    this.lblEDateQuery.Visible  = false;
                    this.txtDateToQuery.Visible = false;
                }
                if (spcObj.GraphType == SPCChartType.XBar_R_Chart)
                {
                    hidChartType.Value = "XR";
                }
                else if (spcObj.GraphType == SPCChartType.NormalDistributionDiagram || spcObj.GraphType == SPCChartType.OQC_NormalDistributionDiagram)
                {
                    hidChartType.Value = "HISTOGRAM";
                }
            }
            object[] objs = facade.QuerySPCItemSpec(itemcode, objectCode, 1, int.MaxValue);
            if (objs != null)
            {
                for (int i = 0; i < objs.Length; i++)
                {
                    BenQGuru.eMES.Domain.SPC.SPCItemSpec spec = (BenQGuru.eMES.Domain.SPC.SPCItemSpec)objs[i];
                    this.drpConditionQuery.Items.Add(new ListItem(spec.ConditionName, spec.GroupSeq.ToString()));
                }
            }
        }