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 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); } }