public void DeleteMESMessageByID(Newtonsoft.Json.Linq.JObject requestValue, Newtonsoft.Json.Linq.JObject Data, MESStationReturn StationReturn) { OleExec Sfcdb = null; T_C_MES_MESSAGE C_Mes_Message = null; Row_C_MES_MESSAGE Row_C_Mes_Message = null; string DeleteSql = ""; try { string ID = Data["ID"].ToString(); Sfcdb = this.DBPools["SFCDB"].Borrow(); C_Mes_Message = new T_C_MES_MESSAGE(Sfcdb, DBTYPE); Row_C_Mes_Message = (Row_C_MES_MESSAGE)C_Mes_Message.GetObjByID(ID, Sfcdb); DeleteSql = Row_C_Mes_Message.GetDeleteString(DBTYPE); Sfcdb.ExecSQL(DeleteSql); StationReturn.Status = StationReturnStatusValue.Pass; StationReturn.MessageCode = "MES00000004"; StationReturn.Message = "By ID刪除Message OK!"; this.DBPools["SFCDB"].Return(Sfcdb); } catch (Exception e) { this.DBPools["SFCDB"].Return(Sfcdb); throw (e); } }
public static string GetMESReturnMessage(string MessageCode, string[] Paras) { string MESMessage = ""; Language = Language == null ? "ENGLISH" : Language; OleExec sfcdb = _sfcdb.Borrow(); try { T_C_MES_MESSAGE c_mes_message = new T_C_MES_MESSAGE(sfcdb, DB_TYPE_ENUM.Oracle); DataObjectBase row = c_mes_message.GetMESMessageByMessageCode(MessageCode, sfcdb, DB_TYPE_ENUM.Oracle); if (Paras == null) { MESMessage = string.Format(row[Language].ToString()); } else { MESMessage = string.Format(row[Language].ToString(), Paras); } _sfcdb.Return(sfcdb); } catch (Exception ex) { _sfcdb.Return(sfcdb); MESMessage = "500.System Error:" + ex.Message.ToString(); } return(MESMessage); }
public void AddMESMessage(Newtonsoft.Json.Linq.JObject requestValue, Newtonsoft.Json.Linq.JObject Data, MESStationReturn StationReturn) { OleExec Sfcdb = null; T_C_MES_MESSAGE C_Mes_Message = null; Row_C_MES_MESSAGE Row_C_Mes_Message = null; string InsertSql = ""; try { string MessageCode = Data["MessageCode"].ToString(); string Chinese = Data["Chinese"].ToString(); string English = Data["English"].ToString(); string Chinese_TW = Data["Chinese_TW"].ToString(); Sfcdb = this.DBPools["SFCDB"].Borrow(); //GET MESSAGE CODE TEST //string MessageCode = new T_C_SEQNO(Sfcdb, DB_TYPE_ENUM.Oracle).GetLotno("MESMSGCODE", Sfcdb); C_Mes_Message = new T_C_MES_MESSAGE(Sfcdb, DBTYPE); Row_C_Mes_Message = C_Mes_Message.GetMESMessageByMessageCode(MessageCode, Sfcdb, DBTYPE); // if (Row_C_Mes_Message != null) { this.DBPools["SFCDB"].Return(Sfcdb); StationReturn.Status = StationReturnStatusValue.Fail; StationReturn.MessageCode = "MES00000005"; StationReturn.Message = "MessageCode已經存在!"; return; } //C_Mes_Message = new T_C_MES_MESSAGE(Sfcdb, DBTYPE); Row_C_Mes_Message = (Row_C_MES_MESSAGE)C_Mes_Message.NewRow(); Row_C_Mes_Message.ID = C_Mes_Message.GetNewID(BU, Sfcdb); Row_C_Mes_Message.MESSAGE_CODE = MessageCode; Row_C_Mes_Message.CHINESE = Chinese; Row_C_Mes_Message.ENGLISH = English; Row_C_Mes_Message.CHINESE_TW = Chinese_TW; Row_C_Mes_Message.EDIT_EMP = LoginUser.EMP_NO; Row_C_Mes_Message.EDIT_TIME = GetDBDateTime(); InsertSql = Row_C_Mes_Message.GetInsertString(DBTYPE); Sfcdb.ExecSQL(InsertSql); StationReturn.Status = StationReturnStatusValue.Pass; StationReturn.MessageCode = "MES00000002"; StationReturn.Message = "新增MessageCode OK!"; this.DBPools["SFCDB"].Return(Sfcdb); } catch (Exception e) { this.DBPools["SFCDB"].Return(Sfcdb); throw (e); } }
public void UpdateMESMessage(Newtonsoft.Json.Linq.JObject requestValue, Newtonsoft.Json.Linq.JObject Data, MESStationReturn StationReturn) { OleExec Sfcdb = null; string UpdateSql = ""; T_C_MES_MESSAGE C_Mes_Message = null; Row_C_MES_MESSAGE Row_C_Mes_Message = null; try { string ID = Data["ID"].ToString(); string MessageCode = Data["MessageCode"].ToString(); string Chinese = Data["Chinese"].ToString(); string English = Data["English"].ToString(); string Chinese_TW = Data["Chinese_TW"].ToString(); Sfcdb = this.DBPools["SFCDB"].Borrow(); C_Mes_Message = new T_C_MES_MESSAGE(Sfcdb, DBTYPE); Row_C_Mes_Message = (Row_C_MES_MESSAGE)C_Mes_Message.GetObjByID(Data["ID"].ToString(), Sfcdb); if (Row_C_Mes_Message == null) { StationReturn.Status = StationReturnStatusValue.Fail; StationReturn.MessageCode = "MES00000007"; StationReturn.MessagePara = new List <object>() { MessageCode }; return; } Row_C_Mes_Message.ID = ID; Row_C_Mes_Message.MESSAGE_CODE = MessageCode; Row_C_Mes_Message.CHINESE = Chinese; Row_C_Mes_Message.ENGLISH = English; Row_C_Mes_Message.CHINESE_TW = Chinese_TW; UpdateSql = Row_C_Mes_Message.GetUpdateString(DBTYPE); Sfcdb.ExecSQL(UpdateSql); StationReturn.Status = StationReturnStatusValue.Pass; StationReturn.MessageCode = "MES00000003"; StationReturn.Message = "MessageCode更新OK!"; this.DBPools["SFCDB"].Return(Sfcdb); } catch (Exception e) { this.DBPools["SFCDB"].Return(Sfcdb); throw (e); } }
public void GetDetail(JObject requestValue, JObject Data, MESStationReturn StationReturn) { OleExec Sfcdb = null; List <C_MES_MESSAGE> ret = null; string zh_cn = Data["ZH_CN"].ToString(); string zh_tw = Data["ZH_TW"].ToString(); string en = Data["EN"].ToString(); try { Sfcdb = this.DBPools["SFCDB"].Borrow(); // //ret = new T_C_MES_MESSAGE(Sfcdb, DB_TYPE_ENUM.Oracle).GetMsgDetail(Sfcdb, "CHINESE", value); ret = new T_C_MES_MESSAGE(Sfcdb, DB_TYPE_ENUM.Oracle)._GetMsgDetail(Sfcdb, zh_cn, zh_tw, en); if (ret == null || ret.Count == 0) { StationReturn.Data = ""; StationReturn.Status = StationReturnStatusValue.Fail; StationReturn.MessageCode = "MES00000034"; } else { StationReturn.Data = ret; StationReturn.Status = StationReturnStatusValue.Pass; StationReturn.MessageCode = "MES00000001"; } // if (Sfcdb != null) { DBPools["SFCDB"].Return(Sfcdb); } } catch (Exception ex) { if (Sfcdb != null) { DBPools["SFCDB"].Return(Sfcdb); } throw ex; } }
public void GetAllMESMessage(Newtonsoft.Json.Linq.JObject requestValue, Newtonsoft.Json.Linq.JObject Data, MESStationReturn StationReturn) { OleExec Sfcdb = null; List <C_MES_MESSAGE> Ret = new List <C_MES_MESSAGE>(); T_C_MES_MESSAGE C_Mes_Message = null; try { Sfcdb = this.DBPools["SFCDB"].Borrow(); C_Mes_Message = new T_C_MES_MESSAGE(Sfcdb, DBTYPE); Ret = C_Mes_Message.GetAllMESMessage(Sfcdb, DBTYPE); StationReturn.Data = Ret; StationReturn.Status = StationReturnStatusValue.Pass; StationReturn.MessageCode = "MES00000001"; StationReturn.Message = "獲取ALLMessage OK!"; this.DBPools["SFCDB"].Return(Sfcdb); } catch (Exception e) { this.DBPools["SFCDB"].Return(Sfcdb); throw (e); } }