public void INSN_KEYPART_DETAIL(OleExec DB, string bu, string SN_ID, string SN, string KEYPART_SN, string STATION_NAME, string PART_NO, double?SEQ_NO, string CATEGORY_NAME, string CATEGORY, string EDIT_EMP) { T_R_SN_KEYPART_DETAIL T_kd = new T_R_SN_KEYPART_DETAIL(DB, DB_TYPE_ENUM.Oracle); Row_R_SN_KEYPART_DETAIL R_kd = (Row_R_SN_KEYPART_DETAIL)T_kd.NewRow(); try { R_kd.ID = T_kd.GetNewID(bu, DB); R_kd.R_SN_ID = SN_ID; R_kd.SN = SN; R_kd.KEYPART_SN = KEYPART_SN; R_kd.STATION_NAME = STATION_NAME; R_kd.PART_NO = PART_NO; R_kd.SEQ_NO = SEQ_NO; R_kd.CATEGORY_NAME = CATEGORY_NAME; R_kd.CATEGORY = CATEGORY; R_kd.ORIGINAL_CSN = KEYPART_SN; R_kd.VALID = "1"; R_kd.CREATE_EMP = EDIT_EMP; R_kd.CREATE_TIME = GetDBDateTime(DB); R_kd.EDIT_EMP = EDIT_EMP; R_kd.EDIT_TIME = GetDBDateTime(DB); DB.ExecSQL(R_kd.GetInsertString(DB_TYPE_ENUM.Oracle)); } catch (Exception ex) { throw new MESReturnMessage(MESReturnMessage.GetMESReturnMessage("MES00000037", new string[] { ex.Message })); } }
public List <R_SN_KEYPART_DETAIL> GetKeypartBySub_Sn(OleExec sfcdb, string sn, string station) { if (string.IsNullOrEmpty(sn)) { return(null); } DataTable dt = null; Row_R_SN_KEYPART_DETAIL row_main = null; List <R_SN_KEYPART_DETAIL> mains = new List <R_SN_KEYPART_DETAIL>(); string sql = $@"select * from {TableName} where SN='{sn.Replace("'", "''")}' and STATION_NAME='{station}' order by SEQ_NO "; if (DBType == DB_TYPE_ENUM.Oracle) { try { dt = sfcdb.ExecSelect(sql).Tables[0]; foreach (DataRow dr in dt.Rows) { row_main = (Row_R_SN_KEYPART_DETAIL)this.NewRow(); row_main.loadData(dr); mains.Add(row_main.GetDataObject()); } } catch (Exception ex) { //MES00000037 throw new MESReturnMessage(MESReturnMessage.GetMESReturnMessage("MES00000037", new string[] { ex.Message })); } } else { throw new MESReturnMessage(MESReturnMessage.GetMESReturnMessage("MES00000019", new string[] { DBType.ToString() })); } return(mains); }