Ejemplo n.º 1
0
        public Row_R_REPAIR_FAILCODE GetByFailCodeID(string _FailCodeID, OleExec DB)
        {
            string strsql = "";

            if (DBType == DB_TYPE_ENUM.Oracle)
            {
                strsql = $@" select * from r_repair_failcode where ID='{_FailCodeID.Replace("'", "''")}' and REPAIR_FLAG='0' ";
                DataSet res = DB.ExecSelect(strsql);
                if (res.Tables[0].Rows.Count > 0)
                {
                    Row_R_REPAIR_FAILCODE Ret = (Row_R_REPAIR_FAILCODE)this.GetObjByID(_FailCodeID, DB);
                    return(Ret);
                }
                else
                {
                    return(null);
                    //string errMsg = MESReturnMessage.GetMESReturnMessage("MES00000007", new string[] { "FailCodeID:" + _FailCodeID });
                    //    throw new MESReturnMessage(errMsg);
                }
            }
            else
            {
                string errMsg = MESReturnMessage.GetMESReturnMessage("MES00000019", new string[] { DBType.ToString() });
                throw new MESReturnMessage(errMsg);
            }
        }
Ejemplo n.º 2
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);
        }
Ejemplo n.º 3
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);
        }