Exemplo n.º 1
0
        public C_ACTION_CODE GetByid(string id, OleExec DB)
        {
            string strSql = $@"select * from c_action_code where id=:id";

            OleDbParameter[] paramet = new OleDbParameter[] { new OleDbParameter(":id", id) };
            DataTable        res     = DB.ExecuteDataTable(strSql, CommandType.Text, paramet);

            if (res.Rows.Count > 0)
            {
                Row_C_ACTION_CODE ret = (Row_C_ACTION_CODE)NewRow();
                ret.loadData(res.Rows[0]);
                return(ret.GetDataObject());
            }
            else
            {
                return(null);
            }
        }
Exemplo n.º 2
0
        public List <C_ACTION_CODE> GetByFuzzySearch(string ParametValue, OleExec DB)
        {
            string strSql = $@"select * from c_action_code where upper(action_code) like'%{ParametValue}%' or upper(english_description) like'%{ParametValue}%' or upper(chinese_description) like'%{ParametValue}%'";
            List <C_ACTION_CODE> result = new List <C_ACTION_CODE>();
            DataTable            res    = DB.ExecuteDataTable(strSql, CommandType.Text);

            if (res.Rows.Count > 0)
            {
                for (int i = 0; i < res.Rows.Count; i++)
                {
                    Row_C_ACTION_CODE ret = (Row_C_ACTION_CODE)NewRow();
                    ret.loadData(res.Rows[i]);
                    result.Add(ret.GetDataObject());
                }
                return(result);
            }
            else
            {
                return(null);
            }
        }
Exemplo n.º 3
0
        public List <C_ACTION_CODE> GetAllActionCode(OleExec DB)
        {
            string strSql = $@"select * from c_action_code ";
            List <C_ACTION_CODE> result = new List <C_ACTION_CODE>();
            DataTable            res    = DB.ExecuteDataTable(strSql, CommandType.Text);

            if (res.Rows.Count > 0)
            {
                for (int i = 0; i < res.Rows.Count; i++)
                {
                    Row_C_ACTION_CODE ret = (Row_C_ACTION_CODE)NewRow();
                    ret.loadData(res.Rows[i]);
                    result.Add(ret.GetDataObject());
                }
                return(result);
            }
            else
            {
                return(null);
            }
        }