Exemple #1
0
        public C_SEQNO GetSeqnoObj(string SeqName, OleExec DB)
        {
            DataTable Dt  = new DataTable();
            string    sql = $@"SELECT * FROM C_SEQNO WHERE seq_name ='{SeqName}'";

            Dt = DB.ExecSelect(sql).Tables[0];
            Row_C_SEQNO Row = (Row_C_SEQNO)NewRow();

            if (Dt.Rows.Count > 0)
            {
                Row.loadData(Dt.Rows[0]);
            }
            return(Row.GetDataObject());
        }
Exemple #2
0
        public List <C_SEQNO> GetSeq(string SEQ_NAME, string SEQ_NO, OleExec DB)
        {
            List <C_SEQNO> Seq    = new List <C_SEQNO>();
            string         sql    = string.Empty;
            DataTable      dt     = new DataTable("C_SEQNO");
            Row_C_SEQNO    SeqRow = (Row_C_SEQNO)NewRow();

            if (this.DBType.Equals(DB_TYPE_ENUM.Oracle))
            {
                sql = $@"  select * from c_seqno where 1=1  ";
                if (SEQ_NAME != "")
                {
                    sql += $@" and SEQ_NAME='{SEQ_NAME}' ";
                }
                if (SEQ_NO != "")
                {
                    sql += $@" and SEQ_NO='{SEQ_NO}' ";
                }
                if (SEQ_NAME == "" && SEQ_NO == "")
                {
                    sql += $@" and  rownum<21  order by EDIT_TIME ";
                }
                dt = DB.ExecSelect(sql, null).Tables[0];
                foreach (DataRow dr in dt.Rows)
                {
                    SeqRow.loadData(dr);
                    Seq.Add(SeqRow.GetDataObject());
                }
            }
            else
            {
                string errMsg = MESReturnMessage.GetMESReturnMessage("MES00000019", new string[] { DBType.ToString() });
                throw new MESReturnMessage(errMsg);
            }

            return(Seq);
        }