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); }
protected void cmdDelete_ServerClick(object sender, System.EventArgs e) { if (_facade == null) { _facade = new FacadeFactory(base.DataProvider).CreateSPCFacade(); } ArrayList array = this.gridHelper.GetCheckedRows(); if (array.Count > 0) { ArrayList objs = new ArrayList(array.Count); foreach (GridRecord row in array) { object obj = this.GetEditObject(row); if (obj != null) { objs.Add((SPCObjectStore)obj); } } this._facade.DeleteSPCObjectStore((SPCObjectStore[])objs.ToArray(typeof(SPCObjectStore))); this.RequestData(); this.buttonHelper.PageActionStatusHandle(PageActionType.Delete); } }
protected void cmdAdd_ServerClick(object sender, System.EventArgs e) { if (this.ValidateInput()) { if (!CheckSPCObjectStore()) { return; } List <SPCObjectStore> objs = this.GetEditObjects(); if (objs == null) { return; } if (_facade == null) { _facade = new SPCFacade(base.DataProvider); } foreach (SPCObjectStore obj in objs) { this._facade.AddSPCObjectStore(obj); } this.RequestData(); this.buttonHelper.PageActionStatusHandle(PageActionType.Add); } }
protected int GetRowCount() { if (_facade == null) { _facade = new SPCFacade(base.DataProvider); } return(this._facade.QuerySPCObjectStoreCount( FormatHelper.PKCapitalFormat(FormatHelper.CleanString(this.txtObjectCode.Text)) )); }
protected object[] LoadDataSource(int inclusive, int exclusive) { if (_facade == null) { _facade = new SPCFacade(this.DataProvider); } return(this._facade.QuerySPCObjectStore( FormatHelper.PKCapitalFormat(FormatHelper.CleanString(this.txtObjectCode.Text)), inclusive, exclusive)); }
public bool CheckSPCObjectStore() { string objectCode = this.txtObjectCode.Text; decimal groupSeq = Convert.ToDecimal(this.txtGroupIndex.Text); string ckGroup = this.txtCKGroup.Text; string ckItemCode = this.txtCKItemCode.Text; if (_facade == null) { _facade = new SPCFacade(base.DataProvider); } object[] objs1 = _facade.GetSPCObjectStore(objectCode, groupSeq); if (objs1 != null) { foreach (SPCObjectStore item1 in objs1) { //check同一个管理项目,组次,对应唯一的检验项目组 if (item1.CKGroup != ckGroup) { WebInfoPublish.Publish(this, "$one_objectCode_and_groupSeq_must_has_one_ckGroup", this.languageComponent1); return(false); } } object[] objs2 = _facade.GetSPCObjectStore(objectCode, groupSeq, ckGroup); if (objs2 != null) { if (ckItemCode == "") { WebInfoPublish.Publish(this, "$Error_PK_is_Repeat", this.languageComponent1); return(false); } string[] ckItemCodes = ckItemCode.Split(','); foreach (string str in ckItemCodes) { foreach (SPCObjectStore item2 in objs2) { if (item2.CKItemCode == str) { WebInfoPublish.Publish(this, "$Error_PK_is_Repeat", this.languageComponent1); return(false); } } } } } return(true); }
protected List <SPCObjectStore> GetEditObjects() { if (_facade == null) { _facade = new SPCFacade(base.DataProvider); } SPCObjectStore spcObj; List <SPCObjectStore> spcObjList = new List <SPCObjectStore>(); if (this.txtCKItemCode.Text == "") { OQCFacade _OQCFacade = new OQCFacade(base.DataProvider); object[] CKItemCodes = _OQCFacade.GetOQCCheckListByCheckGroup(this.txtCKGroup.Text); if (CKItemCodes != null) { foreach (OQCCheckListQuery item in CKItemCodes) { spcObj = new SPCObjectStore(); spcObj.CKItemCode = item.CheckItemCode; spcObj.ObjectCode = this.txtObjectCode.Text; spcObj.GroupSeq = Convert.ToDecimal(this.txtGroupIndex.Text); spcObj.CKGroup = this.txtCKGroup.Text; spcObj.MaintainUser = this.GetUserCode(); spcObj.MaintainDate = FormatHelper.TODateInt(DateTime.Today); spcObj.MaintainTime = FormatHelper.TOTimeInt(DateTime.Now); spcObjList.Add(spcObj); } } } else { string[] ckItemCodes = this.txtCKItemCode.Text.Split(','); foreach (string str in ckItemCodes) { spcObj = new SPCObjectStore(); spcObj.CKItemCode = str; spcObj.ObjectCode = this.txtObjectCode.Text; spcObj.GroupSeq = Convert.ToDecimal(this.txtGroupIndex.Text); spcObj.CKGroup = this.txtCKGroup.Text; spcObj.MaintainUser = this.GetUserCode(); spcObj.MaintainDate = FormatHelper.TODateInt(DateTime.Today); spcObj.MaintainTime = FormatHelper.TOTimeInt(DateTime.Now); spcObjList.Add(spcObj); } } return(spcObjList); }
protected object GetEditObject(GridRecord row) { if (_facade == null) { _facade = new SPCFacade(base.DataProvider); } object obj = _facade.GetSPCObjectStore(row.Items.FindItemByKey("Serial").Text.ToString()); if (obj != null) { return((SPCObjectStore)obj); } return(null); }
protected void Page_Load(object sender, System.EventArgs e) { InitHander(); if (!this.IsPostBack) { // 初始化页面语言 this.InitPageLanguage(this.languageComponent1, false); this.txtObjectCode.Text = this.GetRequestParam("objectcode").Trim().ToUpper(); if (_facade == null) { _facade = new SPCFacade(this.DataProvider); } object objSpc = _facade.GetSPCObject(this.txtObjectCode.Text); this.txtObjectName.Text = ((SPCObject)objSpc).ObjectName; // 初始化界面UI this.InitUI(); this.InitButton(); this.InitWebGrid(); this.RequestData(); } }
/// <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 }