private void BindSegment() { BenQGuru.eMES.Common.Domain.IDomainDataProvider provider = null; try { this.drpSegment.Items.Clear(); provider = base.DataProvider; BenQGuru.eMES.BaseSetting.BaseModelFacade facade = new BenQGuru.eMES.BaseSetting.BaseModelFacade(provider); object[] objs = facade.GetAllSegment(); if (objs != null && objs.Length > 0) { foreach (object obj in objs) { BenQGuru.eMES.Domain.BaseSetting.Segment seg = obj as BenQGuru.eMES.Domain.BaseSetting.Segment; if (seg != null) { //this.drpSegment.Items.Add(new ListItem(seg.SegmentCode,seg.ShiftTypeCode)); this.drpSegment.Items.Add(seg.SegmentCode); } } } } finally { if (provider != null) { ((BenQGuru.eMES.Common.DomainDataProvider.SQLDomainDataProvider)provider).PersistBroker.CloseConnection(); } } }
//Bind上班时间下拉列表,返回根据当前时间选定的记录 public int BindShiftTime(System.Collections.IList list, Resource res) { //根据res取得班制 BenQGuru.eMES.BaseSetting.BaseModelFacade bm = new BenQGuru.eMES.BaseSetting.BaseModelFacade(this.DataProvider); if (res == null) { return(-1); } //Segment seg = bm.GetSegment(res.SegmentCode) as Segment; //if(seg == null) return -1; //string shifttype = seg.ShiftTypeCode; string shifttype = res.ShiftTypeCode; //根据 BenQGuru.eMES.BaseSetting.ShiftModelFacade shift = new BenQGuru.eMES.BaseSetting.ShiftModelFacade(this.DataProvider); object[] objs = this.DataProvider.CustomQuery(typeof(Shift), new SQLCondition(string.Format("select {0} from TBLSHIFT where shifttypecode='{1}'order by SHIFTBTIME", DomainObjectUtility.GetDomainObjectFieldsString(typeof(Shift)), shifttype))); if (objs != null && objs.Length > 0) { foreach (object obj in objs) { BenQGuru.eMES.Domain.BaseSetting.Shift s = obj as BenQGuru.eMES.Domain.BaseSetting.Shift; if (s != null) { list.Add(new UIShift(s.ShiftCode, s.ShiftBeginTime, s.ShiftEndTime, s.IsOverDate)); } } } int time = FormatHelper.TOTimeInt(DateTime.Now); return(GetCurrShiftIndex(time, list)); }
protected override object GetEditObject() { if (_facade == null) { _facade = new BaseModelFacadeFactory(base.DataProvider).Create(); } StepSequence stepSequence = this._facade.CreateNewStepSequence(); stepSequence.StepSequenceDescription = FormatHelper.CleanString(this.txtStepSequenceDescriptionEdit.Text, 100); stepSequence.StepSequenceCode = FormatHelper.PKCapitalFormat(FormatHelper.CleanString(this.txtStepSequenceCodeEdit.Text, 40)); stepSequence.SegmentCode = this.drpSegmentCodeEdit.SelectedValue; stepSequence.MaintainUser = this.GetUserCode(); stepSequence.OrganizationID = int.Parse(this.DropDownListOrg.SelectedValue); stepSequence.BigStepSequenceCode = FormatHelper.PKCapitalFormat(FormatHelper.CleanString(this.DropDownListBigStepSequenceCodeEdit.Text, 40)); stepSequence.StepSequenceOrder = int.Parse(this.txtBigStepSequenceSEQ.Text); stepSequence.ShiftTypeCode = this.drpShifTypeCode.SelectedValue; if (this.chbSaveIntoStock.Checked) { stepSequence.SaveInStock = "Y"; } else { stepSequence.SaveInStock = "N"; } return(stepSequence); }
protected override object GetEditObject() { if (_facade == null) { _facade = new BaseModelFacadeFactory(base.DataProvider).Create(); } Resource resource = this._facade.CreateNewResource(); string routeCode = GetRouteCodeFromReworkCodeList(this.txtReworkMo.Text.Trim().ToUpper()); if (routeCode.Trim().Length > 0) { resource.ReworkRouteCode = routeCode; } else { resource.ReworkRouteCode = this.txtReworkRoute.Text.Trim().ToUpper(); } resource.ResourceDescription = FormatHelper.CleanString(this.txtResourceDescriptionEdit.Text, 100); resource.ResourceType = this.drpResourceTypeEdit.SelectedValue; resource.ResourceGroup = this.drpResourceGroupEdit.SelectedValue; resource.DctCode = this.DropDownListDCT.SelectedValue; resource.CrewCode = this.drpCrewCodeEdit.SelectedValue; resource.ResourceCode = FormatHelper.PKCapitalFormat(FormatHelper.CleanString(this.txtResourceCodeEdit.Text, 40)); resource.StepSequenceCode = (this.drpStepSequenceCodeEdit.SelectedValue != "") ? this.drpStepSequenceCodeEdit.SelectedValue : ""; resource.SegmentCode = FormatHelper.CleanString(this.txtSegmentCodeEdit.Text, 40); resource.ShiftTypeCode = FormatHelper.CleanString(this.txtShiftEdit.Text, 40); resource.MaintainUser = this.GetUserCode(); resource.OrganizationID = int.Parse(this.DropDownListOrg.SelectedItem.Value); return(resource); }
private void AddRes2ReworkSheet(string resCode, string reworkCodeListString) { ReworkFacade reworkFacade = new ReworkFacade(this.DataProvider); if (_facade == null) { _facade = new BaseModelFacadeFactory(base.DataProvider).Create(); } if (reworkCodeListString.Trim().Length > 0) { string[] reworkCodeList = reworkCodeListString.Trim().ToUpper().Split(','); if (reworkCodeList == null) { reworkCodeList = new string[0]; } foreach (string reworkCode in reworkCodeList) { ReworkSheet reworkSheet = (ReworkSheet)reworkFacade.GetReworkSheet(reworkCode); if (reworkSheet != null) { Resource2ReworkSheet res2ReworkSheet = _facade.CreateNewResource2ReworkSheet(); res2ReworkSheet.ResourceCode = resCode; res2ReworkSheet.ItemCode = reworkSheet.ItemCode; res2ReworkSheet.LotNo = reworkSheet.LotList; res2ReworkSheet.ReworkCode = reworkSheet.ReworkCode; res2ReworkSheet.MaintainUser = this.GetUserCode(); _facade.AddResource2ReworkSheet(res2ReworkSheet); } } } }
protected void drpStepSequenceCodeEdit_SelectedIndexChanged(object sender, System.EventArgs e) { if (_facade == null) { _facade = new BaseModelFacadeFactory(base.DataProvider).Create(); } object obj = this._facade.GetStepSequence(this.drpStepSequenceCodeEdit.SelectedValue); if (obj == null) { this.txtSegmentCodeEdit.Text = ""; return; } this.txtSegmentCodeEdit.Text = ((StepSequence)obj).SegmentCode; if (obj == null) { this.txtShiftEdit.Text = ""; return; } else { this.txtShiftEdit.Text = ((StepSequence)obj).ShiftTypeCode; } /*object _Segment = this._facade.GetSegment(this.txtSegmentCodeEdit.Text.Trim()); * if(_Segment == null) * { * this.txtShiftEdit.Text = ""; * return; * } * this.txtShiftEdit.Text = ((Segment)_Segment).ShiftTypeCode; * */ }
protected void drpDCT_Load(object sender, System.EventArgs e) { if (!IsPostBack) { DropDownListBuilder builder = new DropDownListBuilder(this.DropDownListDCT); if (_facade == null) { _facade = new BaseModelFacadeFactory(base.DataProvider).Create(); } builder.HandleGetObjectList += new BenQGuru.eMES.Web.Helper.GetObjectListDelegate(this._facade.GetAllDCT); //builder.Build("DctCode", "DctCode"); ////添加一个默认的空选项,新增时为非必选 modify by Simone //ListItem sf0 = new ListItem("", ""); //this.DropDownListDCT.Items.Add(sf0); //this.DropDownListDCT.Items.FindByValue("").Selected = true; builder.Build("DctCode", "DctCode"); this.DropDownListDCT.Items.Insert(0, new ListItem("", "")); this.DropDownListDCT.SelectedIndex = 0; } }
protected override object GetEditObject(GridRecord row) { if (_facade == null) { _facade = new BaseModelFacadeFactory(base.DataProvider).Create(); } string strCode = string.Empty; object objCode = row.Items.FindItemByKey("RouteCode").Value; if (objCode != null) { strCode = objCode.ToString(); } //else //{ // string id = string.Format("gridWebGrid_it{0}_{1}_RouteCode", this.gridWebGrid.Columns.FromKey("RouteCode").Index, row.Index); // strCode = (row.FindControl(id) as HtmlGenericControl).InnerText.ToString(); //} object obj = _facade.GetRoute(strCode); if (obj != null) { return((Route)obj); } return(null); }
protected override void UpdateDomainObject(object domainObject) { if (_facade == null) { _facade = new BaseModelFacadeFactory(base.DataProvider).Create(); } object OldObject = this._facade.GetStepSequence(this.DropDownListBigStepSequenceCodeEdit.Text.ToString(), int.Parse(this.txtBigStepSequenceSEQ.Text)); if (OldObject != null) { if (this.txtSave1.Text.Trim() != this.DropDownListBigStepSequenceCodeEdit.Text.Trim() || this.txtSave2.Text.Trim() != this.txtBigStepSequenceSEQ.Text.Trim()) { ExceptionManager.Raise(this.GetType().BaseType, "$Error_BigSSCodeSeqUsed"); } } this._facade.UpdateStepSequence((StepSequence)domainObject); StepSequence newStepSequence = (StepSequence)domainObject; //UpdateStepSequence中已经有Update下面所有RES的逻辑,此处不用再添加了 //object[] objStepSequence ={ }; //object[] objStepSequence = this._facade.GetResourceByStepSequenceCode(newStepSequence.StepSequenceCode); //for (int i = 0; i < objStepSequence.Length;i++ ) //{ // Resource newResource = (Resource)objStepSequence[i]; // newResource.ShiftTypeCode = this.drpShifTypeCode.SelectedValue; // this._facade.UpdateResource(newResource); //} }
protected override void UpdateDomainObject(object domainObject) { if (_facade == null) { _facade = new BaseModelFacadeFactory(base.DataProvider).Create(); } this._facade.UpdateRoute((Route)domainObject); }
private object[] GetStepSequenceBySegment() { if (BaseMode_Facade == null) { BaseMode_Facade = new FacadeFactory(base.DataProvider).CreateBaseModelFacade(); } return(BaseMode_Facade.QueryStepSequence("", drpSegment.SelectedValue, 1, int.MaxValue)); }
//angel zhu modify 2005-04-20 protected override void AddDomainObject(object domainObject) { if (_facade == null) { _facade = new BaseModelFacadeFactory(base.DataProvider).Create(); } this._facade.AddOperation((Operation)domainObject); }
protected override void DeleteDomainObjects(ArrayList domainObjects) { if (_facade == null) { _facade = new BaseModelFacadeFactory(base.DataProvider).Create(); } this._facade.DeleteRoute((Route[])domainObjects.ToArray(typeof(Route))); }
protected override int GetRowCount() { if (_facade == null) { _facade = new BaseModelFacadeFactory(base.DataProvider).Create(); } return(_facade.GetOrgListCount(this.txtOrganizationNameQuery.Text.Trim())); }
private object[] GetResourceByStepSequence() { if (BaseMode_Facade == null) { BaseMode_Facade = new FacadeFactory(base.DataProvider).CreateBaseModelFacade(); } return(BaseMode_Facade.GetResourceByStepSequenceCode(drpStepSequence.SelectedValue)); }
protected override int GetRowCount() { if (_facade == null) { _facade = new BaseModelFacadeFactory(base.DataProvider).Create(); } return(this._facade.QueryRouteCount( FormatHelper.PKCapitalFormat(FormatHelper.CleanString(this.txtRouteCodeQuery.Text)))); }
protected override object[] LoadDataSource(int inclusive, int exclusive) { if (_facade == null) { _facade = new BaseModelFacadeFactory(base.DataProvider).Create(); } return(_facade.GetOrgList(this.txtOrganizationNameQuery.Text.Trim(), inclusive, exclusive)); }
protected override object[] LoadDataSource(int inclusive, int exclusive) { if (_facade == null) { _facade = new BaseModelFacadeFactory(base.DataProvider).Create(); } return(this._facade.QueryRoute( FormatHelper.PKCapitalFormat(FormatHelper.CleanString(this.txtRouteCodeQuery.Text)), inclusive, exclusive)); }
protected override int GetRowCount() { if (_facade == null) { _facade = new BaseModelFacadeFactory(base.DataProvider).Create(); } return(this._facade.QueryStepSequenceCount( FormatHelper.PKCapitalFormat(FormatHelper.CleanString(this.txtStepSequenceCodeQuery.Text)), FormatHelper.PKCapitalFormat(FormatHelper.CleanString(this.txtSegmentCodeQuery.Text)), FormatHelper.PKCapitalFormat(FormatHelper.CleanString(this.DropDownListBigStepSequenceCodeQuery.Text)))); }
private void drpStepSequenceCodeEdit_Load() { if (!this.IsPostBack) { DropDownListBuilder builder = new DropDownListBuilder(this.drpStepSequenceCodeEdit); if (_BaseModelFacadeFactory == null) { _BaseModelFacadeFactory = new BaseModelFacadeFactory(base.DataProvider).Create(); } builder.HandleGetObjectList += new BenQGuru.eMES.Web.Helper.GetObjectListDelegate(this._BaseModelFacadeFactory.GetAllStepSequence); builder.Build("StepSequenceDescription", "StepSequenceCode"); } }
protected override object GetEditObject(GridRecord row) { if (_facade == null) { _facade = new BaseModelFacadeFactory(base.DataProvider).Create(); } object obj = _facade.GetOrg(int.Parse(row.Items.FindItemByKey("OrganizationCode").Text.Trim())); if (obj != null) { return((Organization)obj); } return(null); }
protected override object GetEditObject() { if (_facade == null) { _facade = new BaseModelFacadeFactory(base.DataProvider).Create(); } Organization org = new Organization(); org.OrganizationID = int.Parse(this.txtOrganizationCodeEdit.Text.Trim()); org.OrganizationDescription = this.txtOrganizationNameEdit.Text.Trim(); org.MaintainUser = this.GetUserCode(); return(org); }
protected void drpResource_Load(object sender, System.EventArgs e) { if (!IsPostBack) { DropDownListBuilder builder = new DropDownListBuilder(this.drpResource); if (BaseMode_Facade == null) { BaseMode_Facade = new FacadeFactory(base.DataProvider).CreateBaseModelFacade(); } builder.HandleGetObjectList += new BenQGuru.eMES.Web.Helper.GetObjectListDelegate(BaseMode_Facade.GetAllResource); builder.Build("ResourceCode", "ResourceCode"); this.drpResource.Items.Insert(0, ""); } }
protected override object GetEditObject() { if (_facade == null) { _facade = new BaseModelFacadeFactory(base.DataProvider).Create(); } Dct dct = this._facade.CreateNewDct(); dct.DctCode = FormatHelper.PKCapitalFormat(FormatHelper.CleanString(this.txtDctCommandEdit.Text, 40)); dct.Dctdesc = FormatHelper.CleanString(this.txtDctCommandDescEdit.Text, 100); dct.MaintainUser = this.GetUserCode(); return(dct); }
protected override void AddDomainObject(object domainObject) { if (_facade == null) { _facade = new BaseModelFacadeFactory(base.DataProvider).Create(); } object OldObject = this._facade.GetStepSequence(this.DropDownListBigStepSequenceCodeEdit.Text.ToString(), int.Parse(this.txtBigStepSequenceSEQ.Text)); if (OldObject != null) { ExceptionManager.Raise(this.GetType().BaseType, "$Error_BigSSCodeSeqUsed"); } this._facade.AddStepSequence((StepSequence)domainObject); }
protected void drpSegmentCodeEdit_Load(object sender, System.EventArgs e) { if (!IsPostBack) { DropDownListBuilder builder = new DropDownListBuilder(this.drpSegmentCodeEdit); if (_facade == null) { _facade = new BaseModelFacadeFactory(base.DataProvider).Create(); } builder.HandleGetObjectList = new BenQGuru.eMES.Web.Helper.GetObjectListDelegate(this._facade.GetAllSegment); builder.Build("SegmentDescription", "SegmentCode"); this.drpSegmentCodeEdit.Items.Insert(0, new ListItem("", "")); } }
protected override object GetEditObject() { if (_facade == null) { _facade = new BaseModelFacadeFactory(base.DataProvider).Create(); } Segment segment = this._facade.CreateNewSegment(); segment.SegmentDescription = FormatHelper.CleanString(this.txtSegmentDescriptionEdit.Text, 100); segment.SegmentCode = FormatHelper.PKCapitalFormat(FormatHelper.CleanString(this.txtSegmentCodeEdit.Text, 40)); segment.ShiftTypeCode = this.drpShiftTypeCodeEdit.SelectedValue; segment.MaintainUser = this.GetUserCode(); segment.OrganizationID = int.Parse(this.DropDownListOrg.SelectedValue); segment.FactoryCode = this.DropDownListFactoryEdit.SelectedValue; return(segment); }
protected override object GetEditObject() { if (_facade == null) { _facade = new BaseModelFacadeFactory(base.DataProvider).Create(); } Operation operation = this._facade.CreateNewOperation(); operation.OPCode = FormatHelper.PKCapitalFormat(FormatHelper.CleanString(this.txtOPCodeEdit.Text, 40)); operation.OPCollectionType = "AUTO"; //this.drpOPCollectionTypeEdit.SelectedValue; operation.OPControl = (new OperationListFactory()).CreateOperationList(this.chklstOPControlEdit, this.chklstOPAttributeEdit); operation.OPDescription = FormatHelper.CleanString(this.txtOPDescriptionEdit.Text, 100); operation.MaintainUser = this.GetUserCode(); return(operation); }
protected void drpSegmentCodeEdit_SelectedIndexChanged(object sender, System.EventArgs e) { if (_facade == null) { _facade = new BaseModelFacadeFactory(base.DataProvider).Create(); } Segment newSegment = (Segment)this._facade.GetSegment(this.drpSegmentCodeEdit.SelectedValue); if (newSegment == null) { this.drpShifTypeCode.SelectedValue = ""; } else { this.drpShifTypeCode.SelectedValue = newSegment.ShiftTypeCode.ToString(); } }
protected override object GetEditObject() { if (_facade == null) { _facade = new BaseModelFacadeFactory(base.DataProvider).Create(); } Route route = this._facade.CreateNewRoute(); route.RouteDescription = FormatHelper.CleanString(this.txtRouteDescriptionEdit.Text, 100); route.RouteType = this.drpRouteTypeEdit.SelectedValue; route.EffectiveDate = 0; //FormatHelper.TODateInt(this.dateEffectiveDateEdit.Text); route.InvalidDate = 0; //FormatHelper.TODateInt(this.dateInvalidDateEdit.Text); route.RouteCode = FormatHelper.PKCapitalFormat(FormatHelper.CleanString(this.txtRouteCodeEdit.Text, 40)); route.MaintainUser = this.GetUserCode(); route.Enabled = FormatHelper.BooleanToString(this.chbRouteEnabled.Checked); return(route); }