Пример #1
0
        public List <string> GetByItemName(string ItemName, OleExec DB)
        {
            string strSql = $@"select * from c_storage_item where item_name=:ItemName ";

            OleDbParameter[] paramet = new OleDbParameter[] { new OleDbParameter(":ItemName", ItemName) };
            List <string>    result  = new List <string>();
            DataTable        res     = DB.ExecuteDataTable(strSql, CommandType.Text, paramet);

            if (res.Rows.Count > 0)
            {
                for (int i = 0; i < res.Rows.Count; i++)
                {
                    Row_C_STORAGE_ITEM ret = (Row_C_STORAGE_ITEM)NewRow();
                    ret.loadData(res.Rows[i]);
                    result.Add(ret.GetDataObject().STORAGE_CODE);
                }
            }
            return(result);
        }
Пример #2
0
        public C_STORAGE_ITEM GetById(string id, OleExec DB)
        {
            string strSql = $@"select * from c_storage_item 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_STORAGE_ITEM ret = (Row_C_STORAGE_ITEM)NewRow();
                ret.loadData(res.Rows[0]);
                return(ret.GetDataObject());
            }
            else
            {
                return(null);
            }
        }
Пример #3
0
        public C_STORAGE_ITEM GetByItemNameAndItemSonAndStorageCode(string ItemName, string ItemSon, string StorageCode, OleExec DB)
        {
            string strSql = $@"select * from c_storage_item where item_name=:ItemName and item_son=:ItemSon and storage_code=:StorageCode";

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

            if (res.Rows.Count > 0)
            {
                Row_C_STORAGE_ITEM ret = (Row_C_STORAGE_ITEM)NewRow();
                ret.loadData(res.Rows[0]);
                return(ret.GetDataObject());
            }
            else
            {
                return(null);
            }
        }