public void DeleteCAqltype(Newtonsoft.Json.Linq.JObject requestValue, Newtonsoft.Json.Linq.JObject Data, MESStationReturn StationReturn) { T_C_SKU_SAMPLE SAMPLE = null; OleExec sfcdb = null; try { sfcdb = this.DBPools["SFCDB"].Borrow(); SAMPLE = new T_C_SKU_SAMPLE(sfcdb, DB_TYPE_ENUM.Oracle); Row_C_SKU_SAMPLE r = (Row_C_SKU_SAMPLE)SAMPLE.GetObjByID((Data["ID"].ToString()).Trim(), sfcdb); string strRet = sfcdb.ExecSQL(r.GetDeleteString(DB_TYPE_ENUM.Oracle)); if (Convert.ToInt32(strRet) > 0) { StationReturn.Message = "刪除成功!!"; StationReturn.Status = StationReturnStatusValue.Pass; StationReturn.Data = ""; } else { StationReturn.MessageCode = "MES00000036"; StationReturn.Status = StationReturnStatusValue.Fail; StationReturn.Data = ""; } this.DBPools["SFCDB"].Return(sfcdb); } catch (Exception e) { this.DBPools["SFCDB"].Return(sfcdb); throw e; } }
public void SelectCSkuSample(Newtonsoft.Json.Linq.JObject requestValue, Newtonsoft.Json.Linq.JObject Data, MESStationReturn StationReturn) { T_C_SKU_SAMPLE SAMPLE = null; OleExec sfcdb = null; try { sfcdb = this.DBPools["SFCDB"].Borrow(); SAMPLE = new T_C_SKU_SAMPLE(sfcdb, DB_TYPE_ENUM.Oracle); List <C_SKU_SAMPLE> list = SAMPLE.GetSample((Data["SKUNO"].ToString()).Trim(), (Data["STATION_NAME"].ToString()).Trim(), sfcdb); if (list.Count > 0) { StationReturn.Message = "获取成功!!"; StationReturn.Status = StationReturnStatusValue.Pass; StationReturn.Data = list; } else { StationReturn.MessageCode = "MES00000036"; StationReturn.Status = StationReturnStatusValue.Fail; StationReturn.Data = ""; } this.DBPools["SFCDB"].Return(sfcdb); } catch (Exception e) { this.DBPools["SFCDB"].Return(sfcdb); throw e; } }
public void AddCSkuSample(Newtonsoft.Json.Linq.JObject requestValue, Newtonsoft.Json.Linq.JObject Data, MESStationReturn StationReturn) { T_C_SKU_SAMPLE SAMPLE = null; OleExec sfcdb = null; try { sfcdb = this.DBPools["SFCDB"].Borrow(); SAMPLE = new T_C_SKU_SAMPLE(sfcdb, DB_TYPE_ENUM.Oracle); Row_C_SKU_SAMPLE r = (Row_C_SKU_SAMPLE)SAMPLE.NewRow(); r.ID = SAMPLE.GetNewID(this.BU, sfcdb); r.SKUNO = (Data["SKUNO"].ToString()).Trim(); r.STATION_NAME = (Data["STATION_NAME"].ToString()).Trim(); r.AQL_TYPE = (Data["AQL_TYPE"].ToString()).Trim(); r.EDIT_EMP = this.LoginUser.EMP_NO; r.EDIT_TIME = GetDBDateTime(); string strRet = sfcdb.ExecSQL(r.GetInsertString(DB_TYPE_ENUM.Oracle)); if (Convert.ToInt32(strRet) > 0) { StationReturn.Message = "添加成功!!"; StationReturn.Status = StationReturnStatusValue.Pass; StationReturn.Data = ""; } else { StationReturn.MessageCode = "MES00000036"; StationReturn.Status = StationReturnStatusValue.Fail; StationReturn.Data = ""; } this.DBPools["SFCDB"].Return(sfcdb); } catch (Exception e) { this.DBPools["SFCDB"].Return(sfcdb); throw e; } }
/// <summary> /// 獲取批次抽樣數量 /// </summary> /// <param name="Station"></param> /// <param name="Input"></param> /// <param name="Paras">1個參數,SKU 保存的位置</param> public static void GetSampleQtyDataloader(MESPubLab.MESStation.MESStationBase Station, MESPubLab.MESStation.MESStationInput Input, List <MESDataObject.Module.R_Station_Action_Para> Paras) { Row_C_SKU_SAMPLE RLotSku; Row_C_AQLTYPE RAqltype; T_C_AQLTYPE QR = new T_C_AQLTYPE(Station.SFCDB, MESDataObject.DB_TYPE_ENUM.Oracle); T_C_SKU_SAMPLE TR = new T_C_SKU_SAMPLE(Station.SFCDB, MESDataObject.DB_TYPE_ENUM.Oracle); if (Paras.Count != 10) { throw new Exception(MESReturnMessage.GetMESReturnMessage("MES00000050")); } MESStationSession SessionSN = Station.StationSession.Find(t => t.MESDataType == Paras[0].SESSION_TYPE && t.SessionKey == Paras[0].SESSION_KEY); MESStationSession SessionSKU = Station.StationSession.Find(t => t.MESDataType == Paras[1].SESSION_TYPE && t.SessionKey == Paras[1].SESSION_KEY); MESStationSession SessionAQLTYPE = Station.StationSession.Find(t => t.MESDataType == Paras[2].SESSION_TYPE && t.SessionKey == Paras[2].SESSION_KEY); MESStationSession SessionLotQTY = Station.StationSession.Find(t => t.MESDataType == Paras[3].SESSION_TYPE && t.SessionKey == Paras[3].SESSION_KEY); MESStationSession SessionSAMPLEQTY = Station.StationSession.Find(t => t.MESDataType == Paras[4].SESSION_TYPE && t.SessionKey == Paras[4].SESSION_KEY); MESStationSession SessionREJECTQTY = Station.StationSession.Find(t => t.MESDataType == Paras[5].SESSION_TYPE && t.SessionKey == Paras[5].SESSION_KEY); MESStationSession SessionPassQty = Station.StationSession.Find(t => t.MESDataType == Paras[6].SESSION_TYPE && t.SessionKey == Paras[6].SESSION_KEY); MESStationSession SessionFailQty = Station.StationSession.Find(t => t.MESDataType == Paras[7].SESSION_TYPE && t.SessionKey == Paras[7].SESSION_KEY); MESStationSession SessionLotNewFlag = Station.StationSession.Find(t => t.MESDataType == Paras[8].SESSION_TYPE && t.SessionKey == Paras[8].SESSION_KEY); MESStationSession SessionLotNo = Station.StationSession.Find(t => t.MESDataType == Paras[9].SESSION_TYPE && t.SessionKey == Paras[9].SESSION_KEY); if (SessionSN == null) { //throw new Exception("请输入SN!"); throw new Exception(MESReturnMessage.GetMESReturnMessage("MES00000052", new string[] { Paras[0].SESSION_TYPE })); } SN ObjSN = (SN)SessionSN.Value; //if (SessionSKU == null) //{ // SessionSKU = new MESStationSession() { MESDataType = Paras[1].SESSION_TYPE, InputValue = Input.Value.ToString(), SessionKey = Paras[1].SESSION_KEY, ResetInput = Input }; // Station.StationSession.Add(SessionSKU); //} if (SessionAQLTYPE == null) { SessionAQLTYPE = new MESStationSession() { MESDataType = Paras[2].SESSION_TYPE, InputValue = Input.Value.ToString(), SessionKey = Paras[2].SESSION_KEY, ResetInput = Input }; Station.StationSession.Add(SessionAQLTYPE); } if (SessionLotQTY == null) { SessionLotQTY = new MESStationSession() { MESDataType = Paras[3].SESSION_TYPE, InputValue = Input.Value.ToString(), SessionKey = Paras[3].SESSION_KEY, ResetInput = Input }; Station.StationSession.Add(SessionLotQTY); } if (SessionSAMPLEQTY == null) { SessionSAMPLEQTY = new MESStationSession() { MESDataType = Paras[4].SESSION_TYPE, InputValue = Input.Value.ToString(), SessionKey = Paras[4].SESSION_KEY, ResetInput = Input }; Station.StationSession.Add(SessionSAMPLEQTY); } if (SessionREJECTQTY == null) { SessionREJECTQTY = new MESStationSession() { MESDataType = Paras[5].SESSION_TYPE, InputValue = Input.Value.ToString(), SessionKey = Paras[5].SESSION_KEY, ResetInput = Input }; Station.StationSession.Add(SessionREJECTQTY); } if (SessionPassQty == null) { SessionPassQty = new MESStationSession() { MESDataType = Paras[6].SESSION_TYPE, InputValue = Input.Value.ToString(), SessionKey = Paras[6].SESSION_KEY, ResetInput = Input }; Station.StationSession.Add(SessionPassQty); } if (SessionFailQty == null) { SessionFailQty = new MESStationSession() { MESDataType = Paras[7].SESSION_TYPE, InputValue = Input.Value.ToString(), SessionKey = Paras[7].SESSION_KEY, ResetInput = Input }; Station.StationSession.Add(SessionFailQty); } if (SessionLotNewFlag == null) { SessionLotNewFlag = new MESStationSession() { MESDataType = Paras[8].SESSION_TYPE, InputValue = Input.Value.ToString(), SessionKey = Paras[8].SESSION_KEY, ResetInput = Input }; Station.StationSession.Add(SessionLotNewFlag); } if (SessionLotNo == null) { throw new MESReturnMessage(MESReturnMessage.GetMESReturnMessage("MES00000052", new string[] { Paras[9].SESSION_TYPE + Paras[9].SESSION_KEY })); } try { if ((string)SessionLotNewFlag.Value == "1") { if (Paras[1].VALUE.ToString() == "ALL") { RLotSku = TR.GetBySkuNo(Paras[1].VALUE.ToString(), ObjSN.NextStation, Station.SFCDB); RAqltype = QR.GetByAqltype(RLotSku.AQL_TYPE, Station.SFCDB); SessionAQLTYPE.Value = RAqltype.AQL_TYPE; //Marked by LLF //SessionLotQTY.Value = RAqltype.LOT_QTY; //SessionSAMPLEQTY.Value = RAqltype.SAMPLE_QTY; //SessionREJECTQTY.Value = RAqltype.REJECT_QTY; } else { RLotSku = TR.GetBySkuNo(ObjSN.SkuNo, ObjSN.NextStation, Station.SFCDB); RAqltype = QR.GetByAqltype(RLotSku.AQL_TYPE, Station.SFCDB); SessionAQLTYPE.Value = RAqltype.AQL_TYPE; //Marked by LLF //SessionLotQTY.Value = RAqltype.LOT_QTY; //SessionSAMPLEQTY.Value = RAqltype.SAMPLE_QTY; //SessionREJECTQTY.Value = RAqltype.REJECT_QTY; } SessionPassQty.Value = 0; SessionFailQty.Value = 0; SessionLotQTY.Value = 0; SessionSAMPLEQTY.Value = 0; SessionREJECTQTY.Value = 0; } else { SessionAQLTYPE.Value = ((LotNo)SessionLotNo.Value).AQL_TYPE; SessionLotQTY.Value = ((LotNo)SessionLotNo.Value).LOT_QTY; SessionSAMPLEQTY.Value = ((LotNo)SessionLotNo.Value).SAMPLE_QTY; SessionREJECTQTY.Value = ((LotNo)SessionLotNo.Value).REJECT_QTY; SessionPassQty.Value = ((LotNo)SessionLotNo.Value).PASS_QTY; SessionFailQty.Value = ((LotNo)SessionLotNo.Value).FAIL_QTY; } //Station.AddMessage("MES00000104", new string[] { "AQLTYPE", RAqltype.AQL_TYPE, "LotQTY", RAqltype.LOT_QTY.ToString(), "SAMPLEQTY", RAqltype.SAMPLE_QTY.ToString(), "REJECTQTY", RAqltype.REJECT_QTY.ToString() }, MESPubLab.MESStation.MESReturnView.Station.StationMessageState.Message); Station.AddMessage("MES00000104", new string[] { "AQLTYPE", SessionAQLTYPE.Value.ToString(), "LotQTY", SessionLotQTY.Value.ToString(), "SAMPLEQTY", SessionSAMPLEQTY.Value.ToString(), "REJECTQTY", SessionREJECTQTY.Value.ToString() }, MESPubLab.MESStation.MESReturnView.Station.StationMessageState.Message); } catch (Exception ex) { string msgCode = ex.Message; throw ex; } }