public C_MES_MESSAGE GetRow(DataRow DR) { Row_C_MES_MESSAGE Ret = (Row_C_MES_MESSAGE)NewRow(); Ret.loadData(DR); return(Ret.GetDataObject()); }
public List <C_MES_MESSAGE> _GetMsgDetail(OleExec sfcdb, string zh_cn, string zh_tw, string en) { DataTable dt = null; Row_C_MES_MESSAGE row_msg = null; List <C_MES_MESSAGE> msgs = new List <C_MES_MESSAGE>(); if (DBType == DB_TYPE_ENUM.Oracle) { string sql = $@"select * from {TableName} where 1=1 "; if (!string.IsNullOrEmpty(zh_cn)) { sql += $@"and chinese like '%{zh_cn.Replace("'", "''")}%' "; } if (!string.IsNullOrEmpty(zh_tw)) { sql += $@"and chinese_tw like '%{zh_tw.Replace("'", "''")}%' "; } if (!string.IsNullOrEmpty(en)) { sql += $@"and english like '%{en.Replace("'", "''")}%' "; } try { dt = sfcdb.ExecSelect(sql).Tables[0]; foreach (DataRow dr in dt.Rows) { row_msg = (Row_C_MES_MESSAGE)NewRow(); row_msg.loadData(dr); msgs.Add(row_msg.GetDataObject()); } return(msgs); } catch (Exception ex) { throw new Exception(MESReturnMessage.GetMESReturnMessage("MES00000037", new string[] { ex.Message })); } } else { throw new Exception(MESReturnMessage.GetMESReturnMessage("MES00000019", new string[] { this.DBType.ToString() })); } }
public List <C_MES_MESSAGE> GetMsgDetail(OleExec sfcdb, string field, string value) { DataTable dt = null; Row_C_MES_MESSAGE row_msg = null; List <C_MES_MESSAGE> msgs = new List <C_MES_MESSAGE>(); //for a test bool flag = this.NewRow().Keys.Contains(field); if (flag) { } if (DBType == DB_TYPE_ENUM.Oracle) { string sql = $@"select * from {TableName} where {field} like '%{value}%' "; try { dt = sfcdb.ExecSelect(sql).Tables[0]; foreach (DataRow dr in dt.Rows) { row_msg = (Row_C_MES_MESSAGE)NewRow(); row_msg.loadData(dr); msgs.Add(row_msg.GetDataObject()); } return(msgs); } catch (Exception ex) { throw new Exception(MESReturnMessage.GetMESReturnMessage("MES00000037", new string[] { ex.Message })); } } else { throw new Exception(MESReturnMessage.GetMESReturnMessage("MES00000019", new string[] { this.DBType.ToString() })); } }