public bool InitWithoutResAndOP(IDomainDataProvider dataProvider, string ssCode, DBDateTime dbDateTime) { bool returnValue = false; BaseModelFacade baseModelFacade = new BaseModelFacade(dataProvider); ShiftModelFacade shiftModelFacade = new ShiftModelFacade(dataProvider); _DataProvider = dataProvider; _DBDateTime = dbDateTime; //获取对应的SS _StepSequence = (StepSequence)baseModelFacade.GetStepSequence(ssCode); if (_StepSequence == null) { return(returnValue); } //获取当前的ShiftDate _ShiftDate = shiftModelFacade.GetShiftDayBySS(_StepSequence, _DBDateTime.DateTime); //获取当前的Shift _Shift = (Shift)shiftModelFacade.GetShift(_StepSequence.ShiftTypeCode, _DBDateTime.DBTime); if (_Shift == null) { return(returnValue); } returnValue = true; return(returnValue); }
private void DoQuery() { if (m_OPCode != null) { this.m_OPCode.Rows.Clear(); this.m_OPCode.AcceptChanges(); } m_baseModelFacade = new BaseModelFacade(this.DataProvider); object[] opCodeList = this.m_baseModelFacade.GetAllOperation(); if (opCodeList != null) { DataRow rowNew; foreach (Operation ss in opCodeList) { rowNew = this.m_OPCode.NewRow(); rowNew["Checked"] = false; rowNew["OPCode"] = ss.OPCode; rowNew["OPDesc"] = ss.OPDescription; this.m_OPCode.Rows.Add(rowNew); } this.m_OPCode.AcceptChanges(); } this.ultraGridOPCode.ActiveRow = null; }
public void SetUp() { persistBroker = new OLEDBPersistBroker("Provider=OraOLEDB.Oracle.1;Password=emes;Persist Security Info=True;User ID=emes;Data Source=sqcdemo"); modelFacade = new ModelFacade(); itemFacade = new ItemFacade(); baseModelFacade = new BaseModelFacade(); }
private object[] LoadDataSource(int inclusive, int exclusive) { if (_baseModelFacade == null) { _baseModelFacade = new FacadeFactory(base.DataProvider).CreateBaseModelFacade(); } if (EditGrid == "gridWebGrid") { this.gridWebGrid.Columns.FromKey("IsOPBOMUsed").Hidden = true; this.lblItemRouteMaintain.Visible = false; return this._baseModelFacade.GetAllRouteEnabled(); } else { lblItemRouteMaintain.Visible = true; lblItemRouteMaintain.Text = this.languageComponent1.GetString("$Error_ItemRouteInformation"); this.gridWebGrid.Columns.FromKey("IsOPBOMUsed").Hidden = false; object[] objs = this._baseModelFacade.GetAllRouteEnabled(); ArrayList tmpArrayList = new ArrayList(); if (objs != null) { for (int i = 0; i < objs.Length; i++) { for (int j = 0; j < arrayDeleteRoutes.Count; j++) { if (((Route)objs[i]).RouteCode == ((Item2Route)arrayDeleteRoutes[j]).RouteCode) { ((Route)objs[i]).EAttribute1 = FormatHelper.DisplayBoolean(true, this.languageComponent1); tmpArrayList.Add(objs[i]); break; } } } } return tmpArrayList.ToArray(); } }
protected void GetOrgListByUserCode(string userCode) { try { string C_ORGNAME_IN_SESSION = "CurrentOrganization"; if (HttpContext.Current.Session[C_ORGNAME_IN_SESSION] == null) { // 只将User默认的Org放进Session中去 BaseModelFacade baseFacade = new BaseModelFacade(this.DataProvider); object org = baseFacade.GetUserDefaultOrgByUser(userCode); if (org == null) { throw new Exception("$Error_UserDefaultOrg_NotDefined"); } HttpContext.Current.Session[C_ORGNAME_IN_SESSION] = new List <Organization>() { (Organization)org }; } } catch { //抛出 由上层处理 throw; } }
private void DoQuery() { if (m_ResCode != null) { this.m_ResCode.Rows.Clear(); this.m_ResCode.AcceptChanges(); } m_baseModelFacade = new BaseModelFacade(this.DataProvider); object[] resCodeList; if (ssCode == string.Empty || ssCode.Length <= 0) { resCodeList = this.m_baseModelFacade.GetAllResource(); } else { resCodeList = this.m_baseModelFacade.GetAllResource(ssCode); } if (resCodeList != null) { DataRow rowNew; foreach (Resource res in resCodeList) { rowNew = this.m_ResCode.NewRow(); rowNew["Checked"] = false; rowNew["ResCode"] = res.ResourceCode; rowNew["ResDesc"] = res.ResourceDescription; this.m_ResCode.Rows.Add(rowNew); } this.m_ResCode.AcceptChanges(); } this.ultraGridResCode.ActiveRow = null; }
public BaseDCTAction GetEndNodeAction(IDCTClient client) { BaseDCTAction action = null; SQLDomainDataProvider domainProvider = null; if (client.DBConnection != null) { domainProvider = client.DBConnection as BenQGuru.eMES.Common.DomainDataProvider.SQLDomainDataProvider; } else { domainProvider = DomainDataProviderManager.DomainDataProvider() as SQLDomainDataProvider; client.DBConnection = domainProvider; } BaseModelFacade baseModelFacade = new BaseModelFacade(domainProvider); if (client.ResourceCode != null && client.ResourceCode.Trim().Length > 0) { Resource res = (Resource)baseModelFacade.GetResource(client.ResourceCode.Trim().ToUpper()); if (res != null && res.DctCode != null & res.DctCode.Trim().Length > 0) { action = (new ActionHelper()).GetActionByCommand(res.DctCode.Trim().ToUpper()); } } if (action == null) { action = new ActionIdle(); } return(action); }
protected void Page_Load(object sender, System.EventArgs e) { if (!IsPostBack) { // 初始化页面语言 this.InitPageLanguage(this.languageComponent1, false); Initparameters(); InitViewPanel(); BuildOrgList(); //this.pagerSizeSelector.Readonly = true; BaseModelFacade facade = new BaseModelFacade(base.DataProvider); object[] segments = facade.QuerySegment("", 0, System.Int32.MaxValue); if (segments != null) { this.drpSegmentQuery.Items.Clear(); foreach (Segment seg in segments) { this.drpSegmentQuery.Items.Add(seg.SegmentCode); } this.drpSegmentQuery.Items.Insert(0, ""); } } }
private void _doQuery() { if (this._checkRequireFields()) { //Check Segment BaseModelFacade baseModel = new BaseModelFacade(this.DataProvider); object segment = baseModel.GetSegment(FormatHelper.PKCapitalFormat(this.txtSegmentCodeQuery.Text.Trim())); if (segment == null) { throw new Exception("$Error_CS_Current_Segment_Not_Exist"); } object[] source = this._loadDataSource(); this._initialWebGrid(); this._processDataDourceToGrid(source); this._processDataDourceToChart(source); //segment yield this._processSegment(); this.V_StartRefresh = this.chbRefreshAuto.Checked; } else { // this.RefreshController1.Stop(); this.V_StartRefresh = false; } }
public object[] QueryShiftBySegment(string shiftCode, string segmentCode, int inclusive, int exclusive) { BaseModelFacade baseModelFacade = new BaseModelFacade(this.DataProvider); object[] ssList = baseModelFacade.QueryStepSequence("", segmentCode, 0, int.MaxValue); string shiftTypeCodeList = string.Empty; if (ssList != null) { foreach (StepSequence ss in ssList) { shiftTypeCodeList += ",'" + ss.ShiftTypeCode + "'"; } if (shiftTypeCodeList.Trim().Length > 1) { shiftTypeCodeList = shiftTypeCodeList.Substring(1); shiftTypeCodeList = " and SHIFTTYPECODE IN (" + shiftTypeCodeList + ") "; } } if (shiftTypeCodeList.Trim().Length <= 0) { return(null); } return(this.DataProvider.CustomQuery(typeof(Shift), new PagerCondition(string.Format("select {0} from TBLSHIFT where 1=1 and SHIFTCODE like '{1}%' {2} ", DomainObjectUtility.GetDomainObjectFieldsString(typeof(Shift)), shiftCode, shiftTypeCodeList), "SHIFTTYPECODE, SHIFTSEQ", inclusive, exclusive))); }
public PhysicalLayoutDataPreparationHelper(DropDownList segment, DropDownList stepSequence, DropDownList resource, IDomainDataProvider dataProvider) { this._segment = segment; this._stepSequence = stepSequence; this._resource = resource; this._facade = new FacadeFactory(dataProvider).CreateBaseModelFacade(); if (this._segment != null) { this._segment.SelectedIndexChanged += new EventHandler(_segment_SelectedIndexChanged); this._segment.AutoPostBack = true; this._segmentBuilder = new DropDownListBuilder(this._segment); this._segmentBuilder.HandleGetObjectList += new GetObjectListDelegate(this._getSegmentList); } if (this._stepSequence != null) { this._stepSequence.SelectedIndexChanged += new EventHandler(_stepSequence_SelectedIndexChanged); this._stepSequence.AutoPostBack = true; this._stepSequenceBuilder = new DropDownListBuilder(this._stepSequence); this._stepSequenceBuilder.HandleGetObjectList += new GetObjectListDelegate(this._getStepSequenceList); } if (this._resource != null) { this._resourceBuilder = new DropDownListBuilder(this._resource); this._resourceBuilder.HandleGetObjectList += new GetObjectListDelegate(this._getResourceList); } }
private void SetEditObject(object obj) { this.chklstOPControlEdit_Load(); if (obj == null) { this.txtItemRouteOperationSeqEdit.Text = string.Empty; this.txtItemOperationCodeEdit.Text = string.Empty; this.txtOPDescriptionQuery.Text = string.Empty; //(new OperationListFactory()).CreateOperationListCheckBoxList(this.chklstOPControlEdit,"0000000000000"); (new OperationListFactory()).CreateNewOperationListCheckBoxList(this.chklstOPControlEdit, this.chklstOPAttributeEdit, this.languageComponent1); this.pnlMainEdit.Visible = false; this.PnlChildEdit.Visible = false; this.cmdSave.Disabled = true; } else { ItemRoute2OP itemRoute2OP = (ItemRoute2OP)obj; this.txtItemRouteOperationSeqEdit.Text = itemRoute2OP.OPSequence.ToString(); this.txtItemOperationCodeEdit.Text = itemRoute2OP.OPCode; BaseModelFacade baseModelFacade = new BaseModelFacade(this.DataProvider); Operation op = (Operation)baseModelFacade.GetOperation(itemRoute2OP.OPCode); if (op != null) { this.txtOPDescriptionQuery.Text = op.OPDescription; } else { this.txtOPDescriptionQuery.Text = string.Empty; } this.txtItemOperationCodeEdit.ReadOnly = true; this.txtOPDescriptionQuery.ReadOnly = true; (new OperationListFactory()).CreateOperationListCheckBoxList(this.chklstOPControlEdit, this.chklstOPAttributeEdit, itemRoute2OP.OPControl); if (FormatHelper.StringToBoolean(itemRoute2OP.OPControl, (int)OperationList.IDTranslation)) { this.pnlMainEdit.Visible = true; this.drpMergeTypeEdit.SelectedValue = itemRoute2OP.IDMergeType; if (itemRoute2OP.IDMergeType == IDMergeType.IDMERGETYPE_ROUTER) { this.PnlChildEdit.Visible = true; this.txtDenominatorEdit.Text = itemRoute2OP.IDMergeRule.ToString(); } else { this.PnlChildEdit.Visible = false; } } else { this.pnlMainEdit.Visible = false; } this.cmdSave.Disabled = false; drpOptionalOP.SelectedValue = itemRoute2OP.OptionalOP; } }
protected override void AddDomainObject(ArrayList domainObject) { if (facade == null) { facade = new BaseModelFacadeFactory(base.DataProvider).Create(); } facade.AddRoute2Operation((Route2Operation[])domainObject.ToArray(typeof(Route2Operation))); }
private BaseModelFacade facade = null; //new BaseModelFacadeFactory().Create(); protected override void AddDomainObject(ArrayList domainObject) { if (facade == null) { facade = new BaseModelFacadeFactory(base.DataProvider).Create(); } facade.AddOperation2Resource((Operation2Resource[])domainObject.ToArray(typeof(Operation2Resource))); }
protected override void DeleteDomainObjects(ArrayList domainObjects) { if (facade == null) { facade = new BaseModelFacadeFactory(base.DataProvider).Create(); } this.facade.UpdateResourceDctCode((Resource[])domainObjects.ToArray(typeof(Resource))); }
protected void cmdGridExport_ServerClick(object sender, EventArgs e) { if (baseFacade == null) { baseFacade = new BaseModelFacade(this.DataProvider); } this.excelExporter.Export(); }
protected override void UpdateDomainObject(object domainObject) { if (facade == null) { facade = new BaseModelFacade(this.DataProvider); } this.facade.UpdateSoftWareVersion((SoftWareVersion)domainObject); }
protected override void UpdateDomainObject(object domainObject) { if (facade == null) { facade = new BaseModelFacadeFactory(base.DataProvider).Create(); } this.facade.UpdateResource((Resource)domainObject); }
private object[] GetOutLineOP(DomainDataProvider.SQLDomainDataProvider dataProvider, string resCode) { //初始化线外工序下拉框。 BaseModelFacade bsmodel = new BaseModelFacade(dataProvider); object[] oplist = bsmodel.GetAllOutLineOperationsByResource(resCode); return(oplist); }
protected override void DeleteDomainObjects(ArrayList domainObjects) { if (facade == null) { facade = new BaseModelFacade(this.DataProvider); } this.facade.DeleteSoftWareVersion((SoftWareVersion[])domainObjects.ToArray(typeof(SoftWareVersion))); }
protected override int GetRowCount() { if (facade == null) { facade = new BaseModelFacade(this.DataProvider); } return(this.facade.QuerySoftWareVersionCount( FormatHelper.PKCapitalFormat(FormatHelper.CleanString(this.txtSoftWareVersionQuery.Text)), FormatHelper.CleanString(this.drpSoftWareStatusQuery.SelectedValue.ToString()) )); }
protected override object[] LoadDataSource(int inclusive, int exclusive) { if (facade == null) { facade = new BaseModelFacade(this.DataProvider); } return(this.facade.QuerySoftWareVersion( FormatHelper.PKCapitalFormat(FormatHelper.CleanString(this.txtSoftWareVersionQuery.Text)), FormatHelper.CleanString(this.drpSoftWareStatusQuery.SelectedValue.ToString()), inclusive, exclusive)); }
protected override int GetRowCount() { if (facade == null) { facade = new BaseModelFacadeFactory(base.DataProvider).Create(); } return(this.facade.GetUnselectedResourceByDCTCodeCount( FormatHelper.PKCapitalFormat(FormatHelper.CleanString(this.txtDctCommandQuery.Text)), FormatHelper.PKCapitalFormat(FormatHelper.CleanString(this.txtResourceCodeQuery.Text)))); }
protected override object[] LoadDataSource(int inclusive, int exclusive) { if (facade == null) { facade = new BaseModelFacadeFactory(base.DataProvider).Create(); } return(facade.GetSelectedOperationOfRouteByRouteCode( FormatHelper.PKCapitalFormat(FormatHelper.CleanString(this.txtRouteCodeQuery.Text)), FormatHelper.PKCapitalFormat(FormatHelper.CleanString(this.txtOperationCodeQuery.Text)), inclusive, exclusive)); }
protected override int GetRowCount() { if (facade == null) { facade = new BaseModelFacadeFactory(base.DataProvider).Create(); } return(this.facade.GetUnselectedOperationByRouteCodeCount( FormatHelper.PKCapitalFormat(FormatHelper.CleanString(this.txtRouteCodeQuery.Text)), FormatHelper.PKCapitalFormat(FormatHelper.CleanString(this.txtOperationCodeQuery.Text)))); }
protected override object[] LoadDataSource(int inclusive, int exclusive) { if (facade == null) { facade = new BaseModelFacadeFactory(base.DataProvider).Create(); } return(facade.GetResourceByDCTCode( FormatHelper.PKCapitalFormat(FormatHelper.CleanString(this.txtDctCommandQuery.Text)), inclusive, exclusive)); }
/// <summary> /// 增加Model2Route,同时不Route下面所有的Operation复制过来 /// </summary> /// <param name="model2Route"></param> public void AddModelRoute(Model2Route model2Route) { BaseModelFacade _baseModelFacade = new BaseModelFacade(this.DataProvider); try { //DataProvider.BeginTransaction(); //add item2route] //Laws Lu,2006/11/13 uniform system collect date DBDateTime dbDateTime; dbDateTime = FormatHelper.GetNowDBDateTime(DataProvider); model2Route.MaintainDate = dbDateTime.DBDate; model2Route.MaintainTime = dbDateTime.DBTime; this._helper.AddDomainObject(model2Route); //this.DataProvider.Insert(model2Route); //add item2op object[] operations = _baseModelFacade.GetSelectedOperationByRouteCode(model2Route.RouteCode, string.Empty, int.MinValue, int.MaxValue); if (operations == null) { ExceptionManager.Raise(this.GetType().BaseType, "$Error_RouteHasNoOperations", string.Format("[$RouteCode='{0}']", model2Route.RouteCode), null); } for (int i = 0; i < operations.Length; i++) { Model2OP model2Operation = new Model2OP(); model2Operation.RouteCode = model2Route.RouteCode; model2Operation.ModelCode = model2Route.ModelCode; model2Operation.OPCode = ((Operation)operations[i]).OPCode; model2Operation.OPSequence = i; model2Operation.OPControl = ((Operation)operations[i]).OPControl; model2Operation.IDMergeType = IDMergeType.IDMERGETYPE_IDMERGE; model2Operation.IDMergeRule = 1; model2Operation.MaintainUser = model2Route.MaintainUser; model2Operation.MaintainDate = model2Route.MaintainDate; model2Operation.MaintainTime = model2Route.MaintainTime; model2Operation.OPID = CreateOPID(model2Route.ModelCode, model2Route.RouteCode, ((Operation)operations[i]).OPCode); model2Operation.OrganizationID = model2Route.OrganizationID; this._helper.AddDomainObject(model2Operation); //DataProvider.Insert(model2Operation); } //DataProvider.CommitTransaction(); } catch (Exception ex) { //_log.Error(ex.Message); //DataProvider.RollbackTransaction(); ExceptionManager.Raise(this.GetType(), "$Error_AddModelRoute_Failure", String.Format("[$ModelCode='{0}',$RouteCode='{1}' ]", model2Route.ModelCode, model2Route.RouteCode), ex); // throw new RemotingException(ErrorCenter.GetErrorServerDescription(typeof(ModelFacade),String.Format(ErrorCenter.ERROR_ADDMODELROUTE,model2Route.ModelCode,model2Route.RouteCode)),ex); } }
//生成新事件号 private void ToCreateDownCode() { if (_dataCollectFacade == null) { _dataCollectFacade = new DataCollectFacade(this.DataProvider); } BaseSetting.BaseModelFacade baseModelFacade = new BaseModelFacade(this.DataProvider); object objectRes = baseModelFacade.GetResource(ApplicationService.Current().ResourceCode.ToUpper()); if (objectRes == null) { ApplicationRun.GetInfoForm().AddEx(this._FunctionName, "" + ": " + ApplicationService.Current().ResourceCode, new UserControl.Message(MessageType.Error, "$CS_Res_NotHave_SSCode"), true); return; } string SSCode = ((Domain.BaseSetting.Resource)objectRes).StepSequenceCode; DBDateTime DBDateTime = FormatHelper.GetNowDBDateTime(this.DataProvider); string DBDate = DBDateTime.DBDate.ToString(); object objectMaxDownCode = _dataCollectFacade.GetMaxDownCode(SSCode, DBDate, GlobalVariables.CurrentOrganizations.First().OrganizationID); if (objectMaxDownCode == null) { this.ucLabelEditDownCode.Value = SSCode + DBDate + "_001"; } else { if (string.IsNullOrEmpty(((Down)objectMaxDownCode).DownCode)) { this.ucLabelEditDownCode.Value = SSCode + DBDate + "_001"; } else { string MaxDownCode = ((Down)objectMaxDownCode).DownCode; int DownCodelength = MaxDownCode.Length; string DownCodeNum = Convert.ToString(System.Int32.Parse(MaxDownCode.Substring(DownCodelength - 3, 3)) + 1); if (DownCodeNum.Length == 1) { DownCodeNum = "00" + DownCodeNum; } else if (DownCodeNum.Length == 2) { DownCodeNum = "0" + DownCodeNum; } this.ucLabelEditDownCode.Value = SSCode + DBDate + "_" + DownCodeNum; } } }
protected override object GetEditObject(GridRecord row) { if (facade == null) { facade = new BaseModelFacadeFactory(base.DataProvider).Create(); } Operation2Resource relation = facade.CreateNewOperation2Resource(); relation.OPCode = this.txtOperationCodeQuery.Text.Trim(); relation.ResourceCode = row.Items.FindItemByKey("UnAssResourceCode").Text; relation.MaintainUser = this.GetUserCode(); return relation; }
protected override object GetEditObject() { if (facade == null) { facade = new BaseModelFacadeFactory(base.DataProvider).Create(); } Resource relation = this.facade.CreateNewResource(); relation.DctCode = FormatHelper.CleanString(this.txtDctCommandQuery.Text.Trim(), 40); relation.ResourceCode = FormatHelper.CleanString(this.txtResourceCodeEdit.Text, 40); relation.MaintainUser = this.GetUserCode(); return(relation); }