/// <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 }
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())); } } }
/// <summary> /// 将通过URL传的参数分解出来 /// </summary> private void GetParam() { _itemCode = Request.QueryString["itemcode"]; //如果其中有空格,则重新处理一下 if (_itemCode.IndexOf(" ") > 0) { _itemCode = GetParamValueFromUrl("itemcode").Trim(); } _itemCode = _itemCode.ToUpper(); _dateFrom = Request.QueryString["datefrom"]; _dateTo = Request.QueryString["dateto"]; _dateList = new ArrayList(); if (_dateTo == string.Empty || _dateFrom == _dateTo) { _dateList.Add(FormatHelper.TODateInt(_dateFrom).ToString()); } else { DateTime dtFrom = DateTime.Parse(_dateFrom); DateTime dtTo = DateTime.Parse(_dateTo); DateTime dtTmp = dtFrom; string strDate = string.Empty; while (dtTmp <= dtTo) { _dateList.Add(FormatHelper.TODateInt(dtTmp).ToString()); dtTmp = dtTmp.AddDays(1); } } string res = Request.QueryString["resource"]; //如果其中有空格,则重新处理一下 if (res.IndexOf(" ") > 0) { res = this.GetParamValueFromUrl("resource").Trim(); } _resourceCode = res; _resList = new ArrayList(); if (res != null && res != String.Empty) { string[] res_arr = res.Split(','); for (int i = 0; i < res_arr.Length; i++) { _resList.Add(res_arr[i]); } } if (_resList.Count > 0) { _ifResource = true; } _testName = Request.QueryString["testitem"]; _groupSeq = Request.QueryString["condition"]; if (_testName.IndexOf(" ") > 0) { _testName = this.GetParamValueFromUrl("testitem").Trim(); } _fromTime = Request.QueryString["fromtime"]; _testResult = Request.QueryString["testresult"]; //对该管控项目代码是否维护存储信息 if (spcFacade == null) { spcFacade = new BenQGuru.eMES.MOModel.SPCFacade(this._provider); } object[] objSpcObjectStore = spcFacade.GetSPCObjectStore(this._testName, decimal.Parse(this._groupSeq)); if (objSpcObjectStore == null) { ExceptionManager.Raise(this.GetType(), "$Error_SPC_No_ObjectStore", string.Empty);//此产品的SPC测试项没有维护 } // 查询测试规格 itemSpec = (BenQGuru.eMES.Domain.SPC.SPCItemSpec)spcFacade.GetSPCItemSpec(this._itemCode, decimal.Parse(this._groupSeq), this._testName); if (itemSpec == null) { ExceptionManager.Raise(this.GetType(), "$Error_SPC_No_TestItem", string.Empty);//此产品的SPC测试项没有维护 } // Added end }