Ejemplo n.º 1
0
        protected object GetEditObject()
        {
            if (_facade == null)
            {
                _facade = new SPCFacade(base.DataProvider);
            }
            SPCObjectStore spcObj = (SPCObjectStore)_facade.GetSPCObjectStore(FormatHelper.PKCapitalFormat(FormatHelper.CleanString(this.txtObjectCode.Text)),
                                                                              Convert.ToDecimal(this.txtGroupIndex.Text),
                                                                              FormatHelper.PKCapitalFormat(FormatHelper.CleanString(this.txtCKGroup.Text)),
                                                                              FormatHelper.CleanString(this.txtCKItemCode.Text));

            if (spcObj == null)
            {
                spcObj = this._facade.CreateNewSPCObjectStore();
            }

            spcObj.ObjectCode   = this.txtObjectCode.Text;
            spcObj.GroupSeq     = Convert.ToDecimal(this.txtGroupIndex.Text);
            spcObj.CKGroup      = this.txtCKGroup.Text;
            spcObj.CKItemCode   = this.txtCKItemCode.Text;
            spcObj.MaintainUser = this.GetUserCode();
            spcObj.MaintainDate = FormatHelper.TODateInt(DateTime.Today);
            spcObj.MaintainTime = FormatHelper.TOTimeInt(DateTime.Now);

            return(spcObj);
        }
Ejemplo n.º 2
0
        /// <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
        }