protected override void AddDomainObject(object domainObject) { if (_facade == null) { _facade = new BenQGuru.eMES.Material.EquipmentFacade(base.DataProvider); } object objEqp = this._facade.GetEquipment(((Domain.Equipment.EQPMaintenance)domainObject).Eqpid); if (objEqp == null) { WebInfoPublish.Publish(this, "$Error_EQPID_IS_NOT_EXIST", languageComponent1); return; } object obj = this._facade.GetEQPMaintenance(((Domain.Equipment.EQPMaintenance)domainObject).Eqpid, ((Domain.Equipment.EQPMaintenance)domainObject).MaintainITEM, ((Domain.Equipment.EQPMaintenance)domainObject).MaintainType); if (obj == null) { this._facade.AddEQPMaintenance((Domain.Equipment.EQPMaintenance)domainObject); } else { WebInfoPublish.Publish(this, "$Error_PK_is_Repeat", languageComponent1); } }
protected void cmdAdd_ServerClick(object sender, EventArgs e) { ArrayList GridCheckList = this.gridHelper.GetCheckedRows(); if (GridCheckList.Count > 0) { if (_facade == null) { _facade = new Material.EquipmentFacade(base.DataProvider); } DBDateTime currentDateTime = FormatHelper.GetNowDBDateTime(this.DataProvider); EQPMaintainLog _EQPMaintainLog = null; foreach (GridRecord row in GridCheckList) { _EQPMaintainLog = new EQPMaintainLog(); _EQPMaintainLog.Eqpid = row.Items.FindItemByKey("EQPID").Text.ToString().Trim(); _EQPMaintainLog.MaintainITEM = row.Items.FindItemByKey("MaintenanceItem").Text.ToString().Trim(); _EQPMaintainLog.MaintainType = row.Items.FindItemByKey("MaintenanceType").Text.ToString().Trim(); _EQPMaintainLog.Result = row.Items.FindItemByKey("MaintenanceResult").Text == "true" ? "OK" : "NG"; _EQPMaintainLog.MEMO = row.Items.FindItemByKey("MaintenanceMemo").Text == null ? "" : FormatHelper.CleanString(row.Items.FindItemByKey("MaintenanceMemo").Text.ToString().Trim(), 400); _EQPMaintainLog.Muser = this.GetUserCode(); _EQPMaintainLog.Mdate = currentDateTime.DBDate; _EQPMaintainLog.Mtime = currentDateTime.DBTime; _facade.AddEQPMaintainLog(_EQPMaintainLog); } } this.RequestData(); }
protected override void AddDomainObject(object domainObject) { if (_facade == null) { _facade = new BenQGuru.eMES.Material.EquipmentFacade(base.DataProvider); } this.DataProvider.BeginTransaction(); try { this._facade.AddEQPLOG((Domain.Equipment.EQPLog)domainObject); object objEqp = _facade.GetEquipment(this.EQPID); if (objEqp != null) { (objEqp as Domain.Equipment.Equipment).Eqpstatus = this.drpEQPStatusEdit.SelectedValue.Trim(); _facade.UpdateEquipment((objEqp as Domain.Equipment.Equipment)); } } catch (Exception ex) { this.DataProvider.RollbackTransaction(); } this.DataProvider.CommitTransaction(); }
protected override object GetEditObject() { if (_facade == null) { _facade = new Material.EquipmentFacade(base.DataProvider); } Domain.Equipment.Equipment route = this._facade.CreateEquipment(); route.EqpId = FormatHelper.PKCapitalFormat(FormatHelper.CleanString(this.txtEQPIDEdit.Text, 40)); route.Model = FormatHelper.CleanString(this.txtEQPModelEdit.Text, 40); route.Type = FormatHelper.CleanString(this.drpTypeEdit.SelectedValue, 40); route.EqpDesc = FormatHelper.CleanString(this.TextBoxEQPDESCEdit.Text, 100); route.MaintainUser = this.GetUserCode(); route.Eattribute1 = FormatHelper.CleanString(this.txtEattribute1Edit.Text, 100); route.Eattribute2 = FormatHelper.CleanString(this.txtEattribute2Edit.Text, 100); route.Eattribute3 = FormatHelper.CleanString(this.txtEattribute3Edit.Text, 100); route.Contact = FormatHelper.CleanString(this.txtContactEdit.Text, 40); route.Eqpcompany = FormatHelper.CleanString(this.TxtEQPCompanyEdit.Text, 100); //route.Eqpstatus = FormatHelper.CleanString(this.txtEQPStatusEdit.Text,40); route.Eqpname = FormatHelper.CleanString(this.txtEQPNameEdit.Text, 100); route.Eqptype = FormatHelper.CleanString(this.txtEQPTypeEdit.Text, 40); route.Telphone = FormatHelper.CleanString(this.txtTelPhoneEdit.Text, 40); return(route); }
protected void cmdSave_ServerClick(object sender, System.EventArgs e) { if (_equipmentFacade == null) { _equipmentFacade = new BenQGuru.eMES.Material.EquipmentFacade(this.DataProvider); } if (ValidateInput()) { if (_equipmentFacade.CheckEQPTSLogExists(this.EqpId, EquipmentTSLogStatus.EquipmentTSLogStatus_New) > 0) { WebInfoPublish.Publish(this, "$EQPTSLog_Exists", this.languageComponent1); } else { DBDateTime dbDateTime = FormatHelper.GetNowDBDateTime(DataProvider); EQPTSLog eqptsLog = new EQPTSLog(); eqptsLog.Eqpid = this.EqpId; eqptsLog.FindUser = this.GetUserCode(); eqptsLog.TsInfo = FormatHelper.CleanString(this.txtTsinfo.Text, 400); eqptsLog.FindMdate = dbDateTime.DBDate; eqptsLog.FindMtime = dbDateTime.DBTime; eqptsLog.Status = EquipmentTSLogStatus.EquipmentTSLogStatus_New; eqptsLog.Duration = 0; eqptsLog.MaintainUser = this.GetUserCode(); eqptsLog.Mdate = dbDateTime.DBDate; eqptsLog.Mtime = dbDateTime.DBTime; _equipmentFacade.AddEQPTSLog(eqptsLog); WebInfoPublish.Publish(this, "$AddEQPTSLog_Success", this.languageComponent1); } this.ClientScript.RegisterStartupScript(base.GetType(), "CloseThis", "window.close();", true); } }
protected override void AddDomainObject(object domainObject) { if (_facade == null) { _facade = new BenQGuru.eMES.Material.EquipmentFacade(this.DataProvider); } this._facade.AddEquipmentType((Domain.Equipment.EquipmentType)domainObject); }
protected override void UpdateDomainObject(object domainObject) { if (_facade == null) { _facade = new BenQGuru.eMES.Material.EquipmentFacade(base.DataProvider); } this._facade.UpdateEQPMaintenance((Domain.Equipment.EQPMaintenance)domainObject); }
protected override int GetRowCount() { if (_facade == null) { _facade = new BenQGuru.eMES.Material.EquipmentFacade(base.DataProvider); } return(this._facade.QueryEQPOEECount( FormatHelper.PKCapitalFormat(FormatHelper.CleanString(this.txtEQPIDQuery.Text)))); }
protected override void DeleteDomainObjects(ArrayList domainObjects) { if (_facade == null) { _facade = new BenQGuru.eMES.Material.EquipmentFacade(base.DataProvider); } this._facade.DeleteEQPMaintenance((Domain.Equipment.EQPMaintenance[])domainObjects.ToArray(typeof(Domain.Equipment.EQPMaintenance))); }
protected override object[] LoadDataSource(int inclusive, int exclusive) { if (_facade == null) { _facade = new BenQGuru.eMES.Material.EquipmentFacade(base.DataProvider); } return(this._facade.QueryEQPOEE( FormatHelper.PKCapitalFormat(FormatHelper.CleanString(this.txtEQPIDQuery.Text)), inclusive, exclusive)); }
protected override object[] LoadDataSource(int inclusive, int exclusive) { if (_facade == null) { _facade = new BenQGuru.eMES.Material.EquipmentFacade(base.DataProvider); } return(this._facade.QueryEQPMaintenance( FormatHelper.CleanString(this.txtEQPIDQuery.Text), FormatHelper.CleanString(this.drpCycleQuery.SelectedValue), FormatHelper.CleanString(this.ddlEQPMaintenanceTypeQuery.SelectedValue), inclusive, exclusive)); }
protected override int GetRowCount() { if (_facade == null) { _facade = new BenQGuru.eMES.Material.EquipmentFacade(base.DataProvider); } return(this._facade.QueryEQPMaintenanceCount( FormatHelper.CleanString(this.txtEQPIDQuery.Text), FormatHelper.CleanString(this.drpCycleQuery.SelectedValue), FormatHelper.CleanString(this.ddlEQPMaintenanceTypeQuery.SelectedValue) )); }
protected override object[] LoadDataSource(int inclusive, int exclusive) { if (_facade == null) { _facade = new BenQGuru.eMES.Material.EquipmentFacade(base.DataProvider); } int beginDate = FormatHelper.TODateInt(this.txtDateUseBeginQuery.Text.Trim()); int endDate = FormatHelper.TODateInt(this.txtDateUseEndQuery.Text.Trim()); return(this._facade.QueryEQPUseInfo( FormatHelper.PKCapitalFormat(FormatHelper.CleanString(this.txtEQPIDQuery.Text)), beginDate, endDate, inclusive, exclusive)); }
protected override object GetEditObject() { if (_facade == null) { _facade = new BenQGuru.eMES.Material.EquipmentFacade(this.DataProvider); } Domain.Equipment.EquipmentType equipmentType = this._facade.CreateEquipmentType(); equipmentType.Eqptype = FormatHelper.PKCapitalFormat(FormatHelper.CleanString(this.txtEQPTypeEdit.Text, 40)); equipmentType.Eqptypedesc = FormatHelper.CleanString(this.txtEQPTypeDescEdit.Text, 100); equipmentType.MaintainUser = this.GetUserCode(); return(equipmentType); }
protected override int GetRowCount() { if (_facade == null) { _facade = new BenQGuru.eMES.Material.EquipmentFacade(base.DataProvider); } int beginDate = FormatHelper.TODateInt(this.txtDateUseBeginQuery.Text.Trim()); int endDate = FormatHelper.TODateInt(this.txtDateUseEndQuery.Text.Trim()); return(this._facade.QueryEQPUseInfoCount( FormatHelper.PKCapitalFormat(FormatHelper.CleanString(this.txtEQPIDQuery.Text)), beginDate, endDate)); }
protected override object[] LoadDataSource(int inclusive, int exclusive) { if (_facade == null) { _facade = new BenQGuru.eMES.Material.EquipmentFacade(base.DataProvider); } //return this._facade.QueryEquipmen( // FormatHelper.PKCapitalFormat(FormatHelper.CleanString(this.txtEQPIDQuery.Text)), this.txtEQPDESQuery.Text.Trim(), this.drpEQPStatusQuery.Text.Trim(), // inclusive, exclusive); return(this._facade.QueryEquipmen( FormatHelper.PKCapitalFormat(FormatHelper.CleanString(this.txtEQPIDQuery.Text)), this.txtEQPDESQuery.Text.Trim(), this.drpTypeQuery.Text.Trim(), this.drpEQPStatusQuery.Text.Trim(), inclusive, exclusive)); }
protected override object GetEditObject(GridRecord row) { if (_facade == null) { _facade = new BenQGuru.eMES.Material.EquipmentFacade(base.DataProvider); } object obj = _facade.GetEQPTSLog(int.Parse(row.Items.FindItemByKey("Serial").Text.ToString())); if (obj != null) { return((Domain.Equipment.EQPTSLog)obj); } return(null); }
protected override object GetEditObject(GridRecord row) { if (_facade == null) { _facade = new BenQGuru.eMES.Material.EquipmentFacade(base.DataProvider); } object obj = _facade.GetEQPUseInfo(row.Items.FindItemByKey("EQPID").Text.ToString(), int.Parse(row.Items.FindItemByKey("UseDateUnVisible").Text.Trim())); if (obj != null) { return((Domain.Equipment.EQPUseInfo)obj); } return(null); }
protected override object GetEditObject(GridRecord row) { if (_facade == null) { _facade = new BenQGuru.eMES.Material.EquipmentFacade(base.DataProvider); } object obj = _facade.GetEQPMaintenance(row.Items.FindItemByKey("EQPID").Text.ToString(), row.Items.FindItemByKey("MaintenanceItem").Text.ToString(), row.Items.FindItemByKey("MaintenanceType").Text.ToString()); if (obj != null) { return((Domain.Equipment.EQPMaintenance)obj); } return(null); }
protected string GetEqpTSTypeDesc(string tsType) { if (_facade == null) { _facade = new BenQGuru.eMES.Material.EquipmentFacade(base.DataProvider); } object obj = _facade.GetEquipmentTsType(tsType); if (obj != null) { return((obj as Domain.Equipment.EquipmentTsType).Eqptstypedesc); } return(" "); }
protected override void cmdAdd_Click(object sender, System.EventArgs e) { if (_facade == null) { _facade = new BenQGuru.eMES.Material.EquipmentFacade(base.DataProvider); } this.DataProvider.BeginTransaction(); if (_facade.CheckEQPTSLogExists(this.txtEQPIDQuery.Text, EquipmentTSLogStatus.EquipmentTSLogStatus_New) > 0) { WebInfoPublish.Publish(this, "$EQPTSLog_Exists", this.languageComponent1); } else { PageCheckManager manager = new PageCheckManager(); manager.Add(new LengthCheck(this.lblEqpTsInfoEdit, this.txtEqpTsInfoEdit, 400, true)); if (!manager.Check()) { WebInfoPublish.Publish(this, manager.CheckMessage, this.languageComponent1); return; } DBDateTime dbDateTime = FormatHelper.GetNowDBDateTime(DataProvider); Domain.Equipment.EQPTSLog eqptsLog = new Domain.Equipment.EQPTSLog(); eqptsLog.Eqpid = this.txtEQPIDQuery.Text; eqptsLog.FindUser = this.GetUserCode(); eqptsLog.TsInfo = FormatHelper.CleanString(this.txtEqpTsInfoEdit.Text, 400); eqptsLog.FindMdate = dbDateTime.DBDate; eqptsLog.FindMtime = dbDateTime.DBTime; eqptsLog.Status = EquipmentTSLogStatus.EquipmentTSLogStatus_New; eqptsLog.Duration = 0; eqptsLog.MaintainUser = this.GetUserCode(); eqptsLog.Mdate = dbDateTime.DBDate; eqptsLog.Mtime = dbDateTime.DBTime; _facade.AddEQPTSLog(eqptsLog); //WebInfoPublish.Publish(this, "$AddEQPTSLog_Success", this.languageComponent1); } this.DataProvider.CommitTransaction(); this.gridHelper.RefreshData(); }
protected override void DeleteDomainObjects(ArrayList domainObjects) { if (_facade == null) { _facade = new BenQGuru.eMES.Material.EquipmentFacade(this.DataProvider); } foreach (Domain.Equipment.EquipmentType epqType in domainObjects) { int count = _facade.QueryEquipmentCountByType(epqType.Eqptype); if (count > 0) { WebInfoPublish.PublishInfo(this, "$EQPTYPE_CONNOT_DELETE $EQPTYPE:" + epqType.Eqptype, this.languageComponent1); return; } } this._facade.DeleteEquipmentType((Domain.Equipment.EquipmentType[])domainObjects.ToArray(typeof(Domain.Equipment.EquipmentType))); }
protected override void DeleteDomainObjects(ArrayList domainObjects) { if (_facade == null) { _facade = new BenQGuru.eMES.Material.EquipmentFacade(base.DataProvider); } this.DataProvider.BeginTransaction(); try { this._facade.DeleteEQPTSLog((Domain.Equipment.EQPTSLog[])domainObjects.ToArray(typeof(Domain.Equipment.EQPTSLog))); } catch (Exception ex) { this.DataProvider.RollbackTransaction(); } this.DataProvider.CommitTransaction(); }
private void drpEQPTSTypeEdit_Load() { if (!this.IsPostBack) { if (_facade == null) { _facade = new BenQGuru.eMES.Material.EquipmentFacade(base.DataProvider); } object[] objs = _facade.GetAllEquipmentTsType(); foreach (Domain.Equipment.EquipmentTsType type in objs) { this.drpEqpTSTypeEdit.Items.Add(new ListItem(type.Eqptstype, type.Eqptstype)); } this.drpEqpTSTypeEdit.Items.Insert(0, new ListItem("", "")); } }
protected override object GetEditObject() { if (_facade == null) { _facade = new Material.EquipmentFacade(base.DataProvider); } DBDateTime dbDateTime = FormatHelper.GetNowDBDateTime(this.DataProvider); Domain.Equipment.EQPLog route = this._facade.CreateNewEQPLOG(); //route.Serial = int.Parse(); route.Eqpid = FormatHelper.PKCapitalFormat(FormatHelper.CleanString(this.txtEQPIDQuery.Text, 40)); route.Memo = FormatHelper.CleanString(this.txtEqpMemoEdit.Text, 400); route.MaintainUser = this.GetUserCode(); route.Eqpstatus = FormatHelper.CleanString(this.drpEQPStatusEdit.SelectedValue, 40); route.Mdate = dbDateTime.DBDate; route.Mtime = dbDateTime.DBTime; return(route); }
protected override object GetEditObject() { if (_facade == null) { _facade = new Material.EquipmentFacade(base.DataProvider); } DBDateTime currentDateTime = FormatHelper.GetNowDBDateTime(this.DataProvider); Domain.Equipment.EQPMaintenance maintenance = this._facade.CreateNewEQPMaintenance(); maintenance.Eqpid = FormatHelper.PKCapitalFormat(FormatHelper.CleanString(this.txtEQPIDEdit.Text, 40)); maintenance.MaintainITEM = FormatHelper.CleanString(this.txtMaintenanceItemEdit.Text, 400); maintenance.CycleType = this.drpCycleEdit.SelectedValue; maintenance.MaintainType = FormatHelper.CleanString(this.ddlMaintenanceTypeEdit.SelectedValue, 40); maintenance.Frequency = int.Parse(FormatHelper.CleanString(this.txtFrequencyEdit.Text, 6)); maintenance.Muser = this.GetUserCode(); maintenance.Mdate = currentDateTime.DBDate; maintenance.Mtime = currentDateTime.DBTime; return(maintenance); }
private void drpTypeQuery_Load()//Added by Jarvis { if (!this.IsPostBack) { if (_facade == null) { _facade = new BenQGuru.eMES.Material.EquipmentFacade(base.DataProvider); } object[] objs = _facade.GetAllEquipmentType(); if (objs == null) { return; } foreach (Domain.Equipment.EquipmentType type in objs) { this.drpTypeQuery.Items.Add(new ListItem(type.Eqptype, type.Eqptype)); } this.drpTypeQuery.Items.Insert(0, new ListItem("", "")); } }
protected override object GetEditObject() { if (_facade == null) { _facade = new Material.EquipmentFacade(base.DataProvider); } DBDateTime dbDateTime = FormatHelper.GetNowDBDateTime(this.DataProvider); Domain.Equipment.EQPOEE route = this._facade.CreateNewEQPOEE(); route.Eqpid = FormatHelper.PKCapitalFormat(FormatHelper.CleanString(this.txtEQPIDEdit.Text, 40)); route.Sscode = FormatHelper.CleanString(this.drpStepSequenceCodeEdit.SelectedValue, 40); route.ResCode = FormatHelper.CleanString(this.txtOpCodeEdit.Text.Trim()); route.Worktime = int.Parse(FormatHelper.CleanString(this.txtEQPWorkingTimeEdit.Text, 8)); route.MaintainUser = this.GetUserCode(); route.Mdate = dbDateTime.DBDate; route.Mtime = dbDateTime.DBTime; return(route); }
protected override object[] LoadDataSource(int inclusive, int exclusive) { PageCheckManager manager = new PageCheckManager(); manager.Add(new LengthCheck(this.lblEQPIDQuery, this.txtEQPIDQuery, int.MaxValue, true)); if (!manager.Check()) { WebInfoPublish.Publish(this, manager.CheckMessage, this.languageComponent1); return(null); } if (_facade == null) { _facade = new BenQGuru.eMES.Material.EquipmentFacade(base.DataProvider); } return(this._facade.QueryEQPMaintenanceForAdd( FormatHelper.CleanString(this.txtEQPIDQuery.Text), FormatHelper.CleanString(this.drpCycleQuery.SelectedValue), FormatHelper.CleanString(this.ddlEQPMaintenanceTypeQuery.SelectedValue), inclusive, exclusive)); }
protected override void DeleteDomainObjects(ArrayList domainObjects) { if (_facade == null) { _facade = new BenQGuru.eMES.Material.EquipmentFacade(base.DataProvider); } this.DataProvider.BeginTransaction(); try { foreach (Domain.Equipment.Equipment obj in domainObjects) { // 1. 该设备ID在设备维修日志(TBLEQPTSLOG)中状态为New的不允许删除。 // s2. 设备保养计划(TBLEQPMaintenance)存在该设备ID也不允许删除。 int tsLogCount = this._facade.CheckEQPTSLogExists(obj.EqpId, EquipmentTSLogStatus.EquipmentTSLogStatus_New); if (tsLogCount > 0) { this.DataProvider.RollbackTransaction(); WebInfoPublish.PublishInfo(this, "$EQPID_TSLOG_CONNOT_DELETE $EQPID:" + obj.EqpId, this.languageComponent1); return; } int maintenanceCount = this._facade.QueryEQPMaintenanceCount(obj.EqpId, "", ""); if (maintenanceCount > 0) { this.DataProvider.RollbackTransaction(); WebInfoPublish.PublishInfo(this, "$EQPID_EQPMaintenance_CONNOT_DELETE $EQPID:" + obj.EqpId, this.languageComponent1); return; } this._facade.DeleteEquipment(obj); } } catch (Exception ex) { this.DataProvider.RollbackTransaction(); } this.DataProvider.CommitTransaction(); }