private void _helper_LoadGridDataSource(object sender, EventArgs e) { //将序列号转换为SourceCode DataCollectFacade dataCollectfacade = new DataCollectFacade(this.DataProvider); //对于序列号的输入框,需要进行一下处理 string startRCard = FormatHelper.CleanString(this.txtStartSnQuery.Text.Trim().ToUpper()); string endRCard = FormatHelper.CleanString(this.txtEndSnQuery.Text.Trim().ToUpper()); //转换成SourceCard string startSourceCard = dataCollectfacade.GetSourceCard(startRCard, string.Empty); string endSourceCard = dataCollectfacade.GetSourceCard(endRCard, string.Empty); //end FacadeFactory facadeFactory = new FacadeFactory(base.DataProvider); (e as WebQueryEventArgsNew).GridDataSource = facadeFactory.CreateQuerySMTNGFacade().QuerySMTNG( FormatHelper.CleanString(this.txtConditionItem.Text).ToUpper(), FormatHelper.CleanString(this.txtConditionMo.Text).ToUpper(), FormatHelper.CleanString(this.txtConditionStepSequence.Text).ToUpper(), FormatHelper.CleanString(startSourceCard), FormatHelper.CleanString(endSourceCard), (e as WebQueryEventArgsNew).StartRow, (e as WebQueryEventArgsNew).EndRow); (e as WebQueryEventArgsNew).RowCount = facadeFactory.CreateQuerySMTNGFacade().QuerySMTNGCount( FormatHelper.CleanString(this.txtConditionItem.Text).ToUpper(), FormatHelper.CleanString(this.txtConditionMo.Text).ToUpper(), FormatHelper.CleanString(this.txtConditionStepSequence.Text).ToUpper(), FormatHelper.CleanString(startSourceCard), FormatHelper.CleanString(endSourceCard)); }
private void Collect() { object objVersion = null; if (chkAutoGetVersion.Checked == true) /*获取版本信息*/ { DataCollect.DataCollectFacade dcf = new DataCollectFacade(DataProvider); //根据当前序列号获取产品的原始的序列号 string sourceRCard = dcf.GetSourceCard((Convert.ToString(this.inputBuffer[0])).Trim().ToUpper(), string.Empty); objVersion = dcf.GetVersionCollect(sourceRCard); if (objVersion == null || (objVersion != null && (objVersion as Domain.DataCollect.VersionCollect).VersionInfo == String.Empty)) { ucMessage.Add(new UserControl.Message(MessageType.Error, "$CS_SOFTWAREVERSION_EMPTY")); Domain.DataCollect.VersionError ve = new BenQGuru.eMES.Domain.DataCollect.VersionError(); this.inputBuffer.Clear(); this.ucLEInput.Value = ""; this.showInputHint(); ucLEInput.TextFocus(false, true); return; } } this.inputBuffer.Add(this.ucLEInput.Value.Trim().ToUpper()); // 存库 this.doAction(objVersion); this.inputBuffer.Clear(); }
public Messages Execute(ActionEventArgs actionEventArgs, ActionCheckStatus actionCheckStatus) { Messages messages = new Messages(); DataCollectDebug dataCollectDebug = new DataCollectDebug(this.GetType().ToString() + "Collect"); dataCollectDebug.WhenFunctionIn(messages); try { ActionOnLineHelper dataCollect = new ActionOnLineHelper(this.DataProvider); //填写SIMULATION 检查工单、ID、途程、操作 messages.AddMessages(dataCollect.CheckID(actionEventArgs, actionCheckStatus)); if (messages.IsSuccess()) { //Laws Lu,2005/08/15,新增 完工逻辑,在其他Check都通过的情况下,所有的RunningCard应该是GOOD状态 //暂时不考虑线外工序 DataCollectFacade dataCollectFacade = new DataCollectFacade(this.DataProvider); if (actionEventArgs.ProductInfo.NowSimulation.RouteCode != "" && dataCollectFacade.OPIsMORouteLastOP( actionEventArgs.ProductInfo.NowSimulation.MOCode , actionEventArgs.ProductInfo.NowSimulation.RouteCode , actionEventArgs.ProductInfo.NowSimulation.OPCode)) { actionEventArgs.ProductInfo.NowSimulation.IsComplete = "1"; actionEventArgs.ProductInfo.NowSimulation.EAttribute1 = "GOOD"; //完工自动入库 dataCollectFacade.AutoInventory(actionEventArgs.ProductInfo.NowSimulation, actionEventArgs.UserCode); } actionEventArgs.ProductInfo.NowSimulation.ShelfNO = ""; //End Laws Lu if (actionCheckStatus.NeedUpdateSimulation == true) { messages.AddMessages(dataCollect.Execute(actionEventArgs)); } else { messages.AddMessages(dataCollect.Execute(actionEventArgs, actionCheckStatus)); } if (messages.IsSuccess()) { //填写测试报表 TODO //if (actionCheckStatus.NeedFillReport == true) //{ // ReportHelper reportCollect= new ReportHelper(this.DataProvider); // messages.AddMessages(reportCollect.ReportLineQuanMaster(this.DataProvider,actionEventArgs.ActionType,actionEventArgs.ProductInfo, actionCheckStatus)); // messages.AddMessages(reportCollect.ReportResQuanMaster(this.DataProvider,actionEventArgs.ActionType,actionEventArgs.ProductInfo, actionCheckStatus)); //} //将Action加入列表 actionCheckStatus.ActionList.Add(actionEventArgs); } } } catch (Exception e) { messages.Add(new Message(e)); } dataCollectDebug.WhenFunctionOut(messages); return(messages); }
//检查此Rcard所属栈板下Rcard在同一垛位下 private bool CheckRcardIsInTheSameStack(string pallet, string stackCode) { InventoryFacade inventoryFacade = new InventoryFacade(this.DataProvider); PackageFacade packageFacade = new PackageFacade(this.DataProvider); DataCollectFacade dataCollectFacade = new DataCollectFacade(this.DataProvider); object[] pallet2RCardList = packageFacade.GetPallet2RCardListByPallet(pallet); if (pallet2RCardList == null) { return(true); } for (int i = 0; i < pallet2RCardList.Length; i++) { string cartonCode = string.Empty; SimulationReport simulationReport = (SimulationReport)dataCollectFacade.GetLastSimulationReport(((Pallet2RCard)pallet2RCardList[i]).RCard); if (simulationReport != null) { cartonCode = simulationReport.CartonCode; } object[] stack2RcardList = inventoryFacade.QueryStacktoRcardByRcardAndCarton(((Pallet2RCard)pallet2RCardList[i]).RCard, cartonCode); if (stack2RcardList != null && !((StackToRcard)stack2RcardList[0]).StackCode.Equals(stackCode)) { ApplicationRun.GetInfoForm().Add( new UserControl.Message(MessageType.Error, "$CS_RCARD_IS_NOT_INSAME_STACK:" + ((StackToRcard)stack2RcardList[0]).StackCode)); return(false); } } return(true); }
public Messages CheckIDIn(ActionEventArgs actionEventArgs) { Messages messages = new Messages(); DataCollectDebug dataCollectDebug = new DataCollectDebug(this.GetType().ToString() + "GetIDInfo"); dataCollectDebug.WhenFunctionIn(messages); try { DataCollectFacade dataCollect = new DataCollectFacade(this.DataProvider); if (((PackActionEventArgs)actionEventArgs).IDDatas == null) { throw new Exception("$CS_Sys_Pack_LostOPParam"); } string LotCode = ((PackActionEventArgs)actionEventArgs).IDDatas[0].ToString(); messages.AddMessages(dataCollect.CheckID(actionEventArgs.RunningCard, actionEventArgs.RunningCard, actionEventArgs.ResourceCode, actionEventArgs.UserCode, actionEventArgs.ProductInfo)); //能否包装的其他检查 TODO // actionEventArgs.ProductInfo.NowSimulation.LOTNO = LotCode; actionEventArgs.ProductInfo.NowSimulationReport.LOTNO = LotCode; } catch (Exception e) { messages.Add(new Message(e)); } dataCollectDebug.WhenFunctionOut(messages); return(messages); }
public Messages IDTran(XmlNode node) { string action = node.Attributes["action"].Value; string card = node["code"].InnerText; string res = node["resource"].InnerText; string usr = node["user"].InnerText; string newID = node["newID"].InnerText; string imei = node["imei"].InnerText; Messages productmessages = new Messages(); try { DataCollectFacade dataFacade = new DataCollectFacade(); string info = dataFacade.SaveTransferInfo(card, res, usr, newID, imei, 0); if (info != "OK") { productmessages.Add(new Message(MessageType.Error, info)); } return(productmessages); } catch (Exception e) { productmessages.Add(new Message(e)); return(productmessages); } }
/// <summary> /// 良品采集 /// </summary> /// <param name="domainDataProvider"></param> /// <param name="iD"></param> /// <param name="actionType"></param> /// <param name="resourceCode"></param> /// <param name="userCode"></param> /// <param name="product"></param> /// <param name="datas1">工单</param> /// <param name="datas2">NULL</param> /// <returns></returns> public Messages Execute(ActionEventArgs actionEventArgs) { Messages messages = new Messages(); DataCollectDebug dataCollectDebug = new DataCollectDebug(this.GetType().ToString() + "Collect"); dataCollectDebug.WhenFunctionIn(messages); try { DataCollectFacade facade = new DataCollectFacade(this.DataProvider); ActionOnLineHelper helper = new ActionOnLineHelper(this.DataProvider); if (actionEventArgs.ProductInfo == null) { // 获得LastSimulation messages.AddMessages(helper.GetIDInfo(actionEventArgs.RunningCard)); if (messages.IsSuccess()) { actionEventArgs.ProductInfo = (ProductInfo)messages.GetData().Values[0]; } } if (actionEventArgs.ProductInfo == null) { throw new Exception("$NoProductInfo"); } if (actionEventArgs.ProductInfo.LastSimulation == null) { throw new Exception("$NoSimulationInfo"); } if (messages.IsSuccess()) { facade.CheckMO(actionEventArgs.ProductInfo.LastSimulation.MOCode, actionEventArgs.ProductInfo); facade.GetRouteOPOnline(actionEventArgs.RunningCard, actionEventArgs.ActionType, actionEventArgs.ResourceCode, actionEventArgs.UserCode, actionEventArgs.ProductInfo); DBDateTime dbDateTime; dbDateTime = FormatHelper.GetNowDBDateTime(DataProvider); actionEventArgs.ProductInfo.NowSimulation.MaintainUser = actionEventArgs.UserCode; actionEventArgs.ProductInfo.NowSimulation.MaintainDate = dbDateTime.DBDate; actionEventArgs.ProductInfo.NowSimulation.MaintainTime = dbDateTime.DBTime; // 填写NowSimulationReport actionEventArgs.ProductInfo.NowSimulationReport = helper.FillSimulationReport(actionEventArgs.ProductInfo); // 填写SoftwareVersion报表 this.WriteSoftwareInfo((SoftwareActionEventArgs)actionEventArgs, facade); } } catch (Exception e) { messages.Add(new Message(e)); } dataCollectDebug.WhenFunctionOut(messages); return(messages); }
private void WriteECNInfo(EcnTryActionEventArgs actionEventArgs, DataCollectFacade facade, ActionCheckStatus actionCheckStatus) { SimulationReport report = actionEventArgs.ProductInfo.NowSimulationReport; OnWIPECN onWIPECN = facade.CreateNewOnWIPECN(); onWIPECN.ECNNO = actionEventArgs.ECNNo; onWIPECN.RunningCard = report.RunningCard; onWIPECN.RunningCardSequence = report.RunningCardSequence; onWIPECN.MOCode = report.MOCode; onWIPECN.ItemCode = report.ItemCode; onWIPECN.ResourceCode = report.ResourceCode; onWIPECN.OPCode = report.OPCode; onWIPECN.RouteCode = report.RouteCode; onWIPECN.ModelCode = report.ModelCode; onWIPECN.MaintainDate = report.MaintainDate; onWIPECN.MaintainTime = report.MaintainTime; onWIPECN.MaintainUser = report.MaintainUser; onWIPECN.ShiftTypeCode = report.ShiftTypeCode; onWIPECN.StepSequenceCode = report.StepSequenceCode; onWIPECN.SegmnetCode = report.SegmentCode; onWIPECN.ShiftCode = report.ShiftCode; onWIPECN.TimePeriodCode = report.TimePeriodCode; onWIPECN.MOSeq = report.MOSeq; // Added by Icyer 2007/07/02 if (actionCheckStatus == null || actionCheckStatus.NeedUpdateSimulation == true) { facade.AddOnWIPECN(onWIPECN); } else { actionEventArgs.OnWIP.Add(onWIPECN); } }
private void WriteSoftwareInfo(SoftwareActionEventArgs actionEventArgs, DataCollectFacade facade, ActionCheckStatus actionCheckStatus) { SimulationReport report = actionEventArgs.ProductInfo.NowSimulationReport; OnWIPSoftVersion onWIPSoftVersion = facade.CreateNewOnWIPSoftVersion(); onWIPSoftVersion.SoftwareVersion = actionEventArgs.SoftwareVersion; onWIPSoftVersion.SoftwareName = actionEventArgs.SoftwareName; onWIPSoftVersion.RunningCard = report.RunningCard; onWIPSoftVersion.RunningCardSequence = report.RunningCardSequence; onWIPSoftVersion.MOCode = report.MOCode; onWIPSoftVersion.ItemCode = report.ItemCode; onWIPSoftVersion.ResourceCode = report.ResourceCode; onWIPSoftVersion.OPCode = report.OPCode; onWIPSoftVersion.RouteCode = report.RouteCode; onWIPSoftVersion.ModelCode = report.ModelCode; onWIPSoftVersion.MaintainDate = report.MaintainDate; onWIPSoftVersion.MaintainTime = report.MaintainTime; onWIPSoftVersion.MaintainUser = report.MaintainUser; onWIPSoftVersion.ShiftTypeCode = report.ShiftTypeCode; onWIPSoftVersion.StepSequenceCode = report.StepSequenceCode; onWIPSoftVersion.SegmnetCode = report.SegmentCode; onWIPSoftVersion.ShiftCode = report.ShiftCode; onWIPSoftVersion.TimePeriodCode = report.TimePeriodCode; onWIPSoftVersion.MOSeq = report.MOSeq; // Added by Icyer 2007/07/02 if (actionCheckStatus == null || actionCheckStatus.NeedUpdateSimulation == true) { facade.AddOnWIPSoftVersion(onWIPSoftVersion); } else { actionEventArgs.OnWIP.Add(onWIPSoftVersion); } }
private void QueryByEvent() { string eventCode = FormatHelper.PKCapitalFormat(FormatHelper.CleanString(this.ucLabelEditEventQuery.Value)); DataCollectFacade dcf = new DataCollectFacade(this.DataProvider); object[] eventList = dcf.GetDownEventList(eventCode); if (eventList == null || eventList.Length == 0) { this.ucLabelEditEventQuery.TextFocus(false, true); return; } DataRow rowNew; this.m_EventList.Rows.Clear(); foreach (DownWithRCardInfo down in eventList) { if (down.DownQuantity > 0) { rowNew = this.m_EventList.NewRow(); rowNew["EventCode"] = down.DownCode; rowNew["DownQty"] = down.DownQuantity; rowNew["DownReason"] = down.DownReason; this.m_EventList.Rows.Add(rowNew); } } this.m_EventList.AcceptChanges(); }
protected override int GetRowCount() { //将序列号转换为SourceCode DataCollectFacade dataCollectfacade = new DataCollectFacade(this.DataProvider); //对于序列号的输入框,需要进行一下处理 string startRCard = FormatHelper.CleanString(this.txtStartSnQuery.Text.Trim().ToUpper()); string endRCard = FormatHelper.CleanString(this.txtEndSnQuery.Text.Trim().ToUpper()); //转换成SourceCard string startSourceCard = dataCollectfacade.GetSourceCard(startRCard, string.Empty); string endSourceCard = dataCollectfacade.GetSourceCard(endRCard, string.Empty); //end if (_facade == null) { _facade = new QueryRMATSFacade(this.DataProvider); } return(this._facade.QueryRMAReworkCount( FormatHelper.PKCapitalFormat(startSourceCard), FormatHelper.PKCapitalFormat(endSourceCard), FormatHelper.CleanString(this.txtReMOQuery.Text.Trim()) )); }
//获取批号, 实际批量/标准批量与备注值 private void GetLotNo() { DataCollectFacade dcf = new DataCollectFacade(this.DataProvider); string rcard = this.ucLabelEditRcard.Value.ToUpper().Trim(); //根据当前序列号获取产品的原始序列号 string sourceRCard = dcf.GetSourceCard(rcard, string.Empty); if (rcard != String.Empty) { object obj = dcf.GetSimulation(sourceRCard); if (obj != null) { Simulation sim = obj as Simulation; string oqcLotNo = sim.LOTNO; ucLabelEditLotNo.Value = oqcLotNo; LabOQCLotKeyPress(); } else { ApplicationRun.GetInfoForm().Add(new UserControl.Message(MessageType.Error, "$NoProductInfo")); this.ucLabelEditRcard.Value = ""; this.ucLabelEditItemCode.Value = ""; this.ucLESeparateMemo.Value = ""; this.labelItemDescription.Text = ""; this.ucLSizeAndCapacityMore.Value = ""; this.ucLabelEditLotNo.TextFocus(false, true); } } else { ucLabelEditRcard.TextFocus(false, true); } }
/// <summary> /// Undo时更新Simulation数据 /// </summary> private void UndoNGSimulation(Simulation simulation, bool isNG, OnWIP wip) { // 更新Simulation DataCollectFacade dataCollectFacade = new DataCollectFacade(this.DataProvider); string lastAction = wip.Action; simulation.LastAction = lastAction; string[] actionList = simulation.ActionList.Split(';'); simulation.ActionList = string.Join(";", actionList, 0, actionList.Length - 2) + ";"; simulation.ProductStatus = wip.ActionResult; if (isNG == true) { simulation.NGTimes = simulation.NGTimes - 1; } simulation.IsComplete = FormatHelper.BooleanToString(false); //simulation.RunningCardSequence = wip.RunningCardSequence; // 保留测试信息 dataCollectFacade.UpdateSimulation(simulation); // 更新SimulationReport SimulationReport simulationReport = (SimulationReport)dataCollectFacade.GetLastSimulationReport(simulation.RunningCard); simulationReport.LastAction = lastAction; simulationReport.Status = wip.ActionResult; if (isNG == true) { simulationReport.NGTimes = simulationReport.NGTimes - 1; } simulationReport.IsComplete = FormatHelper.BooleanToString(false); //simulationReport.RunningCardSequence = wip.RunningCardSequence; // 保留测试信息 dataCollectFacade.UpdateSimulationReport(simulationReport); }
private void QueryByRCard() { string rcard = FormatHelper.PKCapitalFormat(FormatHelper.CleanString(this.ucLabelEditRcardQuery.Value)); if (string.IsNullOrEmpty(rcard)) { ApplicationRun.GetInfoForm().Add(new UserControl.Message(MessageType.Normal, "$CS_Please_Input_RunningCard")); this.ucLabelEditRcardQuery.TextFocus(false, true); return; } DataCollectFacade dcf = new DataCollectFacade(this.DataProvider); //获取当前序列号产品对应的最原始的序列号 string sourceRCard = dcf.GetSourceCard(rcard.Trim().ToUpper(), string.Empty); object[] rcardList = dcf.GetDownRCardListByCode(sourceRCard); if (rcardList == null || rcardList.Length == 0) { ApplicationRun.GetInfoForm().Add(new UserControl.Message(MessageType.Error, "$Error_RCardErrorOrNotInDown")); this.ucLabelEditRcardQuery.TextFocus(false, true); return; } else { this.BindRCardList(rcardList); this.ucLabelEditRCardEdit.TextFocus(true, true); } }
private void WriteTryInfo(EcnTryActionEventArgs actionEventArgs, DataCollectFacade facade, ActionCheckStatus actionCheckStatus) { SimulationReport report = actionEventArgs.ProductInfo.NowSimulationReport; List <string> TryList = new List <string>(); if (actionEventArgs.TryNo.Trim().Length > 0) { string TryCode = actionEventArgs.TryNo.Trim(); if (TryCode.IndexOf(",") >= 0) { string[] TryCodeList = TryCode.Split(','); for (int i = 0; i < TryCodeList.Length; i++) { TryList.Add(TryCodeList[i]); } } else { TryList.Add(TryCode); } } if (TryList.Count > 0) { for (int i = 0; i < TryList.Count; i++) { OnWIPTRY onWIPTRY = facade.CreateNewOnWIPTRY(); onWIPTRY.TRYNO = TryList[i].ToString().ToUpper(); onWIPTRY.RunningCard = report.RunningCard; onWIPTRY.RunningCardSequence = report.RunningCardSequence; onWIPTRY.MOCode = report.MOCode; onWIPTRY.ItemCode = report.ItemCode; onWIPTRY.ResourceCode = report.ResourceCode; onWIPTRY.OPCode = report.OPCode; onWIPTRY.RouteCode = report.RouteCode; onWIPTRY.ModelCode = report.ModelCode; onWIPTRY.MaintainDate = report.MaintainDate; onWIPTRY.MaintainTime = report.MaintainTime; onWIPTRY.MaintainUser = report.MaintainUser; onWIPTRY.ShiftTypeCode = report.ShiftTypeCode; onWIPTRY.StepSequenceCode = report.StepSequenceCode; onWIPTRY.SegmnetCode = report.SegmentCode; onWIPTRY.ShiftCode = report.ShiftCode; onWIPTRY.TimePeriodCode = report.TimePeriodCode; onWIPTRY.MOSeq = report.MOSeq; // Added by Icyer 2007/07/02 if (actionCheckStatus == null || actionCheckStatus.NeedUpdateSimulation == true) { facade.AddOnWIPTRY(onWIPTRY); } else { actionEventArgs.OnWIP.Add(onWIPTRY); } } } }
// Added by Icyer 2006/11/08 /// <summary> /// 做Undo /// </summary> public Messages UndoExecute(SplitIDActionEventArgs actionEventArgs) { Messages messages = new Messages(); DataCollectDebug dataCollectDebug = new DataCollectDebug(this.GetType().ToString() + "Collect"); dataCollectDebug.WhenFunctionIn(messages); try { if (((SplitIDActionEventArgs)actionEventArgs).SplitedIDs == null || ((SplitIDActionEventArgs)actionEventArgs).SplitedIDs.Length == 0) { throw new Exception("$CS_System_Params_Losted"); } DataCollectFacade dataCollectFacade = new DataCollectFacade(this.DataProvider); object[] oldSimulation = dataCollectFacade.GetSimulationFromTCard(actionEventArgs.RunningCard); if (oldSimulation == null || oldSimulation.Length == 0) { throw new Exception("$CS_System_Params_Losted"); } if (oldSimulation.Length != actionEventArgs.SplitedIDs.Length) { throw new Exception("$CS_System_Params_Losted"); } ActionOnLineHelper helper = new ActionOnLineHelper(this.DataProvider); MORunningCardFacade cardFacade = new MORunningCardFacade(this.DataProvider); // 依次操作每个序列号更改 for (int i = 0; i < actionEventArgs.SplitedIDs.Length; i++) { // 更新Simulation Simulation s = (Simulation)oldSimulation[i]; string oldRCard = s.RunningCard; decimal oldRCardSeq = s.RunningCardSequence; string strNewRCard = actionEventArgs.SplitedIDs[i].ToString(); string strSql = "UPDATE tblSimulation SET RCard='" + strNewRCard + "' WHERE RCard='" + oldRCard + "' AND RCardSeq=" + oldRCardSeq.ToString(); this.DataProvider.CustomExecute(new SQLCondition(strSql)); // 更新SimulationReport strSql = "UPDATE tblSimulationReport SET RCard='" + strNewRCard + "' WHERE RCard='" + oldRCard + "' AND RCardSeq=" + oldRCardSeq.ToString(); this.DataProvider.CustomExecute(new SQLCondition(strSql)); // 更新OnWIP strSql = "UPDATE tblOnWIP SET RCard='" + strNewRCard + "' WHERE RCard='" + oldRCard + "' AND RCardSeq=" + oldRCardSeq.ToString(); this.DataProvider.CustomExecute(new SQLCondition(strSql)); // 更新OnWIPTrans strSql = "UPDATE tblOnWIPCardTrans SET RCard='" + strNewRCard + "' WHERE RCard='" + oldRCard + "' AND RCardSeq=" + oldRCardSeq.ToString(); this.DataProvider.CustomExecute(new SQLCondition(strSql)); // 更新MOCard strSql = "UPDATE tblmorcard SET MORCardStart='" + strNewRCard + "',MORCardEnd='" + strNewRCard + "' WHERE MORCardStart='" + oldRCard + "' AND MOCode='" + s.MOCode + "' "; this.DataProvider.CustomExecute(new SQLCondition(strSql)); // 报表不用更新 } } catch (Exception e) { messages.Add(new Message(e)); } dataCollectDebug.WhenFunctionOut(messages); return(messages); }
// Added by Icyer 2006/12/15 // 检查工单 private Messages CheckMO(object act) { Messages msgs = new Messages(); BenQGuru.eMES.Common.DomainDataProvider.SQLDomainDataProvider domainProvider = null; if ((act as IDCTClient).DBConnection != null) { domainProvider = (act as IDCTClient).DBConnection as BenQGuru.eMES.Common.DomainDataProvider.SQLDomainDataProvider; } else { domainProvider = Common.DomainDataProvider.DomainDataProviderManager.DomainDataProvider() as BenQGuru.eMES.Common.DomainDataProvider.SQLDomainDataProvider; (act as IDCTClient).DBConnection = domainProvider; } MOFacade moFacade = new MOFacade(domainProvider); MO mo = (MO)moFacade.GetMO(act.ToString().ToUpper()); if (mo == null) { msgs.Add(new UserControl.Message(MessageType.Error, "$CS_MO_NOT_EXIST")); ProcessBeforeReturn(this.Status, msgs); return(msgs); } if (mo.MOStatus != BenQGuru.eMES.Web.Helper.MOManufactureStatus.MOSTATUS_RELEASE && mo.MOStatus != BenQGuru.eMES.Web.Helper.MOManufactureStatus.MOSTATUS_OPEN) { msgs.Add(new UserControl.Message(MessageType.Error, "$Error_CS_MO_Should_be_Release_or_Open")); ProcessBeforeReturn(this.Status, msgs); return(msgs); } MO2Route route = (MO2Route)moFacade.GetMONormalRouteByMOCode(mo.MOCode); if (route == null) { msgs.Add(new UserControl.Message(MessageType.Error, "$CS_MOnotNormalRoute")); ProcessBeforeReturn(this.Status, msgs); return(msgs); } DataCollectFacade dataCollectFacade = new DataCollectFacade(domainProvider); ItemRoute2OP op = dataCollectFacade.GetMORouteFirstOP(mo.MOCode, route.RouteCode); BenQGuru.eMES.BaseSetting.BaseModelFacade dataModel = new BenQGuru.eMES.BaseSetting.BaseModelFacade(domainProvider); if (dataModel.GetOperation2Resource(op.OPCode, (act as IDCTClient).ResourceCode) == null) { msgs.Add(new UserControl.Message(MessageType.Error, "$CS_Route_Failed_FirstOP $Domain_MO =" + mo.MOCode)); ProcessBeforeReturn(this.Status, msgs); return(msgs); } ProcessBeforeReturn(this.Status, msgs); return(msgs); }
protected void cmdScrap_ServerClick(object sender, System.EventArgs e) { ArrayList selected = this.gridHelper.GetCheckedRows(); string rcard = string.Empty; string mocode = this.txtMoCodeQuery.Text.Trim(); this.DataProvider.BeginTransaction(); try { SimulationReport simulationReport; DataCollectFacade dcf = new DataCollectFacade(this.DataProvider); InventoryFacade inventoryFacade = new InventoryFacade(this.DataProvider); DBDateTime currentDateTime = FormatHelper.GetNowDBDateTime(this.DataProvider); foreach (GridRecord row in selected) { rcard = row.Items.FindItemByKey("RunningCard").Value.ToString(); simulationReport = dcf.GetLastSimulationReport(rcard); if (simulationReport == null) { throw new Exception("$NoProductInfo $CS_Param_ID=" + rcard); } if (simulationReport.IsComplete == "1") { throw new Exception("$CS_ERROR_PRODUCT_ALREADY_COMPLETE $CS_Param_ID=" + rcard); } //在库不能拆解 object[] stackToRcards = inventoryFacade.QueryStacktoRcardByRcardAndCarton(simulationReport.RunningCard, simulationReport.CartonCode); if (stackToRcards != null) { throw new Exception("$CS_ERROR_PRODUCT_ALREADY_IN_Storge $CS_Param_ID=" + rcard); } //end this._MOFacade.DoScrap(simulationReport, currentDateTime, this.GetUserCode()); //拆Carton和栈板 Messages msg = new Messages(); msg.AddMessages(dcf.RemoveFromCarton(simulationReport.RunningCard, this.GetUserCode())); msg.AddMessages(dcf.RemoveFromPallet(simulationReport.RunningCard, this.GetUserCode(), true)); } this.DataProvider.CommitTransaction(); this.gridHelper.RequestData(); } catch (Exception ex) { this.DataProvider.RollbackTransaction(); ExceptionManager.Raise(this.GetType(), "$Error_RCardScrapError", ex); } }
private bool IsLastOP(DomainDataProvider.SQLDomainDataProvider dataProvider, string moCode, string routeCode, string opCode) { if (routeCode == string.Empty) { return(false); } DataCollectFacade dataCollectFacade = new DataCollectFacade(dataProvider); return(dataCollectFacade.OPIsMORouteLastOP(moCode, routeCode, opCode)); }
private void FLotCollectionCartonForLot_Load(object sender, EventArgs e) { //this._FunctionName = this.Text; //ucMessage.AddEx(this._FunctionName, "", new UserControl.Message("$CS_Please_Input_CartonNo"), false); //this.ucLabelCartonNo.TextFocus(false, true); m_DataCollectFacade = new DataCollectFacade(this.DataProvider); m_PackageFacade = new PackageFacade(this.DataProvider); m_ItemFacade = new ItemFacade(this.DataProvider); m_ItemLotFacade = new ItemLotFacade(this.DataProvider); this.InitPageLanguage(); }
public FCollectionEsopPicNGView() { InitializeComponent(); this.m_MOFacade = new MOFacade(this.DataProvider); this.m_ItemFacade = new ItemFacade(this.DataProvider); this.m_EsopPicsFacade = new EsopPicsFacade(this.DataProvider); this.m_DataCollectFacade = new DataCollectFacade(this.DataProvider); this._facade = new SystemSettingFacade(this.DataProvider); this.m_EsopPicsNGFacade = new EsopPicsNGFacade(this.DataProvider); this._tsFacade = new TSFacade(this.DataProvider); //this.InitPageLanguage(); }
private void txtRCard_TxtboxKeyPress(object sender, System.Windows.Forms.KeyPressEventArgs e) { if (e.KeyChar == '\r') { string rcard = txtRCard.Value.Trim().ToUpper(); //转换成起始序列号 DataCollectFacade dataCollectFacade = new DataCollectFacade(this.DataProvider); string sourceCard = dataCollectFacade.GetSourceCard(rcard, string.Empty); //end ProcessRCard(sourceCard); } }
private void QueryEvent(object sender, EventArgs e) { //将序列号转换为SourceCode DataCollectFacade dataCollectfacade = new DataCollectFacade(this.DataProvider); //对于序列号的输入框,需要进行一下处理 string startRCard = FormatHelper.CleanString(this.txtStartSnQuery.Text.Trim().ToUpper()); string endRCard = FormatHelper.CleanString(this.txtEndSnQuery.Text.Trim().ToUpper()); //转换成SourceCard string startSourceCard = dataCollectfacade.GetSourceCard(startRCard, string.Empty); string endSourceCard = dataCollectfacade.GetSourceCard(endRCard, string.Empty); //end int startDate = DefaultDateTime.DefaultToInt; int endDate = DefaultDateTime.DefaultToInt; startDate = FormatHelper.TODateInt(this.dateStartDateQuery.Text); endDate = FormatHelper.TODateInt(this.dateEndDateQuery.Text); FacadeFactory facadeFactory = new FacadeFactory(base.DataProvider); (e as WebQueryEventArgsNew).GridDataSource = facadeFactory.CreateQueryTSRecordFacade().QueryTSRecord_New( this.drpFGorSemiFG.SelectedValue, FormatHelper.PKCapitalFormat(FormatHelper.CleanString(this.txtConditionItem.Text)), FormatHelper.PKCapitalFormat(FormatHelper.CleanString(this.txtConditionMo.Text)), FormatHelper.PKCapitalFormat(FormatHelper.CleanString(startSourceCard)), FormatHelper.PKCapitalFormat(FormatHelper.CleanString(endSourceCard)), FormatHelper.PKCapitalFormat(FormatHelper.CleanString(this.txtReworkMo.Text)), FormatHelper.PKCapitalFormat(FormatHelper.CleanString(this.txtSegmentCodeQuery.Text)), FormatHelper.PKCapitalFormat(FormatHelper.CleanString(this.txtStepSequence.Text)), FormatHelper.PKCapitalFormat(FormatHelper.CleanString(this.txtOPCodeEdit.Text)), FormatHelper.PKCapitalFormat(FormatHelper.CleanString(this.txtBigSSCodeGroupQuery.Text)), FormatHelper.PKCapitalFormat(FormatHelper.CleanString(this.txtMaterialModelCodeQuery.Text)), FormatHelper.PKCapitalFormat(FormatHelper.CleanString(this.txtMaterialMachineTypeGroup.Text)), startDate, endDate, CheckBoxListBuilder.GetCheckedList(this.chkTSStateList), (e as WebQueryEventArgsNew).StartRow, (e as WebQueryEventArgsNew).EndRow); (e as WebQueryEventArgsNew).RowCount = facadeFactory.CreateQueryTSRecordFacade().QueryTSRecordCount_New( this.drpFGorSemiFG.SelectedValue, FormatHelper.PKCapitalFormat(FormatHelper.CleanString(this.txtConditionItem.Text)), FormatHelper.PKCapitalFormat(FormatHelper.CleanString(this.txtConditionMo.Text)), FormatHelper.PKCapitalFormat(FormatHelper.CleanString(startSourceCard)), FormatHelper.PKCapitalFormat(FormatHelper.CleanString(endSourceCard)), FormatHelper.PKCapitalFormat(FormatHelper.CleanString(this.txtReworkMo.Text)), FormatHelper.PKCapitalFormat(FormatHelper.CleanString(this.txtSegmentCodeQuery.Text)), FormatHelper.PKCapitalFormat(FormatHelper.CleanString(this.txtStepSequence.Text)), FormatHelper.PKCapitalFormat(FormatHelper.CleanString(this.txtOPCodeEdit.Text)), FormatHelper.PKCapitalFormat(FormatHelper.CleanString(this.txtBigSSCodeGroupQuery.Text)), FormatHelper.PKCapitalFormat(FormatHelper.CleanString(this.txtMaterialModelCodeQuery.Text)), FormatHelper.PKCapitalFormat(FormatHelper.CleanString(this.txtMaterialMachineTypeGroup.Text)), startDate, endDate, CheckBoxListBuilder.GetCheckedList(this.chkTSStateList)); }
//Laws Lu,2005/12/28,比对版本 private Messages CheckSoftVersion(object vc, string strVer, SoftwareActionEventArgs e, ProductInfo product) { Messages msg = new Messages(); if (e.CurrentMO == null) { e.CurrentMO = (new MOModel.MOFacade(DataProvider)).GetMO(product.LastSimulation.MOCode) as Domain.MOModel.MO; } if (e.CurrentMO.MOBIOSVersion != strVer) { msg.Add(new UserControl.Message(MessageType.Error, "$CS_VERSION_COMPARE_NOT_PASS $CS_MO_VERSION=" + e.CurrentMO.MOBIOSVersion + " $CS_CURRENT_VERSION=" + strVer)); DataCollectFacade dcf = new DataCollectFacade(DataProvider); Domain.DataCollect.VersionError ve = dcf.CreateNewVersionError(); ve.PKID = System.Guid.NewGuid().ToString(); ve.MoVersionInfo = e.CurrentMO.MOBIOSVersion; ve.Mocode = e.CurrentMO.MOCode; ve.Rcard = e.RunningCard; ve.VersionInfo = strVer; //Laws Lu,2006/11/13 uniform system collect date DBDateTime dbDateTime; dbDateTime = FormatHelper.GetNowDBDateTime(DataProvider); ve.MDate = dbDateTime.DBDate; ve.MTime = dbDateTime.DBTime; ve.MUser = e.UserCode; DataProvider.BeginTransaction(); try { dcf.AddVersionError(ve); dcf.DeleteVersionCollect(vc as Domain.DataCollect.VersionCollect); DataProvider.CommitTransaction(); } catch (Exception E) { msg.Add(new UserControl.Message(E)); DataProvider.RollbackTransaction(); } finally { ((BenQGuru.eMES.Common.DomainDataProvider.SQLDomainDataProvider)DataProvider).PersistBroker.CloseConnection(); } } return(msg); }
private void QueryResult(string moCode, string mCode, string segCode, string ssCode, string opCode) { if (dataCollectFacade == null) { dataCollectFacade = new DataCollectFacade(this.DataProvider); } try { object[] objDis = dataCollectFacade.GetDisToLineList(moCode, mCode, segCode, ssCode, opCode); DataLoadDetail.Clear(); if (objDis == null) { ApplicationRun.GetInfoForm().Add(new UserControl.Message(MessageType.Normal, "$CS_No_Data_To_Display")); return; } int cnt = 0; foreach (DisToLineList list in objDis) { cnt++; string leftMin = string.Empty; //计算剩余生产时间 if (list.MssleftTime <= 59) { leftMin = Math.Ceiling(list.MssleftTime) + "秒"; } else { leftMin = (Math.Ceiling(Convert.ToDecimal(list.MssleftTime / 60))).ToString() + "分" + Math.Ceiling(list.MssleftTime % 60) + "秒"; } DataLoadDetail.Rows.Add(new object[] { cnt, list.Status, MutiLanguages.ParserString("$CS_DisLine_" + list.Status), list.MssdisQty, list.MssleftQty, leftMin, list.MQty, list.Delflag, list.Delflag == "Y" ? "是" : "否", }); } } catch (Exception ex) { ApplicationRun.GetInfoForm().Add(ex.Message); } }
//生成新事件号 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; } } }
//Process LotCode private void ProcessLotCode(string lotCode) { DataCollectFacade dataCollectFacade = new DataCollectFacade(this.DataProvider); OQCFacade _OQCFacade = new OQCFacade(this.DataProvider); object objSimulationReport = dataCollectFacade.GetLastLotSimulationReport(lotCode); if (objSimulationReport != null) { // Added By hi1/venus.Feng on 20081127 for Hisense Version : 如果没有Carton信息,则不能进行移转 object[] objCarton2Lot = pf.GetCarton2LotByLotCode(lotCode); if (objCarton2Lot == null || objCarton2Lot.Length == 0) { ClearLotCodeInfo(); ucMessage.Add(new UserControl.Message(MessageType.Error , "$Error_LotNoCartonInfo $CS_Param_LotNO =" + lotCode)); ucMessage.Add(new UserControl.Message(">>$CS_Please_Input_LotCode")); txtLotCode.TextFocus(true, true); } else { //add by andy xin 判断包装转移判断Lot是否在TBLLOT2CARD中有 //object lot2Card = _OQCFacade.GetOQCLot2Card((objSimulationReport as Domain.LotDataCollect.LotSimulationReport).LotCode, (objSimulationReport as Domain.LotDataCollect.LotSimulationReport).MOCode, "", ""); //if (lot2Card != null) //{ // OQCLot oqcLot = _OQCFacade.GetOQCLot((lot2Card as OQCLot2Card).LOTNO, OQCFacade.Lot_Sequence_Default) as OQCLot; // if (!(oqcLot.LOTStatus == OQCLotStatus.OQCLotStatus_Reject || oqcLot.LOTStatus == OQCLotStatus.OQCLotStatus_Rejecting || // oqcLot.LOTStatus == OQCLotStatus.OQCLotStatus_Pass || oqcLot.LOTStatus == OQCLotStatus.OQCLotStatus_Passing)) // { // ucMessage.Add(new UserControl.Message(MessageType.Error, "$CS_RCARD_Can_not_Trans")); // this.txtLotCode.TextFocus(true, true); // return; // } //} DisplayLotCodeInfo(objCarton2Lot, objSimulationReport as Domain.LotDataCollect.LotSimulationReport); ucMessage.Add(new UserControl.Message(">>$CS_PleaseInputCartonNo")); txtCartonNO.TextFocus(true, true); } // End Added } else { ClearLotCodeInfo(); ucMessage.Add(new UserControl.Message(MessageType.Error , "$NoSimulation $CS_Param_LotNO =" + lotCode)); ucMessage.Add(new UserControl.Message(">>$CS_Please_Input_LotCode")); txtLotCode.TextFocus(true, true); } }
//选择工单事件--加载途程下拉列表 private void drownListMoCode_SelectedIndexChanged(object sender, EventArgs e) { if (!string.IsNullOrEmpty(Convert.ToString(this.drownListMoCode.SelectedItemValue))) { this.drownListRouteCode.Clear(); Messages msg = new Messages(); if (m_DataCollectFacade == null) { m_DataCollectFacade = new DataCollectFacade(this.DataProvider); } try { //add By Leo@20130128 //获取原始Rcard string sourceRcard = m_DataCollectFacade.GetSourceCard(FormatHelper.CleanString(txtRcard.Text.ToUpper()), this.drownListMoCode.SelectedItemValue.ToString()); //end object[] objSims = m_DataCollectFacade.QueryOnwipRoutesByRcardAndMoCode(FormatHelper.CleanString(sourceRcard), FormatHelper.CleanString(this.drownListMoCode.SelectedItemValue.ToString().Trim().ToUpper())); if (objSims == null) { msg.Add(new UserControl.Message(MessageType.Error, "$Error_CS_ID_Not_Exist")); txtRcard.SelectAll(); txtRcard.Focus(); ApplicationRun.GetInfoForm().Add(msg); return; } //加载当前工单下该产品所经过的全部途程,默认显示当前所在途程的工序信息: ArrayList arrRoute = new ArrayList(); for (int i = 0; i < objSims.Length; i++) { string routeCode = ((OnWIP)objSims[i]).RouteCode; if (!arrRoute.Contains(routeCode)) { arrRoute.Add(routeCode); } } if (arrRoute.Count > 0) { for (int i = 0; i < arrRoute.Count; i++) { this.drownListRouteCode.AddItem(arrRoute[i].ToString(), arrRoute[i].ToString()); } this.drownListRouteCode.SetSelectItemText(arrRoute[0].ToString()); } } catch (Exception ex) { } } }
//Process Running Card private void ProcessRCard(string rcard) { //根据当前序列号获取最新序列号 DataCollectFacade dataCollectFacade = new DataCollectFacade(this.DataProvider); OQCFacade _OQCFacade = new OQCFacade(this.DataProvider); string sourceRCard = dataCollectFacade.GetSourceCard(rcard.Trim().ToUpper(), string.Empty); object objSimulationReport = dataCollectFacade.GetLastSimulationReport(sourceRCard); if (objSimulationReport != null) { // Added By hi1/venus.Feng on 20081127 for Hisense Version : 如果没有Carton信息,则不能进行移转 if (string.IsNullOrEmpty((objSimulationReport as Domain.DataCollect.SimulationReport).CartonCode)) { ClearRCardInfo(); ucMessage.Add(new UserControl.Message(MessageType.Error , "$Error_RCardNoCartonInfo $CS_Param_ID =" + rcard)); txtRCard.TextFocus(true, true); } else { //add by andy xin 判断包装转移判断RCARD是否在TBLLOT2CARD中有 object lot2Card = _OQCFacade.GetOQCLot2Card((objSimulationReport as Domain.DataCollect.SimulationReport).RunningCard, (objSimulationReport as Domain.DataCollect.SimulationReport).MOCode, "", ""); if (lot2Card != null) { OQCLot oqcLot = _OQCFacade.GetOQCLot((lot2Card as OQCLot2Card).LOTNO, OQCFacade.Lot_Sequence_Default) as OQCLot; if (!(oqcLot.LOTStatus == OQCLotStatus.OQCLotStatus_Reject || oqcLot.LOTStatus == OQCLotStatus.OQCLotStatus_Rejecting || oqcLot.LOTStatus == OQCLotStatus.OQCLotStatus_Pass || oqcLot.LOTStatus == OQCLotStatus.OQCLotStatus_Passing)) { ucMessage.Add(new UserControl.Message(MessageType.Error, "$CS_RCARD_In_OQC")); this.txtRCard.TextFocus(true, true); return; } } DisplayRCardInfo(objSimulationReport as Domain.DataCollect.SimulationReport); } // End Added } else { ClearRCardInfo(); ucMessage.Add(new UserControl.Message(MessageType.Error , "$NoSimulation $CS_Param_ID =" + rcard)); txtRCard.TextFocus(true, true); } }
public void initGirdData() { Messages msg = new Messages(); _DataTableLoadedPart.Clear(); if (m_DataCollectFacade == null) { m_DataCollectFacade = new DataCollectFacade(this.DataProvider); } try { //加入工单的条件 add by klaus string sourceRcard = m_DataCollectFacade.GetSourceCard(FormatHelper.CleanString(this.txtRcard.Text.Trim().ToUpper()), this.drownListMoCode.SelectedItemValue.ToString()); object[] objs = m_DataCollectFacade.QueryItemTracingFlow(sourceRcard, Convert.ToString(this.drownListRouteCode.SelectedItemValue), Convert.ToString(this.drownListMoCode.SelectedItemValue)); _DataTableLoadedPart.Clear(); if (objs == null) { ApplicationRun.GetInfoForm().Add(new UserControl.Message(MessageType.Normal, "$CS_No_Data_To_Display")); return; } for (int i = 0; i < objs.Length; i++) { OnWIP wip = objs[i] as OnWIP; _DataTableLoadedPart.Rows.Add(new object[] { wip.ItemCode.ToString(), wip.RunningCard.ToString(), wip.MOCode.ToString(), MutiLanguages.ParserString(wip.ActionResult.ToString()), wip.OPCode.ToString(), GetOPResult(wip.Action), wip.RouteCode.ToString(), wip.SegmentCode.ToString(), wip.StepSequenceCode.ToString(), wip.ResourceCode.ToString(), FormatHelper.ToDateString(wip.MaintainDate), FormatHelper.ToTimeString(wip.MaintainTime), wip.GetDisplayText("MaintainUser") }); } this.gridSimulation.DataSource = this._DataTableLoadedPart; } catch (Exception ex) { } }