Exemple #1
0
        public List <R_REPAIR_FAILCODE> CheckSNRepairFinishAction(OleExec sfcdb, string sn, string RepairMainID)
        {
            if (string.IsNullOrEmpty(sn) || string.IsNullOrEmpty(RepairMainID))
            {
                return(null);
            }
            DataTable                dt              = null;
            Row_R_REPAIR_FAILCODE    row_fail        = null;
            List <R_REPAIR_FAILCODE> repairFailCodes = new List <R_REPAIR_FAILCODE>();
            string sql = $@" select *from r_repair_failcode where  repair_main_id ='{RepairMainID}' and sn ='{sn}' and id not in (select repair_failcode_id from r_repair_action where sn='{sn}')";

            if (DBType == DB_TYPE_ENUM.Oracle)
            {
                try
                {
                    dt = sfcdb.ExecSelect(sql).Tables[0];
                    foreach (DataRow dr in dt.Rows)
                    {
                        row_fail = (Row_R_REPAIR_FAILCODE)this.NewRow();
                        row_fail.loadData(dr);
                        repairFailCodes.Add(row_fail.GetDataObject());
                    }
                }
                catch (Exception ex)
                {
                    throw new MESReturnMessage(MESReturnMessage.GetMESReturnMessage("MES00000037", new string[] { ex.Message }));
                }
            }
            else
            {
                throw new MESReturnMessage(MESReturnMessage.GetMESReturnMessage("MES00000019", new string[] { DBType.ToString() }));
            }
            return(repairFailCodes);
        }
Exemple #2
0
        public List <R_REPAIR_FAILCODE> GetFailCodeBySN(OleExec sfcdb, string sn)
        {
            if (string.IsNullOrEmpty(sn))
            {
                return(null);
            }
            DataTable                dt              = null;
            Row_R_REPAIR_FAILCODE    row_fail        = null;
            List <R_REPAIR_FAILCODE> repairFailCodes = new List <R_REPAIR_FAILCODE>();
            string sql = $@"select * from {TableName} where sn='{sn.Replace("'", "''")}' ";

            if (DBType == DB_TYPE_ENUM.Oracle)
            {
                try
                {
                    dt = sfcdb.ExecSelect(sql).Tables[0];
                    foreach (DataRow dr in dt.Rows)
                    {
                        row_fail = (Row_R_REPAIR_FAILCODE)this.NewRow();
                        row_fail.loadData(dr);
                        repairFailCodes.Add(row_fail.GetDataObject());
                    }
                }
                catch (Exception ex)
                {
                    throw new MESReturnMessage(MESReturnMessage.GetMESReturnMessage("MES00000037", new string[] { ex.Message }));
                }
            }
            else
            {
                throw new MESReturnMessage(MESReturnMessage.GetMESReturnMessage("MES00000019", new string[] { DBType.ToString() }));
            }
            return(repairFailCodes);
        }