public List <string> GetAql(OleExec DB) { List <string> aqls = new List <string>(); string sql = string.Empty; DataTable dt = new DataTable("Allc_aqltype"); Row_C_AQLTYPE aqlsRow = (Row_C_AQLTYPE)NewRow(); if (this.DBType.Equals(DB_TYPE_ENUM.Oracle)) { sql = $@" select distinct AQL_TYPE from c_aqltype "; dt = DB.ExecSelect(sql, null).Tables[0]; foreach (DataRow dr in dt.Rows) { aqls.Add(dr[0].ToString()); } } else { string errMsg = MESReturnMessage.GetMESReturnMessage("MES00000019", new string[] { DBType.ToString() }); throw new MESReturnMessage(errMsg); } return(aqls); }
public List <C_AQLTYPE> GetAqlTypeBySkuno(string skuno, OleExec DB) { List <C_AQLTYPE> aqls = new List <C_AQLTYPE>(); string sql = string.Empty; DataTable dt = new DataTable("Allc_aqltype"); Row_C_AQLTYPE aqlsRow = (Row_C_AQLTYPE)NewRow(); if (this.DBType.Equals(DB_TYPE_ENUM.Oracle)) { sql = $@" select b.* from c_sku a,c_aqltype b where a.aqltype=b.aql_type and a.skuno='{skuno}' "; dt = DB.ExecSelect(sql, null).Tables[0]; foreach (DataRow dr in dt.Rows) { aqlsRow.loadData(dr); aqls.Add(aqlsRow.GetDataObject()); } } else { string errMsg = MESReturnMessage.GetMESReturnMessage("MES00000019", new string[] { DBType.ToString() }); throw new MESReturnMessage(errMsg); } return(aqls); }
public List <C_AQLTYPE> GetAqlBySkuno(string aqltype, OleExec DB) { List <C_AQLTYPE> aqls = new List <C_AQLTYPE>(); string sql = string.Empty; DataTable dt = new DataTable("Allc_aqltype"); Row_C_AQLTYPE aqlsRow = (Row_C_AQLTYPE)NewRow(); if (this.DBType.Equals(DB_TYPE_ENUM.Oracle)) { sql = $@" select * from c_aqltype where AQL_TYPE='{aqltype}' order by aql_type,gl_level,lot_qty asc "; dt = DB.ExecSelect(sql, null).Tables[0]; foreach (DataRow dr in dt.Rows) { aqlsRow.loadData(dr); aqls.Add(aqlsRow.GetDataObject()); } } else { string errMsg = MESReturnMessage.GetMESReturnMessage("MES00000019", new string[] { DBType.ToString() }); throw new MESReturnMessage(errMsg); } return(aqls); }
public Row_C_AQLTYPE GetByAqltype(string _Aqltype, OleExec DB) { string strsql = ""; if (DBType == DB_TYPE_ENUM.Oracle) { strsql = $@" select ID from C_AQLTYPE where AQL_TYPE='{_Aqltype.Replace("'", "''")}' "; string ID = DB.ExecSelectOneValue(strsql)?.ToString(); if (ID == null) { string errMsg = MESReturnMessage.GetMESReturnMessage("MES00000007", new string[] { "AQLTYPE AT C_AQLTYPE:" + _Aqltype }); throw new MESReturnMessage(errMsg); } Row_C_AQLTYPE R = (Row_C_AQLTYPE)this.GetObjByID(ID, DB); return(R); } else { string errMsg = MESReturnMessage.GetMESReturnMessage("MES00000019", new string[] { DBType.ToString() }); throw new MESReturnMessage(errMsg); } }