Exemplo n.º 1
0
        public List <string> GetRepairItemsSonList(string ItemsID, OleExec DB)
        {
            string strSql = string.Empty;

            //if (string.IsNullOrEmpty(ItemsID))
            //{
            //    strSql = $@" select *from c_repair_items_son where items_id in (select min(id) from c_repair_items where 1=1 )";
            //}
            //else
            //{
            strSql = $@" select *from c_repair_items_son where items_id ='{ItemsID}'";
            //  }

            List <string> result = new List <string>();
            DataTable     res    = DB.ExecSelect(strSql).Tables[0];

            result.Add("");  ///BY SDL  加載頁面默認賦予空值,操作員必須點選其他有內容選項
            if (res.Rows.Count > 0)
            {
                for (int i = 0; i < res.Rows.Count; i++)
                {
                    Row_C_REPAIR_ITEMS_SON ret = (Row_C_REPAIR_ITEMS_SON)NewRow();
                    ret.loadData(res.Rows[i]);
                    result.Add(ret.GetDataObject().ITEMS_SON);
                }
            }
            return(result);
        }
Exemplo n.º 2
0
        public Row_C_REPAIR_ITEMS_SON GetIDByItemsSon(string _ItemSon, OleExec DB)
        {
            string strsql = "";

            if (DBType == DB_TYPE_ENUM.Oracle)
            {
                strsql = $@"select ID from c_repair_items_son where items_son='{_ItemSon.Replace("'", "''")}'";
                string ID = DB.ExecSelectOneValue(strsql)?.ToString();
                if (ID == null)
                {
                    string errMsg = MESReturnMessage.GetMESReturnMessage("MES00000007", new string[] { "ItemSon:" + _ItemSon });
                    throw new MESReturnMessage(errMsg);
                }
                Row_C_REPAIR_ITEMS_SON R = (Row_C_REPAIR_ITEMS_SON)this.GetObjByID(ID, DB);
                return(R);
            }
            else
            {
                string errMsg = MESReturnMessage.GetMESReturnMessage("MES00000019", new string[] { DBType.ToString() });
                throw new MESReturnMessage(errMsg);
            }
        }